If a form submits back to same page do you need to use $get


Posted on 16th Feb 2014 07:03 pm by admin

IM trying to pass page number and year that was selected back to the same page.

i have this code Code: echo '<form action="archivedBookings.php" method="get">';
echo '<select name="year" class="dropdown" onChange="this.form.submit()" >';
Which submits the form when the user selects a year from the drop down box and

Code: <option value="<?=$this_page.'&$year'?>" <? if($_GET{'year'}){echo 'selected';}?>><?=$year?></option>
the code above, should send through the page variable and the year variable that was selected.
The selected part i dont know what that does and when the page submits i get a crazy url
that looks like this

Code: http://www.dhcottages.co.uk/testsite/admin/archivedBookings.php?year=http%3A%2F%2Fwww.dhcottages.co.uk%2Ftestsite%2Fadmin%2Fbookings%2FarchivedBookings.php%26%24year
Can anyone point me in the right direction a tall?

No comments posted yet

Your Answer:

Login to answer
197 Like 40 Dislike
Previous forums Next forums
Other forums

What makes a script your own?
If someone finds a login script online, and changes some variable names around and some other minor

How to show more than 1 users with this code...
Hello,
i have a table that shows users only if I, as Administrator, want to be shown. But its sho

AJAX form submit
I recently built a form that submits data to my database with an ajax function that is called throug

I didnt code this but I need help with it
I'm sorry. i'm not a coder. I have this script for forcing download and previewing mp3. The guy that

upload form file types....
Hey all, I am learning PHP and I am writing a script from the W3C Schools tutorials for uploading fi

Count number of records in all the tables with a querry URGENT PLEASE...
I downloaded ORACLE 9I DATA DUMP into my comp. There are number of tables. I need to find out the

double and single quotes in text fields acting up... help please
Single quotes, when entered into a text field, create an sql error upon Submit. It seems to create t

Inserting the current date/time while submitting the forum
What do I need to add below to update the current date/time? I have a field in the database called d

Form errors in an array
I'm processing a form and putting the errors in an array. empty($errors) doesn't seem to do the tric

Login Control?!
I have a Web Site that uses the login control also I have set the destinationurl to the page I want

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash