Parameter error

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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

Parameter error

Postby border20 » Tue Apr 01, 2003 7:47 am

I have the folowing code,,,when i press the button, i want the page to reload with a parameter that is the $current variable...

but it doesn't work,,, it reloads without a parameter:

Code: Select all

<form method="POST" action="<?php echo $PHP_SELF?>">

    echo"<a href='".$php_self."?modif=".$current."'><Input type='submit' name = 'add4' value ='Add'></a>";

Can anyone help with this ?

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Wed Apr 02, 2003 1:19 am

register globals = on;

User avatar
New php-forum User
New php-forum User
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK

Postby pootergeist » Wed Apr 02, 2003 3:10 am

clicking a submit button will submit the form to the designated action - it will not take a bit of notice of the <a tags you have surrounding it.

if you want to posted to page to be php_self."?modif=".$current."' then put that in the form action and not an anchor.

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest