کد PHP:
<div id="wrraper"><?phpinclude('C:\wamp\www\project\include\config.php');include('C:\wamp\www\project\include\menu.html');echo "<div id='picr'>";echo "<form action=\"register.php\" method=\"post\"><fieldset> <table width=\"347\" height=\"274\" id=\"form\"> <tr> <td width=\"138\">Name:</td> <td width=\"141\"><label for=\"name\"></label> <input type=\"text\" name=\"name\" id=\"name\" /></td> </tr> <tr> <td>Username:</td> <td><label for=\"username\"></label> <input type=\"text\" name=\"username\" id=\"username\" /></td> </tr> <tr> <td>E-mail:</td> <td><label for=\"email\"></label> <input type=\"text\" name=\"email\" id=\"email\" /></td> </tr> <tr> <td>Password</td> <td><label for=\"pass\"></label> <input type=\"password\" name=\"pass\" id=\"pass\" /></td> </tr> <tr> <td>ConfirmPassword</td> <td><label for=\"cpass\"></label> <input type=\"password\" name=\"cpass\" id=\"cpass\" /></td> </tr> <tr> <td colspan=\"2\" align=\"center\"><input type=\"submit\" name=\"button\" id=\"button\" value=\"Submit\" /></td> </tr></table>
</fieldset></form>";include('C:\wamp\www\project\include\config.php');if(!empty($_POST['name']) && !empty($_POST['username']) && !empty($_POST['email']) && !empty($_POST['pass']) &&!empty($_POST['cpass'])){ $name=$_POST['name']; $username=$_POST['username']; $email=$_POST['email']; if($_POST['pass'] == $_POST['cpass']){ $pass=$_POST['pass']; }else{ echo "<p> Password and confirm Password is not match."; $pass= NULL; } $q= mysql_query("INSERT INTO user(name,username,email,pass) VALUE('$name','$username','$email','$pass')",$connect); echo "<b id=\"Error\">Thank you! rigestred Successfully!<br>You'll be redirected to Login Page after (4) Seconds"; echo "<meta http-equiv=Refresh content=5; url=login.php>"; }//end if else{ echo "<p id=\"Error\"> please back and chek the form</p>"; }
echo "</div>";?>
مهمترین بخش این پروژه صفحه اصلی هست که میخوام 3 تا عکس رو بصورت رندوم از دیتابیس بخونه و نمایش بده