IT Community - Software Programming, Web Development and Technical Support

How to get the Post values without using Server Variables?

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...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-29-2007, 11:11 PM
senraj senraj is offline
D-Web Master
 
Join Date: Jul 2007
Posts: 418
senraj is on a distinguished road
Post How to get the Post values without using Server Variables?

hi friends,

How to get the Post values without using Server Variables?

please post your ideas
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-27-2007, 07:28 AM
senraj senraj is offline
D-Web Master
 
Join Date: Jul 2007
Posts: 418
senraj is on a distinguished road
Post Re: How to get the Post values without using Server Variables?

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;
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-04-2007, 02:41 AM
Jeyaseelansarc Jeyaseelansarc is offline
D-Web Genius
 
Join Date: Mar 2007
Location: Chennai
Posts: 1,162
Jeyaseelansarc is on a distinguished road
Send a message via AIM to Jeyaseelansarc
Default Re: How to get the Post values without using Server Variables?

hi,
Good to know this.
is it working in all the times?
__________________
With,
J. Jeyaseelan

Everything Possible
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-05-2007, 05:23 AM
rajinikanth rajinikanth is offline
Super Moderator
 
Join Date: Mar 2007
Posts: 8
rajinikanth is on a distinguished road
Default Re: How to get the Post values without using Server Variables?

it wont work all the times. it depend upon the php.ini configuration.

ie register_globals should be on.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 10-05-2007, 05:27 AM
rajinikanth rajinikanth is offline
Super Moderator
 
Join Date: Mar 2007
Posts: 8
rajinikanth is on a distinguished road
Default Re: How to get the Post values without using Server Variables?

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.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 10-07-2007, 10:57 PM
senraj senraj is offline
D-Web Master
 
Join Date: Jul 2007
Posts: 418
senraj is on a distinguished road
Post Re: How to get the Post values without using Server Variables?

thanks a lot.........

so, php 5 version global variable automatic on is it?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 10-17-2007, 11:31 PM
senraj senraj is offline
D-Web Master
 
Join Date: Jul 2007
Posts: 418
senraj is on a distinguished road
Post Re: How to get the Post values without using Server Variables?

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>
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -7. The time now is 06:15 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0