![]() |
global variables
Hi all,
I need help on this: How do I pass a value from one variable to another variable upon users click? example: I have following html site Code:
<html>many thanks..I would be very glad on any tips reverse |
You cant. PHP fully executes before the first character of information is sent to the user, so by the time they see it there is nothing running to switch. I also do not think you understand how global variables work. Global variables do not outlast the application which they are defined in, they are deleted along with everything else when the script finishes running.
|
some basics...
Village Idiot is, of course, right.
I've seen this type of logic from beginners before, and its pretty understandable. What I would recommend to help you better understand what is going on is to divide up your file into two sections, one where you're doing PHP work and the other where you're outputting HTML, sort of like this: PHP Code:
1. a web user requests a page (www.example.com/myPhpFile.php) 2. the server runs the php file which creates html 3. the server sends that html back to the user who requested it 4. the user's browser turns that html into a working webpage 4. the user will click something which will either request a different page, or it will send a request along with some data. The server will handle that data and then send back the resulting html again. You'll want to send the data using forms for now If you let us know a bit more concretely what you want to accomplish we can help a bit more :-) |
| All times are GMT. The time now is 11:24 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0