| | |
redirecting in php
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
0
#11 21 Days Ago
Do any of your php pages show as "proper webpages" in FF? It's just possibel that the Apache webserver, although installed, is not on. I am not familiar with WAMP (I use XAMPP), but I assume it has a control panel - check to see if Apache is on.
In addition, perhaps it would be useful to check your hosts and vhosts files - usually something like this):
C:\Windows\System32\drivers\etc\hosts
C:\xampp\apache\conf\extra\httpd-vhosts.conf (yours will probably be under some sort of wamp directory).
The hosts file (note no file extension) should contain something like:
The other file should contain something like:
These files are where you'd add your virtual local sites
//EDIT
Just looked over the first couple of posts again:
If the above won't work, it's not because you can't find the localhost through the header command, it's probably because php won't run at all in this location (localhost).
Can you run a simple
page?
In addition, perhaps it would be useful to check your hosts and vhosts files - usually something like this):
C:\Windows\System32\drivers\etc\hosts
C:\xampp\apache\conf\extra\httpd-vhosts.conf (yours will probably be under some sort of wamp directory).
The hosts file (note no file extension) should contain something like:
•
•
•
•
127.0.0.1 localhost
::1 localhost
•
•
•
•
NameVirtualHost 127.0.0.1
//EDIT
Just looked over the first couple of posts again:
PHP Syntax (Toggle Plain Text)
header('Location:http://www.yahoo.com');
If the above won't work, it's not because you can't find the localhost through the header command, it's probably because php won't run at all in this location (localhost).
Can you run a simple
PHP Syntax (Toggle Plain Text)
echo "hello world!";
page?
Last edited by ardav; 21 Days Ago at 1:12 pm.
"...the woods would be a very silent place if no birds sang except for the best"
All opinions count.
All opinions count.
•
•
Join Date: Oct 2009
Posts: 12
Reputation:
Solved Threads: 1
0
#12 21 Days Ago
make a file called phpinfo.php with the folowing code:
Now if PHP is installed & working correctly, you should see a load of data & variables in a table with a purple background. If not, something is wrong with your PHP/Apache install.
Joshhh
php Syntax (Toggle Plain Text)
<?php phpinfo(); ?>
Now if PHP is installed & working correctly, you should see a load of data & variables in a table with a purple background. If not, something is wrong with your PHP/Apache install.
Joshhh
•
•
Join Date: Jun 2009
Posts: 90
Reputation:
Solved Threads: 2
-1
#13 20 Days Ago
Try this
it can be possible that short tags are off in php.ini. So Try once the above code.!!
php Syntax (Toggle Plain Text)
<?php header("Location:yahoo.com"); ?>
it can be possible that short tags are off in php.ini. So Try once the above code.!!
Last edited by sam023; 20 Days Ago at 5:39 am.
•
•
Join Date: Oct 2009
Posts: 8
Reputation:
Solved Threads: 1
0
#14 20 Days Ago
PHP Syntax (Toggle Plain Text)
<meta http-equiv="refresh" content="1; URL=http://yahoo.com">
•
•
Join Date: Jul 2009
Posts: 45
Reputation:
Solved Threads: 2
0
#16 20 Days Ago
@ardav : i have installed xampp now, thought that something's wrong with wamp. but everything is still the same. i have checked those files, the one in win32 is okay, but i can't find "NameVirtualHost 127.0.0.1" in httpd-vhosts.conf. what should i do? anyway, i installed xampp in c/program files/xampp not in c/xampp, is it okay? and i can run simple php file like that hello world.
@rokape : yes, it works. seems nothing's wrong with my php installed here. thanks for your response.
@sam023, manus : they all don't work, still leads to a blank page
@foxwizzy : you mean i must write it like this?
but i only get this in my page
"; ?>
@rokape : yes, it works. seems nothing's wrong with my php installed here. thanks for your response.
@sam023, manus : they all don't work, still leads to a blank page

@foxwizzy : you mean i must write it like this?
PHP Syntax (Toggle Plain Text)
<? echo "<meta http-equiv="refresh" content="1; URL=http://yahoo.com">"; ?>
but i only get this in my page

"; ?>
0
#19 20 Days Ago
I shouldn't have thought it would make much difference, but have you included an
on the next line after the header() statement?
In addition, make sure there is no html output including any white space before the header().
PHP Syntax (Toggle Plain Text)
exit;
In addition, make sure there is no html output including any white space before the header().
"...the woods would be a very silent place if no birds sang except for the best"
All opinions count.
All opinions count.
•
•
Join Date: Jul 2009
Posts: 45
Reputation:
Solved Threads: 2
0
#20 20 Days Ago
you mean this?
i have tried that and nothing happens again
PHP Syntax (Toggle Plain Text)
<? session_destroy(); header("location:index.html"); exit; ?>
i have tried that and nothing happens again
![]() |
Other Threads in the PHP Forum
- Previous Thread: session in php
- Next Thread: Multiple file upload through an array
| Thread Tools | Search this Thread |
301 access apache api array autocomplete beginner binary broken button cakephp checkbox class cms code compression cron curl data database dataentry date display dropdown dropdownlist duplicates dynamic echo email error execution file files folder form forms freelancing function functions google href htaccess html htmlspecialchars httppost image include insert integration ip javascript joomla jquery limit link links login mail md5 menu methods mlm multiple mysql oop paypal pdf pdfdownload php phpvotingscript query radio random remote script search secure server session sessions source space sql subscription syntax system table tutorial tutorials update upload url validator variable video virus volume votedown web youtube





