Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

hidden href

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

hidden href

Postby border20 » Thu Feb 27, 2003 1:48 pm

I'm not sure how to pass a variable through a submit button...

i have the folowing code that should ressemble the right code but i'm doing something wrong...

Code: Select all
<?php
$xcoord = 'some value'

echo "<input type = 'hidden' name = 'xcoord2' value = '".$HTTP_POST_VARS['xcoord']."'>";
echo "<Input type='submit' name = 'submit' value ='submit'>";
?>


can anyone help ? thx
border20
New php-forum User
New php-forum User
 
Posts: 32
Joined: Tue Jan 28, 2003 10:19 am
Location: Québec

Postby Romantik » Fri Feb 28, 2003 12:16 am

Code: Select all
<?php
$xcoord = 'some value'
echo '<FORM name="coord" method="POST" action="next.php">';
echo "<input type = 'hidden' name = 'xcoord2' value = '".$xcoord."'>";
echo "<Input type='submit' name = 'submit' value ='submit'>";
echo '</FORM>';
?>


Code: Select all
<?
# next.php
echo $HTTP_POST_VARS["xcoord"];
?>
Romantik
New php-forum User
New php-forum User
 
Posts: 67
Joined: Mon Feb 24, 2003 2:55 am
Location: ../Ukraine/Kherson


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 7 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.