![]() |
PHP Gurus, fix this simple code
I'm doing a redirect in a php file, but having a problem with how to display the id at the end of the URL. Basically where it says "echo $id". What's the correct code for this?
<?php header("location:http://refer.ccbill.com/cgi-bin/clic...6-0000&PA=echo $id"); exit; ?> thanks in advance |
<?php
header('http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=929876-0000&PA='. $id); exit; ?> |
and maybe make exit to this:
exit(); |
Quote:
cool it worked. what if I need to have a URL at the end of the redirect. code below, but i know it's wrong: <?php header('location:http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=98956-0000&PA='. $id'&HTML=http://www.site.com); exit(); ?> |
Quote:
|
you can also make $id="yourid&html=http://www.site.com"
with this code: <?php header('http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=929876-0000&PA='. $id); exit; ?> |
Quote:
|
you all fail. That code would rely on register_globals being on, which is off by default under php5.
<?php $id = $_GET[id]; header('Location: http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=98956-0000&PA='.$id.'&HTML=http://www.site.com'); exit(); ?> |
Quote:
Shaze Here is a example where it's a bit more split up. You should really read http://w3schools.com/php/default.asp It takes 30 minutes and will save you many many hours in the future. <?php $id = $_REQUEST["id"]; $urlstring = "http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=98956-0000&PA=".$id."&HTML=http://www.site.com"; header("Location: " . $urlstring); exit(); ?> |
All times are GMT -7. The time now is 01:10 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123