הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

חזור   הוסטס - פורום אחסון האתרים הגדול בישראל > עיצוב גראפי, תכנות על כל שפותיו וקידום ושיווק אתרים > פורום תיכנות

   
|!|

 
 
כלים לאשכול תצורת הצגה
Prev הודעה קודמת   הודעה הבאה Next
ישן 31-12-08, 19:31   # 7
intercooler3819
חבר וותיק
 
מיני פרופיל
תאריך הצטרפות: Jul 2008
הודעות: 1,056

intercooler3819 לא מחובר  

ציטוט:
<html>
<head> <title> Connect </title> </head>
<body> <h1> connect to your editor </h1>
<?php
$connection = mysql_connect("DBNAME" , "USERNAME" , "PASSWORD") or die ("couldn't connect to the server");
mysql_select_db("DBNAME" , $connection ) or die ("couldn't connect to the database");

function connect() {
return <<<EOF
<FORM METHOD = "POST" ACTION="">
<INPUT TYPE="TEXT" NAME="USERNAME"> <br><br>
<INPUT TYPE="PASSWORD" Name="PASSWORD"> <br><br>
<INPUT TYPE="SUBMIT" VALUE="התחבר" NAME="SUBMIT">
</FORM>
EOF; // dollarconnect is a local variable withing the function connect, this won't get you anything except headaches
}

if(isset($_POST'['SUBMIT'])) { // what about closing the if?

$q = mysql_query ("SELECT * FROM 'table1' WHERE 'USERNAME' = '{$_POST['USERNAME']}' AND 'PASSWORD' = '{$_POST['PASSWORD']}' ");
$r = mysql_num_rows ($q);
if ($r == 1) // if there are couple of users with the same name and password?
{
echo 'you are online, and you can use the editor';
}

else {
echo 'bad username or password, please try again';
echo "<br />" . connect(); // since i changed connect() i should echo the returned value too
}
}

?>
</body>
</html>
have fun pal
__________________
  Reply With Quote
 

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 


חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 06:12.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ