TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 367
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 70
  • Total: 70

php parse error in php block (poll)

Started by sanax, November 15, 2006, 07:35:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sanax

I'm trying to insert an 'include' in a phpbox (I'm just experimenting cuz I'm new to php)

I included the following:
<?php

include('http://theartgangster.com/aok-forum/pollscript/');

?>


but get a parse error:
Parse error: parse error, unexpected '<' in /home/gangster/public_html/aok-forum/Sources/Load.php(1711) : eval()'d code(35) : eval()'d code on line 1

...the URL is visible in a browser though but why not in the block?

(Don't know if this is the right forum to post this in - Move if necessary)

G6Cad


sanax

Thank you G6! Works great! Now my next problem and I hope you can help me with that...

If I've voted it redirect me to the index.php in the script:
http://theartgangster.com/aok-forum/pollscript/index.php

... is there a way that I can get the result (above page) show in the block itself and not in a seperate new window?

sanax

I found this but how can I change the code to php?

In order to get back after voting to the site where the vote is included, you need to put a hidden form field into the HTML template:

<input type="hidden" name="vote_redirect" value="http://www.your-server.com/seite.shtml" />

akulion

just echo it out like this

echo '
code here
';

just make sure u dont use any ' (single quotes) inside the code

sanax

Aku... you mean like this?

echo '
<input type="hidden" name="vote_redirect" value="http://theartgangster.com/aok-forum/pollscript/index.php" />
';


???
I tried the above but it still redirects me to a new browser window

akulion

oh for the new browser u cant really do much except try using an iframe really so it changes when someone votes

sanax

In the documentation of the script I found this but when I use a html box it gives me a permission error...

QuoteWith the HTML tag <iframe> you can include the script in an existing page. Place the <iframe> tag where you want it to appear within the page: Example:

<iframe name="voting" src="./voting.php" width="400" height="300" frameborder="0"></iframe>

Maybe I can use the above? I'm trying to figure this out and maybe we can use it as a snippet because I saw there is a need for a vote by guests

akulion

well the code is already given in ur post above for the iframe

but u will probably have to use it as a center block since the poll is pretty huge in dimensions width wise

sanax

#9
It seems to me I'm not allowed to use this <iframe> code in the blocks?! I get this error when using a html box:

QuoteForbidden
You don't have permission to access /aok-forum/index.php on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


--------------------------------------------------------------------------------

Apache/1.3.36 Server at www.theartgangster.com Port 80

Here is the URL of the error: http://theartgangster.com/aok-forum/index.php?action=tpadmin

akulion

Iframes work perfectly in a html or script box

but I dont know why you cannot access a file on your own server through it - strange

sanax

I think I'll have to contact my hosting server. iframe is a standard feature of SMF and TP or do I need an extra mod to show iframes? Thanks for all the help Aku... hope I can get it to work! :)

akulion

well post your exact iframe code its nothing special really in fact even smf admin panel uses iframes (where u get the news)

so its probably an error in ur code somewhere

sanax

Thank you, I eventually sorted it out! :) Guests are now able to vote. IP's and cookies prevent them from voting twice. You can set it as you want. Thanks for the help.

This website is proudly hosted on Crocweb Cloud Website Hosting.