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

Recommended Answers

All 5 Replies

waaaa! why would u want that ? i dont understand why u want to include a file in a URL?

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....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.