This is a discussion on How to get the Post values without using Server Variables? within the PHP Programming forums, part of the Web Development category; hi friends, How to get the Post values without using Server Variables? please post your ideas...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Get the form value without using Server Variables. u can directly use the form element name with $ symbol instead of $_post["elementname"]. ex: $_post(txtEmailto); or $txtEmailto; |
| |||
| This will explain more about this feature PHP 4.2.0 and later, default register_globals is off. Register_globals "off" affects the set of predefined variables available in the global scope of php. For ex, to get DOCUMENT_ROOT you'll use $_SERVER['DOCUMENT_ROOT'] instead of $DOCUMENT_ROOT, or $_GET['id'] from the URL or $_ENV['HOME'] instead of $HOME. |
| |||
| hi, How to get the Post values without using Server Variables another one example. sendmail --------- <?php //Check whether the submission is made if(isset($hidSubmit)) { //Declarate the necessary variables $mail_fname=$txtFirstName; $mail_lname=$txtLastName; $mail_to=$txtEmailto; $mail_from=$txtEmailfrm; $mail_sub=$txtSub; $mail_mesg=$txtMsg; //Check for success/failure of delivery if(mail($mail_to,$mail_sub,$mail_mesg,$mail_fname, $mail_from)) echo "<span class='textred'>E-mail has been sent successfully </span>"; else echo "<span class='textred'>Failed to send the E-mail </span>"; } ?> <form name="frmsendmail" method="post" action="" onSubmit="return ValidationForm()"> <table width="100%" border="0"> <tr> <td width="33%" align="right" class="text">First Name: <td width="67%"><input name="txtFirstName" type="text" id="txtFirstName" size="30" > </tr> <tr> <td width="33%" align="right" class="text">Last Name: <td width="67%"><input name="txtLastName" type="text" id="txtLastName" size="30" > </tr> <tr> <td align="right" class="text">Email: <td><input name="txtEmailfrm" type="text" id="txtEmailfrm22" size="30" > </tr> <tr> <td align="right" class="text">Subject: <td><input name="txtSub" type="text" id="txtSub22" size="30" readonly="" value="** User Contact **"> </tr> <tr> <td align="right" class="text">Mesage: <td><textarea name="txtMsg" cols="50" rows="10" class="input" id="textarea"></textarea> </tr> <tr> <td align="right"><input name="hidSubmit" type="hidden" id="hidSubmit" value="true"> <input name="txtEmailto" type="hidden" id="txtEmailto22" size="30" value="andi.senraj@gmail.com"> <input name="Submit" type="submit" value="Send"> <td><input name="Submit2" type="reset" value="Reset"> </tr> </table> </form> |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| jquery -How can i post values using JQuery load() method | saravanan | HTML, CSS and Javascript Coding Techniques | 0 | 03-19-2008 09:34 PM |
| MySQL Server Variables | sivaramakrishnan | Database Support | 7 | 08-09-2007 05:33 AM |
| How to send variables from a PHP script to another URL, using POST without using form | oxygen | PHP Programming | 1 | 07-26-2007 03:25 AM |
| How can I send variables from a PHP script to another URL using POST without using fo | kingmaker | PHP Programming | 2 | 07-24-2007 02:58 AM |
| POST values thro' CURL with attachment | Anand | PHP Programming | 0 | 07-19-2007 04:23 AM |