View Full Version : php newbie help
jhunphankx
08-10-2001, 09:56 PM
i'm making a simple guestbook which requires php. well, i don't know how to use php, therefore i need some help. so, here is the question: what is $ and & <---what they stand for, what do they do????? or can you find me a site with easy php basics tutorial regarding these matter????
thankx for your help!!!!
;) jhunphankx
flashkit.com has a great guestbook tutorial, that is what i used because i am a beginner with php as well, it looks difficult but actually it isnt too bad, good luck
Jesse
08-11-2001, 02:12 AM
$ comes before a variable name: $variable
the best place to learn is http://www.php.net , that's where I learned. no tutorials, just documentation :) or try this tutorial: http://hotwired.lycos.com/webmonkey/programming/php/tutorials/tutorial4.html
snowdude
08-13-2001, 10:19 AM
Can't really add to this one that much, anways here's an example - This is the exact script that I use for the Footer Guestbook (the flash footer below this). It's really simple, just about the most basic you could ask for, and you should be able to see how it works. Anyways, I probably shouldn't post this for security reasons, but everyone's nice here anyways.:
<?
$Name = ereg_replace("[^A-Za-z0-9 ]", "", $Name);
$Email = ereg_replace("[^A-Za-z0-9 \@\.\-\/]", "", $Email);
$Comments = ereg_replace("[^A-Za-z0-9 \@\.\-\:]", "", $Comments);
$filename = "GuestBook.txt";
$fp = fopen( $filename,"r");
$Old = fread($fp, 2000);
fclose( $fp );
$Today = date("m.d.y");
$Input = "<tr><td>Name: <b>$Name</b><br>Email: <b>$Email</b><br>Comments: <b>$Comments</b><br><i><font size=\"-1\">Date: $Today</font></td></tr>";
$New = "$Input$Old";
$fp = fopen( $filename,"w+");
fwrite($fp, $New, 2000);
fclose( $fp );
?>
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.