hidden href

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

border20
New php-forum User
New php-forum User
Posts: 32
Joined: Tue Jan 28, 2003 10:19 am
Location: Québec
Contact:

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

Romantik
New php-forum User
New php-forum User
Posts: 67
Joined: Mon Feb 24, 2003 2:55 am
Location: ../Ukraine/Kherson
Contact:

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"];
?>


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 2 guests