|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
I have just setup PHP & MySQL to run on my computer using Apache but following this step-by-step tutorial (URL).
It seems that PHP is not able to pass variables from one page to another on my local server. When I upload the same pages to my host - they work fine! Here is the code for the page that creates the variable: PHP Code:
Here is the code for the page that prints the variable: PHP Code:
Here is the source for when the page is viewed in my browser: PHP Code:
Obviously something somewhere needs to be adjusted - can someone please assist me with this. It would be greatly appreciated. Thankyou Tim Burgan |
|
#2
|
|||
|
|||
|
You're having problems because register_globals is off.. My advice is to kepp register_globals off, but instead start using the superglobal arrays for fetching the get, post, cookie and session variables
In your case this is the code you need to use PHP Code:
You can read more about register_globals on this page of the php manual Good luck ![]()
__________________
Best Regards, Håvard Lindset |
|
#3
|
|||
|
|||
|
Thanks..
..I'll keep global variables OFF - because the manual suggests that there are security issues having this switched ON. Considering I practically know nothing about PHP yet - it's probably the best move. Cheers |
|
#4
|
|||
|
|||
|
I have Apache 2 set up on Windows XP Pro, PHP 4.3.4 (manual install). If I use this code to POST from one page to another:
Page 1 (test_post1.html): <html> <!-- userform.htm --> Please enter your name: <form action="test_post2.php" method="post"> <input name="username" type="text"><br> <input type="submit" value="submit"> </form> </html> Page 2 (test_post2.php): <!-- test_post2.php --> <?php if (isset($_POST['submit'])){ echo ($_POST['username']); } else { echo 'Form not submitted.'; } ?> All I see is "Form not submitted". If I leave out the test for the submit, I do see the value of the "username" variable. Is this normal behavior? Register globals is off. I see the phpinfo() stuff fine. |
|
#5
|
||||
|
||||
|
Try to switch your statement. Check if $_POST['submit'] does not exists:
PHP Code:
Minor difference, but maybe it'll work. |
|
#6
|
|||
|
|||
|
Thanks, but that did not work. However, I did find that with your code, if I put name="submit" in the input tag of the html form, it worked! I think I'll go with that for now.
I don't believe you should have to do that, though. I also found that if I don't use Apache2, but use IIS instead, the POST code works fine. So I suspect the problem has to do with either the Apache configuration or some setting in Windows that interferes with the POST process. Unfortunately, I'm just starting with all the open-source technologies, so I'll just have to muddle through. |
|
#7
|
|||
|
|||
|
hi,
my project is working in my local machine properly, but after uploaded in the server (ie. in online) when i clicked a record or updated a record it is affected. but if i click back button and refresh the page it shows the that record which i tried to delete. I think the problem is with the session cache. It takes from the session cache memory. So it doesnt goes tothe server and takes the original available records, so kindly help me sort it out. U can also mail me in this regard, sivakumar1978@yahoo.com mshivakkumar1978@hotmail.com thankx shiva |
|
#8
|
||||
|
||||
|
jcwilkinson,
Are you pressing enter, or are you clicking the submit button? Some browsers don't send the submit button when you simply press enter from a text field... sometimes its better to test if the textfield exists instead of the submit button. hai mame, Is it inserting the record into the database, or simply displaying it to the page? It could just be your browser's cache/temp files |
|
#9
|
|||
|
|||
|
hi,
this is not i asked whenever i delete a record from my site it is affected in the database. But when i click back button and refresh to see the remaining record it also shows my deleted record. It is clear that the problem is with the session cache. every time when click back button it should go to the server and has to pick the record from the server and not from the session cache. For that how should i change my cache setting for the server. thanx shiva |
|
#10
|
||||
|
||||
|
Try this in the page where the data is displayed:
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> Just put it between the <HTML> and </HTML> tags. Now the page will not be cached at all. ![]() |
|
#11
|
||||
|
||||
|
when i click back button and refresh to see the remaining record it also shows my deleted record
My question was, is the record still in the database, or simply displayed? If its simply being displayed on the page than its just your browser's cache... Spongy's tags would work, or you could send HTTP headers via PHP PHP Code:
|
|
#12
|
|||
|
|||
|
How to trace the bounced emails
hi,
I am sending many mails from my server using mail() function in php. But i dont know that all the email addresses stored in the data base are correct. when a mail is sent to a fake email address, how do i trace it in php. what ever the question i asked here i am getting answer too late.I think this is because of the location iam in. ok. if anybody help me to solve the above said probs please do mail me shiva mshivakkumar1978@hotmail.com |
|
#13
|
||||
|
||||
|
perhaps asking these questions in a new thread would yeild better results...
your questions are off-topic in this particular thread |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Web Server Configuration > MAJOR PROBLEM - PHP on Apache Server |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|