PDA

View Full Version : dumb phpinclude error


The_Cyberdemon
03-30-2003, 11:18 AM
Well, i'm trying to make a quick registration hack (yeah, i know, it's probably been already made), and i see get an error when i put this in my phpinclude:

if ($bbuserinfo[usergroupid]==1) {
$quickreg = "<form action="vb/register.php" method="post">
<input type="hidden" name="s" value="$session[sessionhash]">

<table cellpadding="0" cellspacing="0" border="0" bgcolor="#0A293E" width="95%" align="center"><tr><td>
<table cellpadding="4" cellspacing="1" border="0" width="100%">
<!-- *** -->
<tr>
<td bgcolor="#1D6AA0" colspan="2"><normalfont color="#EEEEFF" class="thtcolor"><b>Register</b></smallfont></td>
</tr>
<!-- *** -->
<tr>
<td bgcolor="#1C5780"><normalfont><b>User Name:</b></normalfont></td>
<td bgcolor="#1C5780"><normalfont><input type="text" class="bginput" name="username" size="5" maxlength="$maxuserlength"></normalfont></td>
</tr>
<tr>
<td bgcolor="#13486D"><normalfont><b>Password:</b></normalfont></td>
<td bgcolor="#13486D"><normalfont><input type="password" class="bginput" name="password" size="5" maxlength="15"></normalfont></td>
</tr>
<tr>
<td bgcolor="#13486D"><normalfont><b>Enter Password Again:</b></normalfont></td>
<td bgcolor="#13486D"><input type="password" class="bginput" name="passwordconfirm" size="5" maxlength="15"></td>
</tr>
<tr>
<td bgcolor="#1C5780"><normalfont><b>Email:</b></normalfont></td>
<td bgcolor="#1C5780"><normalfont><input type="text" class="bginput" name="email" size="5" maxlength="50"></normalfont></td>
</tr>
<tr>
<td bgcolor="#1C5780"><normalfont><b>Enter Email Again:</b></normalfont></td>
<td bgcolor="#1C5780"><normalfont><input type="text" class="bginput" name="emailconfirm" size="5" maxlength="50"></normalfont></td></tr><tr><td align="center"><input type="hidden" name="url" value="http://www.blindedstorms.com">
<input type="hidden" name="action" value="addmember">
<input type="submit" class="bginput" name="Submit" value="Submit">
<input type="reset" class="bginput" name="Reset" value="Reset"></td>
</tr></table></table></form>";
} else {
$quickreg = "";
}

after i do that, i get this error at the top of the screen, and some others.

Parse error: parse error, unexpected T_STRING in /home/cyber/public_html/vb/global.php(313) : eval()'d code on line 79

Any idea what to do?

Thanks in advance!

-Cyber

filburt1
03-30-2003, 01:49 PM
You're not escaping any of the quotes.

Xenon
03-30-2003, 08:17 PM
or in easier words:

change $quickreg = "<form action="vb/register................</form>";

into$quickreg = '<form action="vb/register................</form>';

(look at the single quotes leading and ending)

The_Cyberdemon
03-31-2003, 12:05 AM
THanks, i'll try that and give you an update.

The_Cyberdemon
03-31-2003, 12:14 AM
okay, the error seems to be fixed, but the variable won't show. I put in $quickreg in a portal-block thing, and all that shows up is $quickreg, not all the stuff. I have it as any html block. Any idea what i do?

If it's something like make a new template for the portal-home block, how would i do that and what would i do exactly?

filburt1
03-31-2003, 01:23 AM
Make sure you're logged out. Also use $bbuserinfo['usergroupid'], not $bbuserinfo[usergroupid] which is deprecated.

The_Cyberdemon
03-31-2003, 02:14 AM
Make sure you're logged out. Also use $bbuserinfo['usergroupid'], not $bbuserinfo[usergroupid] which is deprecated.
I think you misunderstand the problem. The Variable shows up ($quickreg), not the registration fields. Could just the '' thingy ruin it?

Edit: Tried it and it didn't fix anything. my url is http://www.blindedstorms.com , the block is in the lower left.

g-force2k2
03-31-2003, 03:08 PM
in the php make sure you eval the template...

ie:
eval( "\$quickreg = \"".gettemplate( 'template_name_here' ).";" );

put that in the php instead of the variable $quickreg...

regards,
g-force2k2

filburt1
03-31-2003, 04:48 PM
You don't have to eval it, especially because there are no replacements or variables in it from what I can see.

The_Cyberdemon
03-31-2003, 06:39 PM
I guess i could try the eval thing, but what would the template name be? I'm just putting the variable in a box on the left side of the portal.

filburt1
03-31-2003, 07:01 PM
I wouldn't do it, eval'ing templates in phpinclude add queries.

Xenon
03-31-2003, 08:27 PM
@filbie: not the eval produces the query, it's the gettemplate.

if you want to use a template from within phpinclude you should add it to $templatecache in global.php

filburt1
03-31-2003, 08:41 PM
That's what I meant by adding a query (i.e., eval'ing a template) :)

g-force2k2
03-31-2003, 08:45 PM
Today at 04:01 PM filburt1 said this in Post #11 (https://vborg.vbsupport.ru/showthread.php?postid=376051#post376051)
I wouldn't do it, eval'ing templates in phpinclude add queries.

never adds any for me... i just use the $templatesused and add it to that...

and whats phpinclude :rolleyes:

its the most effective way that i can see... i don't think its working because he's using single quotes... instead he should escape all of the double quotes imo...

g-force2k2

filburt1
03-31-2003, 08:46 PM
Knock yourself out: http://www.vbulletintemplates.com/mods/showthread.php?threadid=3271