Jump to content

Recommended Posts

Hey guys i am currently playing arround with a vbulletin installation. I wanted to add some PHP code into a template so i did this

 

$testing = '<table class="tborder" width="100%" align="center" border="0" cellpadding="6" cellspacing="1">
<tr>
	<td class="tcat" width="50%">Informations challenge</td>
	<td class="tcat" width="50%">Informations participation</td>
</tr>
<tr valign="top">
	<td class="panelsurround" align="center">
	<div class="panel">
		<div align="left">xxx</div>
	</div>
	</td>
	<td class="panelsurround" align="center">
	<div class="panel">
		<div align="left">
			<div class="fieldset">
				xxx</div>
		</div>
	</div>
	</td>
</tr>
</table>';
    
$tt = str_replace('[allo]', $testing, fetch_template($templatename));
eval('print_output("'.$tt.'");');

 

and now i get a

 

Parse error: syntax error, unexpected T_STRING in public_html/forum/member.php(831) : eval()'d code on line 252

 

The original string looked like this

 

eval('print_output("' . fetch_template($templatename) . '");');

 

I juste wanted to replace [allo] with some new code ...

 

strange thing is if i remove the $testing var from the STR replace the page loads with out the error

 

$tt = str_replace('[allo]', '', fetch_template($templatename));
eval('print_output("'.$tt.'");');

 

So for some reason it does not like complex HTML?

 

I tryed this and it worked

 

$tt = str_replace('[allo]', '<b>Hello</b>', fetch_template($templatename));
eval('print_output("'.$tt.'");');

 

So why the hell does my $testing var return that error lol

Link to comment
https://forums.phpfreaks.com/topic/242496-eval/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.