Jump to content

Recommended Posts

Posted

<? include "include.php?forum_id=3&post_count=7"; ?>

 

I run a phpbb forum and I have a script that takes threads (in this case 7) from a given forum (in this case 3) and posts them wherever this above it posted.

 

The thing is this doesn't run on my main page. I was thinking this was a security issue?

 

Any suggestions?

 

Thanks, X

Posted (edited)

Xaq, I don't think that having the variables in there will do anything, because they will not be passed into PHP like they would if you had them in an URL.

 

You'll need to declare those variables before the include() and use them inside that script.

Try something like:

><?php
  $forum_id = 3;
  $post_count = 7;
  include("include.php");
?>

 

Note that if you're accessing those URL variables with $_GET (as you should :flex:), you'll need to change that and use only the variable names. I'm not sure if you have to declare them as global before using them or not, but try it and you'll find out :P

Edited by TCH-Raul
Posted

hmm nothing is still coming up... and i think the script im running allows you to change the variables through the url... not positive though.

 

i cant even run simple echo scripts though. would you know why?

Posted

You need to use

><? include "http://www.angrymob.org/include.php?forum_id=3&post_count=7"; ?>

the way you have it causes the include to look for a file named "include.php?forum_id=3&post_count=7".

Posted
You need to use

><? include "http://www.angrymob.org/include.php?forum_id=3&post_count=7"; ?>

the way you have it causes the include to look for a file named "include.php?forum_id=3&post_count=7".

 

hmm already tried that, after that didn't work I went to just using the include.php.

Posted

Lets try something very basic.

create a text file with notepad

containing

 

<?php echo "hello"; ?>

 

 

save as hello.php and ftp it to your site,

goto your site path/hello.php

and see what happens.

Posted

If you are to use php, the extension must be .php

unless you added something to you .htacces file to parse .htm .html for php.

 

Try index.php and use the long tags

<?php at the start of the script

I am not sure about the syntax of your include, but that will give it a chance.

Posted
If you are to use php, the extension must be .php

unless you added something to you .htacces file to parse .htm .html for php.

 

Try index.php and use the long tags

<?php at the start of the script

I am not sure about the syntax of your include, but that will give it a chance.

 

heh that worked... long tags + index.php

 

I had index.php and <? and it didn't

 

odd... anyone know why that is?

 

 

 

 

I appreciate all the help you guys have given me

Posted (edited)

The long tags are recommended for the future,

so I am using them all the time now.

And you might run into trouble with the short tags if your are using xhtml strict as your doctype as they are considered xml tags.

Edited by TCH-Don
Posted

I actually thought of that (short tags) as a possible source of the problem but after checking my account's phpinfo() output, I saw short_open_tag is turned on, so that shouldn't be a problem... I'm guessing your server has short_open_tag turned off. Either that, or you just discovered a bug in PHP :eek:

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...