Jump to content


stupid includes.


8 replies to this topic

#1 fudgy

    Young Padawan

  • Members
  • Pip
  • 80 posts

Posted 23 April 2008 - 03:47 PM

i want to include this code bit for my layout to show comments, and comment form, but i coded my layout and site in html and the php code bit wont show. this is what i have and it just shows up as text.

  <div id="blog_comments">
<%php
require('inc_rate.php');
getComments("1");
submitComments("1","$PHP_SELF"); 
%>
  </div>

Edited by PSgirl, 23 April 2008 - 04:53 PM.
Moved


#2 BigDog

    Young Padawan

  • Members
  • Pip
  • 277 posts
  • Gender:Male
  • Location:Orange County, California
  • Interests:Running, building computers, PC games and BMX and programming.

Posted 23 April 2008 - 08:28 PM

I've never seen <% %>....

Try using <? and ?> :blush:

#3 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 23 April 2008 - 09:45 PM

maybe... you haved the page as an .html still and not a .php :blush:

#4 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 23 April 2008 - 10:54 PM

View Postfudgy, on Apr 23 2008, 02:47 PM, said:

i want to include this code bit for my layout to show comments, and comment form, but i coded my layout and site in html and the php code bit wont show. this is what i have and it just shows up as text.

  <div id="blog_comments">
<%php
require('inc_rate.php');
getComments("1");
submitComments("1","$PHP_SELF"); 
%>
  </div>
The details of what those functions do would help.
You should also avoid:
1) Putting variables and integers in quotes without reason (it's bad practice, but shouldn't break anything).
2) Using $PHP_SELF instead of $_SERVER['PHP_SELF']

View PostBigDog, on Apr 23 2008, 07:28 PM, said:

I've never seen <% %>....

Try using <? and ?> :blush:
ref: Basic syntax Example #2

Edited by rc69, 23 April 2008 - 10:54 PM.


#5 fudgy

    Young Padawan

  • Members
  • Pip
  • 80 posts

Posted 24 April 2008 - 12:51 AM

ermm that didnt work, but thanks for trying to help, it said that <% code %> use that in specific web editors, if <? code ?> doesnt work, ill try that one more time. but i know it doesnt show up in firefox.


EDIT JUST SAW THE POSTS THAT UPDATED WHEN I POSTED, I AM TRYING THOSE SOLUTIONS.

didnt work lol. anyone else?

Edited by fudgy, 24 April 2008 - 06:43 AM.


#6 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 24 April 2008 - 12:44 PM

can we see the link?

#7 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 24 April 2008 - 03:26 PM

View Postrc69, on Apr 23 2008, 09:54 PM, said:

The details of what those functions do would help.
i.e. whats in inc_rate.php

#8 Leibrockoli

    Young Padawan

  • Members
  • Pip
  • 27 posts

Posted 24 April 2008 - 04:47 PM

There's a few here according to a link you posted in a recent topic:

1) Didn't change the .html to a .php file. According to your website your files are .html from what I've seen.
2) Improper PHP syntax. PHP uses a <?php ?> or <? ?> syntax. <% %> is Microsoft's .ASP syntax.

Simply save your .html page under the .php file extension, change the syntax, and upload your new page. If it still doesn't work you would want to re-check your PHP files (or check what PHP version you're running on) until it works.

#9 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 24 April 2008 - 07:52 PM

I just want to clarify one thing. I don't know if i'm misreading your or what, but <% %> does work with php (as an option).

Quote

4. <% echo 'You may optionally use ASP-style tags'; %>
...
ASP style tags (example four) are only available when they are enabled via the asp_tags php.ini configuration file directive.
The problem here is that he is using: <%php (which i see no claim about that being supported). Meaning one of two things.
1) Parse error.
2) Simply not loading the PHP parser.

Either way, it sounds as though he has tried fixing that problem...

I'm curious to know what the actual HTML output of his file is though. So i'm with coolaid now, can we see a link along with the rest of the code?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users