Hi is there a way that i can set header not go anywhere like the problem with this is that it still goes to the second header is there a way i can set if none do nothing exit? and else do the second header??
Just… dont send a header in the if section. If it’s firing the trigger in the else section and you dont think it should, you’ve got a problem with your condition.
the problem is that the form action jumps to the action="agents_jump.php file which has the headers is there a way on the form select option to put if
<option value=“none”>Select</option>
dont jump to the form action page
Hi i managed to just redirect to the same page. one problem thou because the form opens the link into a new tab it redirects same page into the new tab. is there a way to do if none keep on the same tab because the aim is i dnt really want to do anything if selected none stay on the same page is it possible? if so how can i try?
thanks
Stop trying to redirect them somewhere? If you do NOTHING, then they will stay where they are. Default behavior.
Train is coming down a railroad track, towards a switch. The switch is currently set to point the train to the north (current page), the other direction is to the east (index). In order to make the train go north… dont touch anything
yeah but if the option on the form has values i need to take me to the other page (agents_jump.php)
like is there a way i can if none when click button check if value none?? make button dont do anything but if option has value then redirect to new agents_jump.php page cz i cnt figure how to
You could add some Javascript to disable the button when ‘none’ is the option selected…or just put your code into the same page as that form, wrap it in a if isset $_POST[‘agents’], and then have the form action to itself.
And then as soon as someone without javascript enabled visits your site, your code stops working
Yeah… no. Bad idea. When this can be accomplished using pure PHP, using javascript just makes it less effective.
yeah that would previous script would work fine the problem would be still jumps into a new tab which is what i am trying to avoid i have also tried to avoid javascript but it seems like one of the choice would be
but even that function not working and i would still keep the header on the next file so if javascript disable it would simple redirect using the header
so on the header page i would have
but the javascript function is not even working do you know anything about javascript can you spot whats wrong with the above function that is not working??
might have to be “onSubmit” rather than onsubmit, and you forgot to close your <script> tag.
But you should be handling this from PHP. Have the form action set to ‘’, and put the code you’ve got in agents_jump.php into the page you want to jump from, wrapped in if(isset($_POST[‘agents’])) { … }
Yes, when I say ‘stay where they are’, i meant the form processing page (which, in most cases, is the same page as the form, so that if the form IS bad, you dont have to ‘go anywhere’, you just let the form page reproduce itself.)
@start lion thanks for the help got what i’ve done is i set a javascript alert box when select option == none so stays on the same page but also left the action page with a header if select option equal none to redirect to the same page this way even if the javascript is disable will take to that page and do a similiar job thank you very much