|
Web design and Programming Discuss website creation and other programming topics. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||
|
Panther...
PANTHer will you make a tutorial, I could really use one. A PHP.
|
#2
|
|||
|
on....?
__________________
Quote:
|
#3
|
||
|
SRY A PHP TUTORIAL
|
#4
|
|||
|
yeah, about.......? The basics of PHP, what? You can probably find some tutorials on Google
__________________
Quote:
|
#5
|
||
|
Everything there is to know
|
#6
|
|||
|
I highly doubt Panther is going to write a tutorial on everything there is to know about PHP.
__________________
Quote:
|
#7
|
||||
|
__________________
Click here for the official member status images! Quote:
Quote:
|
#8
|
||
|
|
#9
|
|||
|
worlds best search engine
__________________
Supporter > < Supporter Quote:
|
#10
|
||
|
I also highley doubt I know everything there is to know.
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#11
|
||
|
I'm going to read tutorials on hotwired. and after that if i have questions I will ask you, easier than you writing a tutorial. I'm already started on a guest book. Here take a look :
Code:
<html><head><title>Welcome to my Guest Book! - Powered by !EliteGuestBookV.1.0.0</title></head> <body> <p>Add to my guest book:<p> <form method="Post" action="guestbook.php"> Name:<input type="text" name="T1" size="20"></p> <p>Email: <input type="text" name="T2" size="20"></p> <p>Comments:</p> <p><textarea rows="5" name="S1" cols="21"></textarea></p> <p> <input type="submit" value="Add entry!" name="B1" style="border-style: solid; border-width: 1"><input type="reset" value="Reset Forms" name="B2" style="border-style: solid; border-width: 1"></p> </form> <?php /* Made by -Elite-, visit www.squad-host.com for more info! Now first we make it so it shows the entries*/ $db = mysql_connect("localhost", "root"); mysql_select_db("mydb",$db); // display individual record if ($id) { $result = mysql_query("SELECT * FROM guestbook WHERE id=$id",$db); $myrow = mysql_fetch_array($result); printf("Name: %s\n<br>", $myrow["first"]); printf("Email: %s\n<br>", $myrow["email"]); printf("Comments: %s\n<br>", $myrow["comments"]); }Else{ // In case the data doesn't load or there // are no entries we'll have text to display print ("Either the data will not load, or there have been no entries! Please fill out a entry at the top!); ?> |
#12
|
||
|
If you want it to show all the entrys you need to do
while($myrow=mysql_fetch_array($query)) { echo("Name: ".stripslashes($myrow['name'])); } ..
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#13
|
||
|
I'm starting to understand php, oh yeah...I have many scripts planned for the future.
|
#14
|
||
|
Would this work as a guest book?
Code:
<html><head><title>Welcome to my Guest Book! - Powered by !EliteGuestBookV.1.0.0</title></head> <body> <p>Add to my guest book:<p> <?php if ($submit) { // process form $db = mysql_connect("localhost", "root"); mysql_select_db("mydb",$db); $sql = "INSERT INTO guestbook (first,email,comments) VALUES ('$first','$email','$comments')"; $result = mysql_query($sql); echo "Thank you! Information entered.\n"; } else{ // display form ?> <form method="Post" action="guestbook.php"> Name:<input type="text" name="first" size="20"></p> <p>Email: <input type="text" name="email" size="20"></p> <p>Comments:</p> <p><textarea rows="5" name="comments" cols="21"></textarea></p> <p> <input type="submit" value="Add entry!" name="B1" style="border-style: solid; border-width: 1"><input type="reset" value="Reset Forms" name="B2" style="border-style: solid; border-width: 1"></p> </form> <?php /* Made by -Elite-, visit www.squad-host.com for more info! Now first we make it so it shows the entries*/ $db = mysql_connect("localhost", "root"); mysql_select_db("mydb",$db); // display individual record $result = mysql_query("SELECT * FROM guestbook",$db); while ($myrow = mysql_fetch_array($result)) { printf("<a href=\"%s?id=%s\">%s %s</a><br>\n", $PHP_SELF, $myrow["first"], $myrow["email"], $myrow["comments"]); } } }Else{ // In case the data doesn't load or there // are no entries we'll have text to display print ("Either the data will not load, or there have been no entries! Please fill out a entry at the top!); ?> </body> </html> |
#15
|
||
|
Yes, heres my version.
Code:
<html><head><title>Welcome to my Guest Book! - Powered by !EliteGuestBookV.1.0.0</title></head> <body> <p>Add to my guest book:<p> <? $db=mysql_connect("localhost", "root"); mysql_select_db("mydb",$db); If($_POST['submit']) { If($name=="" || $email=="" || $comments=="") { //If they left the name,email or comments field blank they get this :). Echo("You did not complete all the fields :). Please go back and try again."); } Else { mysql_query("INSERT INTO guestbook (first,email,comments) VALUES ('$first','$email','$comments')"); Echo("Thank you! Information entered.\n"); } } Else { ?> <form method="Post" action="guestbook.php"> Name:<input type="text" name="first" size="20"></p> <p>Email: <input type="text" name="email" size="20"></p> <p>Comments:</p> <p><textarea rows="5" name="comments" cols="21"></textarea></p> <p> <input type="submit" value="Add entry!" name="submit" style="border-style: solid; border-width: 1"><input type="reset" value="Reset Forms" name="B2" style="border-style: solid; border-width: 1"></p></form> <? $query = mysql_query("SELECT * FROM guestbook"); If(!mysql_num_rows($query)) { Echo("There are no entrys to display"); } Else { while ($result = mysql_fetch_array($query)) { extract($result); // http://us2.php.net/extract/ Echo("I will show you the entrys now!"); } } mysql_free_result($query); } mysql_close($db); ?> </body> </html>
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#16
|
||
|
Thanks I'm happy I made my first PHP script, I'm going to add
Code:
If ($first=="" || $email=="" || $comments=="") { //makes it so if they left it empty they will //have to redo it, lol learned //that from panther echo ("Not all required forms are filled, you must fill in: Name, Email, and Comments."); |
#17
|
||
|
Can i use that guestbook for mmhq? Pleeeasse
|
#18
|
||
|
lol no reason to make me feel bad
|
#19
|
||
|
well can i? It can say coded by -Elite- at the bottom
|
#20
|
||
|
well , if you really want to. I'll whip it up, and make it look nice. Just email me what your colors and stuff on your site look like, and i'll try to whip one up. . Link text, a link, so on.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Panther | NaughtyPerry | Web design and Programming | 3 | 08-23-2005 01:02 PM |
Panther | Roshi | Delta Force | 19 | 05-07-2004 10:47 AM |