hidden href

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

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

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:

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"];
?>
PHP+MySql= Love :)

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests