| | |
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 24 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; 24 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.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
All opinions count.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
•
•
Join Date: Oct 2009
Posts: 12
Reputation:
Solved Threads: 1
0
#12 23 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: 96
Reputation:
Solved Threads: 2
-1
#13 23 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; 23 Days Ago at 5:39 am.
•
•
Join Date: Oct 2009
Posts: 8
Reputation:
Solved Threads: 1
0
#14 23 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 23 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 23 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.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
All opinions count.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
•
•
Join Date: Jul 2009
Posts: 45
Reputation:
Solved Threads: 2
0
#20 22 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 |
# 5.2.10 alexa apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date directory display dissertation dropdown dynamic echo echo$_get[x]changingitintovariable... email encode error fairness file files folder form forms function functions google href htaccess html image images include indentedsubcategory insert ip javascript joomla legislation limit link local login mail memberships menu mlm multiple multipletables mysql mysqlquery newsletters oop open paypal pdf persist php problem provider query radio random recursion remote rss script search server sessions sms sockets source space spam sql syntax system table tutorial update upload url validator variable video web youtube





