Topics

User Functions

Events

There are no upcoming events

What's New

Stories

No new stories

Comments last 2 weeks

No new comments

Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Wednesday, May 22 2013 @ 04:02 AM EDT


 Forum Index > Support > General Geeklog Support New Topic Post Reply
 php in static pages
   
Anonymous: RoN
 02/05/05 08:37PM (Read 1360 times)  



Hi,
When I try to run php on a static page, I get the message:

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

Now, I guess it's the html tags doing this, can't you use html and php together?

Please forgive me, I'm a self taught fool.

 
 Quote
ShareOurRevenue
 02/05/05 08:57PM  
+----
Newbie

Status: offline


Registered: 12/25/04
Posts: 4
Sorry, that was my post above. I've searched the forum and didn't find an answer.

I've read the documentation, but according to that, html and php can be combined.

Some reason, I won't work for me. I have it set to execute php, and I've tried the other option as well.

Well, I've narrowed it down. If I START with php, it works. The problem is, I want to start with HTML, and have the php at the bottom.

 
Profile Email
 Quote
vadertech
 02/05/05 09:34PM  
+++++
Full Member

Status: offline


Registered: 05/26/03
Posts: 329
are you using
PHP Formatted Code
<?  ?>
 
tags? If so, try it without them.

GeekLog Hosting, Installations and Upgrades - WWW.AWEHOST.COM - Hosting starts @ only $4.95/mo.
 
Profile Email Website
 Quote
ShareOurRevenue
 02/05/05 10:17PM  
+----
Newbie

Status: offline


Registered: 12/25/04
Posts: 4
No, I'm not using the tags.
The only way I got it to work was putting it at the top withe JUST the opening php tag.

It wont work when I put it at the bottom, after the html. I've tried every variation I can think of, with and without the tags, just the opening tag, just the closing tag.

And while I'm asking, I'm trying to put my rdf feed in a block, but for some reason, it's not being saved in the RSS feed field. When I go back to edit, it's not there.


 
Profile Email
 Quote
machinari
 02/06/05 01:33AM  
+++++
Full Member

Status: offline


Registered: 03/22/04
Posts: 1512
pretend this code block is the staticpages' editor text box.
It is design to take PHP input if PHP is enabled. This means that a PHP open tag is assumed and so is not necessary
e.g.: set to execute
PHP Formatted Code

//begin PHP script without open tag
echo "hello world";
echo "<p>this is an HTML paragraph being outputted from within PHP.</p>';
//close PHP script without closing tag



e.g.: set to return
PHP Formatted Code

//begin PHP script without open tag
$retval = "<p>";
$retval .= "this is an HTML paragraph being outputted from within PHP.";
$retval .= "</p>";
return $retval;
//close PHP without closing tag


 

You see, if you enable PHP on your static pages then the code must be PHP. Your other choice is to use open and close tags, but you must start with the close tag in order to "get out" of PHP mode, so to speak.
e.g.:
PHP Formatted Code

//end PHP
?>
<p>this is an HTML paragraph</p>
<?php
//this ends my HTML section and now I can write PHP


 
hope that helps.

 
Profile Email
 Quote
Content generated in: 1.44 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to post 
Filtered HTML Allowed 
Censored Content