Re: [PHP] line break part2
$string = nl2br($string) This will change a new line into br; but make sure HTMLspecialchars aren't in the same part. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] [NEWBIE] :P
Hi. I'm writing a new script, but I need some help.. I won't post here because it's just too much. I'm looking for someone who is dedicated and patient in helping a 13 year old with SQL and connecting/recieving, inserting and updating databases. I have ideas, I have some basic knowledge of PHP but I need someone who can help answer questions, patiently. If you wouldn't mind helping (I realise this may sound stupid) please message me. 51599351 on ICQ. Thanks, Owen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] I'm a moron. So?
Alrighty. I'm baack! Anyways, I seem to be having stupid little problems, al of which are driving me insane. I'll feel really stupid when you tell me the problem. A friend told me something about "seeding" for random() but I didn't find anything on that. This is the HTML section... HTML HEAD TITLEHorse Race v.1/TITLE /HEAD BODY Welcome to horse racing v.1. This is a simple PHP game where you can train, race and win money for your animals. Eventually I'll make it a whole barn with feeding and horses, and costs, age, breeding. So on. But for now, this is just a simple game.brbr Enter six names of horses. FORM ACTION="horse.php" METHOD="post" Name1 : INPUT TYPE="text" NAME="name1" size="24"BR Name2 : INPUT TYPE="text" NAME="name2" size="24"BR Name3 : INPUT TYPE="text" NAME="name3" size="24"BR Name4 : INPUT TYPE="text" NAME="name4" size="24"BR Name5 : INPUT TYPE="text" NAME="name5" size="24"BR Name6 : INPUT TYPE="text" NAME="name6" size="24"BR input type="submit" name="submitNms" value="race them!" /FORM centerGood luck! /BODY /HTML This is the PHP... ? $name1 = "$n1"; $name1 = "$n2"; $name3 = "$n3"; $name4 = "$n4"; $name5 = "$n5"; $name6 = "$n6"; $randomHorse = rand($name1, $name6); $randomStrides = rand(1, 10); echo "$randomHorse won the race by $randomStrides ! Congratulations."; ? --- And I feel stupid. g -Owen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP Books
PHP4 - written by Chris Ullman (and some others. It has 5 pictures on the front...) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTMLSpecialchars
Thanks for all the advice, Brian. If you're referring to a database as MySQL or any other database technology then I guess I haven't been precise enough. I'm really quite new into PHP and I'm just using text files for now. I'm slowly working my way up to MySQL, but fooling around with my learned skills first. Thanks! -Owen o-canada.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] HTMLSpecialchars
I'm having a problem with HTMLspecialchars and nl2br interfearing with each other. Obviously, I'm trying to stop malicous HTML/scripts from being entered into my guestbook, but I'm also trying to add spacing. nl2br adds br, but HTMLspecialchars tells it to not show that. Anyways, I'm sure there is a way around this. All help is welcome, so I'm eager for replys. Thank you very, very much! -Owen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] HTML and slashes.
Hi. Considering PHP takes " 's " into consideration as part of the script, and adds a slash infront of them I need a way to overcome this. And second of all, I need a way to prevent HTML code from being seen, none the less used on the output. ? $space = " "; if( $submitfrm ) { echo "your entry will be added shortly."; $submitmsg = file( "gb.txt" ); $fp = fopen( "gb.txt", 'a' ); rewind($fp); fwrite( $fp, "table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" tr td width=\"236\"pfont size=\"1\"b$subject/b : a href=\"mailto:$email\"$name/a/td /tr tr td width=\"236\"font size=\"1\"p$submition/td /tr /tablebr" ); fclose( $fp ); } else { include ( "guestbooks.php" ); } ? All help's welcome, since I need it.. :P -Owen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTML and slashes.
there is NO way of hiding the html from the user. the browser can't output otherwise. You can only try to make it difficult to get the source. I want to hide the HTML from the browser. If someone adds some malicious code, or even u/u I don't want it to underline. Where does the " 's " problem come in? More detail plz. Is it a part of a text? Then try htmlspecialchars() or htmlentities(). Say I right "Hiya, my name's Owen" on the submission part of the form. It'll show up as "Hiya, my name\'s Owen" on the output (which is a .txt file.) HTH, Owen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTML and slashes.
Thanks! :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php like cgi
? $greeting = "Hello!" echo "$greeting" ? g -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Parse error - script help.
Ok, I know it's messy - no, I don't care. :P Parse error: parse error in C:/XITAMI/owen/website/tss/guestbookSG.php on line 43 html head titlethe southern side : owen : mmmHm/title style !-- A:hover { color:rgb(215,152,1); cursor:hand-il; } A:link { font-style:normal; font-weight:normal; text-decoration:none; cursor:hand-il; } A:visited { font-style:normal; font-weight:normal; text-decoration:none; cursor:hand-il; } -- /style /head body bgcolor="white" text="black" link="black" vlink="black" alink="black" p align="center"nbsp; div align="center"table border="0" cellpadding="0" cellspacing="0" tr td width="304"pimg src="top.gif" width="302" height="18" border="0"/td /tr /table/div div align="center"table border="0" cellpadding="0" cellspacing="0" tr td width="87" valign="top" bgcolor="white" background="bg1.gif"p align="center"font face="Verdana" size="1"tss menu/font/p ? include("tssmenu.txt") ? pnbsp;/p pnbsp;/p pnbsp;/td td width="219" valign="top"pfont face="Verdana" size="1"bguestbook signed/b/fontfont face="Verdana" size="1": /fonta href="mailto:[EMAIL PROTECTED]"font face="Verdana" size="1"Owen/font/a/p pfont face="Verdana" size="1" ? $space = " "; if( $submitfrm ) { echo "your entry will be added shortly."; $submitmsg = file( "gb.txt" ); $fp = fopen( "gb.txt", 'a' ); rewind($fp); fwrite( $fp, "fwrite( $fp, "table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" tr td width=\"236\"pfont size=\"1\"b$subject/b : a href=\"mailto:$email\"$name/a/td /tr tr td width=\"236\"font size=\"1\"p$submition/td /tr /tablebr" ); fclose( $fp ); } else { include ( "guestbooks.php" ); } ? /font/td /tr /table/div div align="center"table border="0" cellpadding="0" cellspacing="0" tr td width="300"p align="center"img src="bottom.gif" width="281" height="8" border="0"/td /tr /table/div pnbsp;/p /body /html It isn't working. Pfft! -Owen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Job in Whistler, BC
Whistler's cool! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] [PHP4]
All the variables are true. When I "post" the information to a nother file from the form, it works. This is the form script, if you're wondering.. HTML TITLESubmit news/TITLE BODY form action="newSubmit.php" method="post" tdName:/td tdinput type="text" name="frmName" size="24"br tdEmail:/td tdinput type="text" name="email" size="24"br tdSubject:/td tdinput type="text" name="subject" size="24"br Message: textarea name="message" rows="8" cols="70"/textareabr input type="submit" name ="formSubmit value="Submit" /BODY /HTML -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] [PHP4] $fp = fopen( news.txt, 'a' ); // 'a' = append! Wah!
I'm writing a news script, and I just got it working earlier this morning. Now it writes the variables from the form to the .txt file; but when I go to write again (another news article) it does it beside, not above. Me, thinking so brilliantly at 6AM, thought append would mean above, but it means beside. This is the script in working condition, although it only writes one varibale since I was testing. I'm not using mysql, only a .txt file and two PHP documents. ? if( $formSubmit ) { echo "Your news has been processed."; $newsSubmit = file( "news.txt" ); $fp = fopen( "news.txt", 'a' ); fwrite( $fp, $frmName ); fclose( $fp ); } else { include ( "newsForm.php" ); } ? What I want it to do is post $frmName in the .txt file, and when another entry is processed it will add that above. I hope this is possible, because I don't have access to a MySQL database *yet.* Post all suggestions, please. -Owen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] [PHP4] $fp = fopen( news.txt, 'a' ); // 'a' = append! Wah!
Thanks for the quick reply, looking in to it! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] [PHP4] $fp = fopen( news.txt, 'a' ); // 'a' = append! Wah!
Ok, with this fseek.. Could you give me an example of how to implement it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] rewind
Thanks! :) Jack Dempsey wrote: someone was asking about fseek...try this: http://www.php.net/manual/en/function.rewind.php i haven't tried it, but it seems to return the pointer to the beginning, which is where you wanted... -jack -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] [PHP4] $fp = fopen( news.txt, 'a' ); // 'a' = append! Wah!
When you say $newsSubmit = fread ($fd, filesize ($filename)); Do you mean specify the filename? $news.txt then? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] [PHP4] $fp = fopen( news.txt, 'a' ); // 'a' = append! Wah!
Oh. Duh! Thanks. ;P Joe Brown wrote: Take a closer look at the previous message I sent $filename was defined as: $filename="news.txt"; ""Dddogbruce (@home.com)"" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... When you say $newsSubmit = fread ($fd, filesize ($filename)); Do you mean specify the filename? $news.txt then? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] [PHP4] $fp = fopen( news.txt, 'a' ); // 'a' = append! Wah!
$fp = fopen ($filename, "r"); $newsSubmit = fread ($fd, filesize ($filename)); These are giving me a parse error: Warning: Supplied argument is not a valid File-Handle resource in C:/XITAMI/owen/website/php/newsSubmit.php on line 10 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] [PHP4] $fp = fopen( news.txt, 'a' ); // 'a' = append! Wah!
I'm such a pest. g -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] [PHP4] $fp = fopen( news.txt, 'a' ); // 'a' = append! Wah!
Ok, it wrote, but didn't write above.. *grins* -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] [PHP4] $fp = fopen( news.txt, 'a' ); // 'a' = append! Wah!
Ok, I'll get this eventually. groan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] [PHP4]
I've defined all the variables in the form, and have all the files.. HTML TITLESubmit News/TITLE BODY Your news has been processed and added to the main page. Thanks! ? if($formSubmit) { $newsSubmit = file("news.txt"); $fp = fopen("news.txt", 'a'); fwrite($fp, $frmName); fclose($newsSubmit); } else { include ("newsForm.php"); } ? /BODY /HTML See any problems? It won't dump $frmName onto the .txt file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]