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

need good snippet manager
Hi. as i am coding and learning more, it is becoming difficult to manage code snippets. how you mana

Request-URI Too Large
I have created a simple submit form for a mysql database that puts a piece of code into database.<

Problems generating word documents on server side for security reasons
I have a problem with word documentation generation when generating a word document (docx) with PHP.

Multithreading in Oracle (Java, SQLJ, Pro*C,??) on 10g
I am investigating how to run a Java stored procedure in multithread mode.
I know that if I chang

* Gridview and Detailsview in UpdatePanel, insert mode problem
I have a GridView and DetailsView working together. When a record from Gridview is selected, Detail

paginate search result
Hi, I have a paginations script to display data from my database but i would like to paginate someon

Connect to database that isn't localhost
I am currently doing a small script for a company that doesn't have mySql support on there hosting.

Multiple Options for a Single Page
For this example I want to use the Handlers option which is under Fed Admin and all the related codi

login form can you find my error?
registrationform.php seems fine send data to registration.php
registration.php seems fine checks

problem with array - multilingual page
this is my test page :
Code: <?php
if(isset($_GET['lang'])) {
if($_GET['la

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