Jump to content

[SOLVED] need help with PHP_SELF form action


lonewolf217

Recommended Posts

I am trying to redirect a form to itself for error checking before submission.  I have used some examples that I found in a search on these forums, but i dont think its working properly

 

<form name="form" method="post" action="<?php $_SERVER['PHP_SELF']."?action=submit" ?>">

 

is there anything obviously wrong with this ?  when I hit the submit button, the URL does not change to <url>?action=submit

Try

<form name="form" method="post" action="?action=submit">

 

If you really want to use what you had, you need to echo the value:

<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']."?action=submit" ?>">

 

Ken

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.