GetDotted Domains

Viewing Thread:
"How do I add PHP variables to make a URL?"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Wed 10/07/02 at 11:40
Regular
Posts: 787
I'm working on something at the moment and I'm using the "INCLUDE" tag to arrange a URL from three variable - "type", "id" & "format".

Here's the coding I've been trying to get to work:

if (file_exists("$type" + "$id" + "$format"))
{ include("$type" + "$id" + "$format"); $id++; }
else
{ include("nolink.html"); }
?>

the "nolink.html" bit works, which means that it hasn't assorted the URL how I want it. It should display a document as such:

news0001.html

You see "news" is the "type", "0001" is the "id" and ".html" is the "format". Clever, no! Except it doesn't work!

Also, I'm trying to increment the variable "$id", so that I can have other files below it. At the moment I'm using JavaScript style methods, which have worked for other tings, but not this. I'm also guessing that because the "$id" is an integer, that "%id" will have to be used, but I'll leave it up to you lot to tell me that.
Cheers!
Wed 10/07/02 at 12:22
Regular
"It goes so quickly"
Posts: 4,083
Try changing the +'s to comma's
Wed 10/07/02 at 11:40
Regular
"Pouch Ape"
Posts: 14,499
I'm working on something at the moment and I'm using the "INCLUDE" tag to arrange a URL from three variable - "type", "id" & "format".

Here's the coding I've been trying to get to work:

if (file_exists("$type" + "$id" + "$format"))
{ include("$type" + "$id" + "$format"); $id++; }
else
{ include("nolink.html"); }
?>

the "nolink.html" bit works, which means that it hasn't assorted the URL how I want it. It should display a document as such:

news0001.html

You see "news" is the "type", "0001" is the "id" and ".html" is the "format". Clever, no! Except it doesn't work!

Also, I'm trying to increment the variable "$id", so that I can have other files below it. At the moment I'm using JavaScript style methods, which have worked for other tings, but not this. I'm also guessing that because the "$id" is an integer, that "%id" will have to be used, but I'll leave it up to you lot to tell me that.
Cheers!

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Top-notch internet service
Excellent internet service and customer service. Top-notch in replying to my comments.
Duncan
Brilliant service.
Love it, love it, love it!
Christopher

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.