Is there a way to use PHP include in URLs?
e.g. http://www.domain.co.uk/path/<?php include 'file.php'; ?>/path/page.php
This would help me so so so much!
Thanks in advance!
BJC
Is there a way to use PHP include in URLs?
e.g. http://www.domain.co.uk/path/<?php include 'file.php'; ?>/path/page.php
This would help me so so so much!
Thanks in advance!
BJC
waaaa! why would u want that ? i dont understand why u want to include a file in a URL?
Haha, I'd like to accomplish the following:
If in the file e.g. 'city.php' reads a word e.g 'london'
The URL that reads: http://www.domain.co.uk/path/<?php include 'city.php'; ?>/path/page.php would create the following URL:
http://www.domain.co.uk/path/london/path/page.php
Thanks!
BJC
u dont need to include a file to accomplish that... u can have a variable... and assign values to it... then insert in the url
That's what I thought I'd have to do, but didn't know where to start.
I also want the variables to be in different files in different directories.
Is that possible?
Thanks very much for all your help vaultdweller123.
BJC
okey lets assume you have a textfield where you would input your value.
<?php
if(isset($_POST['btnsubmit'])){
$val = $_GET['val'];
echo "<script>window.location='http://www.domain.co.uk/path/".$val."/path/page.php'</script>";
}
?>
<form method='get'>
<input type='text' name='val' />
<input type='submit' name='btnsubmit' value='submit' />
</form>
i hope i understand you correctly....
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.