Originally posted by INTELImaxx
Greetings,
Im getting a bit better with php, but having issues.
Everybody does sooner or later, or else a long time ago. For me, "just when I think I've got it ... it's gone...." <hmm....sing, etc.>
I am trying to make it that you can click on a link within each record to display the entire data for that row ($b). Im guessing I need to do an OnClick somehow with javascript and pass at least the value of $b to PHP to generate a report of that entire entry. (this is for a tech support call log) Could you show me how to take a link, and when clicked have it store a variable in php (a registered session variable) so it can be used on other pages. I have very limited resources at my disposal. God bless the net.
Well, you are aware that PHP can only work on the server side. This means that the browser has to send a request to the server and receive a reply, generally in the form of an HTML-type page (and I use the term loosely, 'cause PHP can output all kinds of stuff to browsers...).
In order to send the server a request, you must either POST an HTML form, or request a URL with a query string attached. These are known as the POST method and the GET method, respectively. If you must use javascript here, then your onClick() would either call a function that passes a request of the form http://somewhere.com?somevar=somevalue, or else does a form.submit().
There's really no need to use javascript ... why not just have an anchor tag that points to a handler script (or even to $PHP_SELF) if you wish to write the script that way) including the appropriate URL code for a GET request for that particular log entry?
There's more in the newbies forum FAQ that might help.
HTH,