Is the above possible or is my syntax wrong? The reason I ask is becasue the page I’m working on doesn’t error when executed but by $some variable is coming up undefined. So am I just marking it up wrong or is this type of passing not possible?
I forgot to mention that I have tested for this variable in the part of the script which it resides. It is coming up as it should so that isn’t the promblem. Its also defined in the url on the page when it reloads.
You are trying to mix GET (sending parameters through the query string) with POST (sending them through a form with method=post). You have to choose one or the other.
If you want to send data through a form instead of a link, make “some” a hidden field.
Dan I have to disagree about the need to choose between GET and POST.
In the past I’ve found it helpful to use both. For example on a page that displays and allows the user to edit information with an ID in the query string. The form can just POST back to the page with the ID in the query string and no extra logic is required to determine the ID of the entity being edited.
Such as:
//now at user.php?id=1
<form method="post" action="user.php?id=1">
<input type="text" name="new_username">
</form>
Odz - I suspect you just have register globals off (as they should be). This means when the page POSTs you’ll need to access $_GET[‘some’], instead of $some
I’d never thought of that. I’m not familiar enough with the HTTP spec to know whether this should be considered a bug or not. From a usage POV I find it pretty handy to be able to do this.
I wonder if other server side languages have the same behaviour?
Odz - I suspect you just have register globals off (as they should be). This means when the page POSTs you’ll need to access $_GET[‘some’], instead of $some