PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
This may sound simple but I'll give it a shot. I have a form that goes to a said file. I want to change this so that the form goes to a new Dir. The Dir being a selection from the form! Now the form is being processed before it can assign a $Dir so presumably I need to have something between the form that is sending and the Dir that I want to end up in? Am I thinking straight or do I need a long sleep
The form is based on a drop down that is populated from a MySQL table, which you have already seen before!
I am thinking that if I have this:
<form action='./TownsCityCompanies.php' method='POST' name='CompanySearch'>
and change it to
<form action='./TownsCityCompanies.php$NewDir' method='POST' name='CompanySearch'>
where $NewDir is the selection made from the drop down I am on the right track? Or I need to do what I previously said and have something process before redirection?
ok I have just tried that and got a few errors, but at least you have pointed me in the right direction I think!
Should I be putting the
Header("Location: $county"); in the form, well I gues I know the answer to that one no becuase it just does nothing other than weird stuff and wont allow a refresh even after the file is reverted back to its original state
You want to send the user to a specific directory when he submits the form. Is that right? this is correct.
The form allows the user to select a county and the county selected will have its own county http://www.domain.net/county/
Not really sure about this header I can see what it is doing but not how it will select the $formvalue ?
any form of change in the behaviour of my browser is good as far as I am concerned and there is certaily change!
if I put this:
Header("Location:".$county); // Where $file is the selection from the drop down menu.
at the bottom of the page I get this error:
Warning: Cannot add header information - headers already sent by (output started at c:\program files\apache group\apache\htdocs\punterspower\county.php:47) in c:\program files\apache group\apache\htdocs\punterspower\county.php on line 177
if I put:
Header("Location:".$county); // Where $file is the selection from the drop down menu.
the weird that I have discovered and for the lifer of me cannot understand, displays the index.php whilst in the address bar says its the county.php file this is surely impossible. Anyway thats is a slight deviation.
I have checked the manual and allinfo on post is to do with file uploads!
I am beginning to think that this is not the right way for my problem?
The form should post to the selcted County DIR if using the header:<?php
Header("Location:".$County); // Where $file is the selection from the drop down menu.
?>