|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
php discussion online
<html>
<body> <?php /* the if statement verifies HTTP_POST_VARS variable if this is true then the followig code is executed */ if($HTTP_POST_VARS) { /*he htmlspecialchars disable html output say the symbol ">" is converted into > */ $new_name=htmlspecialchars($name); $new_message=nl2br($message); echo "<br>".$new_name."<br>".$subject."<br>".$new_message; } ?> <form method="post" action="<?=$PHP_SELF?>"> <input type="text" name="name"> <input type="text" name="subject"> <textarea name="message" cols="30" row="30"></textarea> <input type="submit" value="mail"> </form> </body> </html> plz comment and suggest this small program |
|
#2
|
|||
|
|||
|
RE: php discussion online
couple of things...I would use $_POST rather than $HTTP_POST_VARS. Also, I would do an if(isset($_POST)). This is a small program, but preserving memory anywhere you can is a good thing..I would do this:
echo "<br>".(htmlspecialchars($name))."<br>".$subject."<br>".(nl2br($message)); and get rid of the: $new_name=htmlspecialchars($name); $new_message=nl2br($message); unless you plan on using $new_name and $new_message again in the script. As it is, you are defingin two new variables (and using memory), when you don't really need to. |
|
#3
|
|||
|
|||
|
RE: php discussion online
thanx mr ..
sorry i don't know your name you taught me so much i din't had the sense of memory management and i learnt it form you and thatnx once again can you plz tell me more detalis about $_POST $HTTP_POST_VARS |
|
#4
|
|||
|
|||
|
RE: php discussion online
|
|
#5
|
|||
|
|||
|
RE: php discussion online
hello
mr.EvilivE i need one more help from you. i want to create previous and next links to the data accessed form a text file and i want two message to be displayed per page how can i do that. Is it possible if i use file() function and store each line in an array and access two array elements at a time |
|
#6
|
|||
|
|||
|
RE: php discussion online
array_slice
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > php discussion online |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|