PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
include("mysql_connect.php");
$id =$_GET['id'];
$sql=mysql_query("SELECT * FROM topics WHERE id='".$id."'");
if($row=mysql_fetch_array($sql))
header("Location:{$row['webpage']}");
mysql_close($con);
?>
with the above scrpt it is redirecting me to http://localhost/pro1/facebook.com istead of facebook.com
the link with which this script get intiated is like this localhost/pro/location.php?id=21
there is a corresponding webpage in the table coresponding to that particular unique id...how to make this script go to http://www.domain.com
instead of localhost/pro/domain.com
Last edited by mayanktalwar1988 on Mon Sep 28, 2009 3:20 pm, edited 1 time in total.
Hi,
not sure, only an idea but, in your db, maybe you should keep your url with double quotes or vice versa...
You can ask your IT consultant for sure, he/she may be can tell something about server config..
Check your code (extracts from db) if PHP_% variable exist before it.
if these doesn't solve you can retouch your echo with string replacing functions to crop unwanted part(s) of course.
Bye
OK, then you're not even running the code that you posted. Does it help to know that? If not, I'm not sure what else I can suggest. If you don't know what files are being run, where, I can't help you. I wonder if you're using frames, which are complicating things.
ollie i have coded every bit myself of the scripts ..which are in pro1 folder
i dont know what is happing with this just with this i used similar thing in other scripts
i dont know why it is addind locahost/pro1 in directing links
OK, that means your web server is Apache. If you can, try and find out what the document root of Apache is configured to. I guess, there'll be some configuration system for XAMPP where that is set, so, you can find out from there.
I'm after the full path of the script, as it is stored on your filesystem. You should be able to find that by right-clicking on the file in explorer, choosing properties, and copy-pasting the path from that properties dialog. The path should include the file's name as well, if it doesn't, please tell me that too.
Also, could you give me the sam (full path), for that htdocs directory.
Finally, now that I think of it, I should ask if you know if you're doing any mod_rewrite stuff?
hey ollie
i got it it was mine mistake actuallyyyy
i enetred http://www.facebook.com previously it was just facebook.com obiviously with www ahead of it now its fine thank you everyone who responded to my pm
Last edited by mayanktalwar1988 on Mon Sep 28, 2009 3:17 pm, edited 2 times in total.