Dant27 Posted June 26, 2006 Share Posted June 26, 2006 Hi everyone,I`m a PHP n00b I have got a basic re-direct code below: <?php $URL="http://elpasso.burnthefat.hop.clickbank.net";header ("Location: $URL");exit();?> What I am looking to do is replace the "elpasso" part of the code with some text from a text file. Lets call it "example.txt"So I am guessing that I would use the include function but I have been struggling with the correct syntax. Would someone be able to post an example of the above link using the include function and the correct syntax?Thanks in advance! Link to comment Share on other sites More sharing options...
aspnetguy Posted June 26, 2006 Share Posted June 26, 2006 The include function is used to include other php pages form the same server.use str_replace to parse the $URL and replace what you need. Link to comment Share on other sites More sharing options...
Little Goat Posted June 27, 2006 Share Posted June 27, 2006 you could do this:$URL = "http://" + file_get_contents('subdomain') + "burnthefat.hop.clickbank.net";couldn't you? Link to comment Share on other sites More sharing options...
justsomeguy Posted June 27, 2006 Share Posted June 27, 2006 You could, if you have a file called "subdomain" that contains the text itself (plus the period, unless you include the period in the rest of the URL). Link to comment Share on other sites More sharing options...
Dant27 Posted June 27, 2006 Author Share Posted June 27, 2006 You could, if you have a file called "subdomain" that contains the text itself (plus the period, unless you include the period in the rest of the URL).<{POST_SNAPBACK}> Thanks for all your help. I will try out both of the methods suggested and see what i can come up with Link to comment Share on other sites More sharing options...
Little Goat Posted June 27, 2006 Share Posted June 27, 2006 yea, sorry. sometimes I just don't think long enough before I post something. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now