Forum Moderators: coopster

Message Too Old, No Replies

Error on page

Newbie doesn't understand error message

         

calvinmicklefinger

8:02 pm on Jan 18, 2005 (gmt 0)

10+ Year Member



I am working on an include statement, which gave me the following error message ...

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/html/wrapper.php on line 208

Line 96 of wrapper.php contains ...

<?php
$my_data = explode("/", getenv("REQUEST_URI"));
putenv($PHP_my_var . "=" . $my_data[2]);
?>

and Line 208 of wrapper (the error) contains ...
<?php $include "http://mydomain.com/myphpform.php";?>

The page myphpform.php contains only the following ...

<?php echo 'Should be blank = ' . $uri_array[0];?>
<br>
<?php echo 'Should be a Number = ' . $uri_array[1];?>
<br>
<?php echo 'Should be a word = ' . $uri_array[2];?>
<br>
The file <?php echo $REQUEST_URI;?> was requested
<br>

Can you please tell me what I am doing wrong?

dkin

8:55 pm on Jan 18, 2005 (gmt 0)

10+ Year Member



I am new at this also, is there a reason you are trying to make include a variable? If not try this

<?php
$my_data = explode("/", getenv("REQUEST_URI"));
putenv($PHP_my_var . "=" . $my_data[2]);
?>

and Line 208 of wrapper (the error) contains ...
<?php include "http://mydomain.com/myphpform.php";?>

The page myphpform.php contains only the following ...

<?php echo 'Should be blank = ' . $uri_array[0];?>
<br>
<?php echo 'Should be a Number = ' . $uri_array[1];?>
<br>
<?php echo 'Should be a word = ' . $uri_array[2];?>
<br>
The file <?php echo $REQUEST_URI;?> was requested
<br>

calvinmicklefinger

9:09 pm on Jan 18, 2005 (gmt 0)

10+ Year Member



Ouch. That was it.

Thanks.

Many thanks. I feel so egg on the face.

I'm really new at this (two days of reading and selecting what I need), but even then I should have learned the difference between a function and a variable.

Again, thanks.

dkin

9:27 pm on Jan 18, 2005 (gmt 0)

10+ Year Member



hey no problem, parse errors are the only things I can fix :) glad its working for you now.

calvinmicklefinger

9:49 pm on Jan 18, 2005 (gmt 0)

10+ Year Member



Well, it's working to do the include, but now I have the next problem.

The page that is called by the include doesn't contain any data from the array (and I did correct the variable names to be consistent across both pages).

Any ideas?

I'm trying to pass variables in the URL according to the format domain.com/somenumber/someword as in [mydomain.com...]

The two variables are needed in both the wrapper page and the included page.

Get them in the wrapper page, don't in the included page.

dkin

9:53 pm on Jan 18, 2005 (gmt 0)

10+ Year Member



pm me with the code for both files and I will see what i can do for you.