Jump to content

Easy Question .... I think


mnybud

Recommended Posts

I am new to PHP and trying merge 2 existing PHP scripts together in a very minor way.
I have a script that looks like this:

<?
    include_once(dirname(__FILE__) . "/class.script.php");
    $name = "changeme";
    etc.......
?>

The other script I have has this to print the names that I am trying to display in the $name= field.
<?php info('name'); ?>


If I put that right above the first script like below it displays the names just fine.

<?php info('name'); ?>
<?
    include_once(dirname(__FILE__) . "/class.script.php");
    $name = "changeme";
    etc.......
?>

BUT if I put it in like below where I want it to display then it does not work.

<?
    include_once(dirname(__FILE__) . "/class.script.php");
    $name = "<?php info('name'); ?>";
    etc.......
?>

I am guessing there is a simple way to write this to make it work but I cant figure it out.....  ???

Any help?




Link to comment
Share on other sites

sorry here is some more info.

I am not getting any errors but instead of pulling the correct page/content from my site it always just loads the index page unless I set it manually.

Here is more of the code:

<!-- begin footer -->
</div>
<?php get_sidebar(); ?>
</div>

<?php footer(); ?>

<--this works-->
<?php info('name'); ?>
<--this works-->

<?
  include_once(dirname(__FILE__) . "/class.script.php");
    $name = info('name');

if (isset($_GET['name'])) {
$name = $_GET['pagename'];
}

$myscript = new pagefetcher();

$cnt = $myscript->FetchFullName($name);

if ($cnt) {
print $cnt;
}
?>
<!-- end footer -->

Let me know if this gives any clues....thanks for your time!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.