PHP + Javascript(?)

They have: 53 posts

Joined: Oct 2005

Hi all,
I am relatively new in PHP and I have come into a problem, that, I think, is solved by using Javascript

The problem is the following:

I have a form where the user inserts a query, e.g :"Retrieve all tha names of the students".
The next page, which is written in PHP gets the result, e.g: "Nick", "John", "Mary".
What I want to do is to have something like a small box near each name, which the user can tick and then see the student's page for examlpe.
It is sort of a 'select button', and the user can select one or more students to view their pages.

Q1: Is this done with Javascript only or can I use PHP as well?
Q2: Because I don't know anything about Javascript, is there any short code that can do my job easily?

Thanx in advance

Busy's picture

He has: 6,151 posts

Joined: May 2001

If you use PHP it would have to be a link or button (something that needs clicking) as PHP does its thing before the page loads.

I believe it can be done in Javascript, would be a hidden div so you click and the link appears. If you want a select type box (option to view several homepages, details etc) then it could be done in either but PHP probably the better way

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

I am not even sure I understand what you mean.

When the results open, do you want to just open the students pages in a new window? or do you want them to be ticked, and then one click opens them all?

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.