Page 1 of 1

Need Help with Code

Posted: Wed May 27, 2009 3:37 am
by stevespi
Hello All,

Im pretty new to php code, so please bear with me... I have managed to get together a Job Board site, from some open source and from googling a lot of code. The site is about 80% there... What i am having real difficulties with is, the User goes to search for a Job. So they type or select various information from catagories. Then hit search. This generates a nice list, which they are then able to click on the view details next to each job and it shows the full job details... Now im stuck, if they want to go back to the list of jobs from there search. I have tried Java, but this comes up with a page which if i press F5 works perfectly. But looks terrible. Im pretty sure I need to capture the data they have typed in the form to get to the list of jobs and rebuild the page when they press the button. But im just getting stuck on exactly what point and even how i define the variable so it can be picked up from another page... I know this is probably really easy stuff, but i would appreciate a little guidance.

If I make little to no sense, then please let me know.

Many thanks,

Steve

Re: Need Help with Code

Posted: Wed May 27, 2009 3:55 am
by aditya2071990
Nope, no sense

Re: Need Help with Code

Posted: Wed May 27, 2009 4:06 am
by stevespi
Oh dear....

Ok, so Joe Bloggs goes to my site, they click search jobs. Which brings up a form, they fill in the details on the form and press search... This runs a query based on the details they have input, to limit the search results. The List on the search results has a link, to take the user to the full details of the job details, taking them to a new page which executes the query based on the Job Id number. This works great... Now the users has for instance read the job details and wants to go back to the list of jobs... How do I do this?? I need to capture and rebuild the list of jobs from what they input on the initial search form. I have no idea how to really do this... ??

Make any more sense? Sorry this is probably a rubbish description.

Regards,

Steve

Re: Need Help with Code

Posted: Wed May 27, 2009 4:10 am
by onion2k
stevespi wrote:Im pretty sure I need to capture the data they have typed in the form to get to the list of jobs and rebuild the page when they press the button. But im just getting stuck on exactly what point and even how i define the variable so it can be picked up from another page... I know this is probably really easy stuff, but i would appreciate a little guidance.
You're on the right track. You know what to do, it's just a matter of choosing how to do it. You have a few options.

1. Serialise the search options into a string and then unserialise them in the job page.
2. Pass all the options as GET vars in the url for the job page and use them all individually to rebuild the search page url.
3. Store the details of the user's last search in as session variables.

Personally, I prefer to use the session. It's neater and it means you can do a "return to search" link on any page after the user has searched for something, so they can view a job, view a page about the company, view an application form, and still return to their last search after all that without you needing to pass all the variables from page to page. Search "sessions" on php.net for information about how to use them.

Re: Need Help with Code

Posted: Wed May 27, 2009 4:20 am
by stevespi
Excellent, Ill have a good read tonight. Im sure ill have more questions : - )

Re: Need Help with Code

Posted: Wed May 27, 2009 2:28 pm
by aditya2071990
I'm sorry dude, I just wanted to follow up later, and I forgot to come back and look at what you wrote...

The mods bashed me up for that post, hope you didn't mind :)