Del

Anonymous

I have turned on PHP execute for my static pages and I am trying to code some PHP scripts... but I keepgetting a parse error.

Here is the code I am using:
$email = $_REQUEST['email'] ;
$message = $_REQUEST['blahblah'] ;

mail( "myemail@yahoo.com", "Feedback Form Results",
$message, "From: $email" );
header( "Location: http://www.example.com/thankyou.html" );
?>

Name: Email:


Here is the parse error:

Parse error: parse error, unexpected '

wtf???? why doesnt it work??? where is the parse error?

Del

Anonymous
that turned out wrong

here is the code I am using:

Text Formatted Code
<?php
  $email = $_REQUEST['email'] ;
  $message = $_REQUEST['blahblahblahblah'] ;

  mail( "myemail@yahoo.com", "Feedback Form Results",
    $message, "From: $email" );
  header( "Location: http://www.example.com/thankyou.html" );
?>


 

Del

Anonymous
why do I get this parse error with that code? it looks good to me!

Text Formatted Code

Parse error: parse error, unexpected '<' in /my/path/public_html/staticpages/index.php(59) : eval()'d code on line 1

 

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
As mentioned in the documentation, you shouldn't enclose your code in PHP tags ...

bye, Dirk

Del

Anonymous
ok, I removed the
any ideas now Dirk?

Del

Anonymous
that was supposed to read ..

"I removed the PHP tags" and it still doesnt work

any ideas now Dirk?

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Sorry, but my crystal ball seems to be out of service right now ...

In other words: What error do you get now?

bye, Dirk

Del

Anonymous
the exact same error:

Text Formatted Code
Parse error: parse error, unexpected '<' in /my/path/public_html/staticpages/index.php(59) : eval()'d code on line 1
 

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Quote by Del: the exact same error

That's impossible if you really removed the PHP tags, since there wouldn't be any '&lt;' sign left to complain about ...

bye, Dirk

Nygrah

Anonymous
I am having exactly the same problems with my static pages. I have not been about to include PHP and I followed all the documentation. Please help!

Nygrah

Anonymous
Forgot to add that I am simply trying to use the php
include_once(''); command.

Nygrah

Anonymous
Is there any thing I should put with the include command in order to get it to work? I really need to get the php to work in the static pages.

Nygrah

Anonymous
No one else is having this problem?

Status: offline

DTrumbower

Forum User
Moderator
Registered: 01/08/03
Posts: 507
Example code is always easier to help with, then guessing.

Nygrah

Anonymous
I think I already explained that I simply wanted to do a php include. Only in this instance I wanted to include another staticpage into a staticpage.

I used include_once('http://www.xxx.com/staticpages/index.php/table'); It doesn't appear within in the staticpage. I also tried to include it as plain html.
ie.

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Quote by Nygrah: include_once('http://www.xxx.com/staticpages/index.php/table');

Are you sure this is really what you want to do? Besides, that will only work if url_fopen is enabled.

bye, Dirk