2

Current URL is

<?php include ("/home/domain/public_html/create/dogs.php"); ?>

I want to do this:

<?php include ("/home/domain/public_html/create/<?php $partURL; ?>s.php"); ?>

$partURL is predefined. Just need to parse the php include within the above URL to parse correctly

3 Answers 3

2

You can do like this

 <?php include ("/home/domain/public_html/create/{$partURL}s.php"); ?>

You can not use php tag with in a php tag like <?php <?php ?>?>

Sign up to request clarification or add additional context in comments.

Comments

1

Read up on strings in PHP.

<?php include ("/home/domain/public_html/create/".$partURL."s.php"); ?>

Comments

1

You have to remove the PHP Tags from the "part URL" cause you are already in PHP.

<?php include ("/home/domain/public_html/create/" . $partURL . "s.php"); ?>

1 Comment

remember, his version will only work till you have double quotes around the string, if you go for single quotes, you will have to use this method. So dont forget that. and, welcome. :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.