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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,993
  • Total Topics: 21,324
  • Online today: 388
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 286
  • Total: 286

Adding a simple form to an Article

Started by iceman11a, September 25, 2011, 04:55:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

iceman11a

I created a small article with a small form. and I get this error.

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/dfbarrac/public_html/Sources/TPSubs.php(3487) : eval()'d code on line 10

here's my PHP code.

echo '<center><form action="' . $scripturl . '?page='  . $_GET['page'] . '" method="post">';
echo '<INPUT id="submitted" name="submitted" type="hidden" value="TRUE" />';
echo '<input id='name' name='name' type='textbox' value='' />';
echo '<input id='email' name='email' type='textbox' value='' />';
   
echo '<INPUT type="submit" value="Submit">';
echo '<INPUT type="reset" value="Reset">';
echo '</center></form>';

exit;


The only thing I can get it work is some thing like this


echo '
<h3>Hello World</h3>
';

I haven't been able to get any thing else to work. PLEASE help



WillyP

I think lines three and four should have double quotes around name, e-mail and textbox. And after value.

iceman11a

I fixed that and I still have the same error

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/dfbarrac/public_html/Sources/TPSubs.php(3487) : eval()'d code on line 10

my code is below.


echo '<center><form action="page.php?page="1" method="post">';
echo '<INPUT id="submitted" name="submitted" type="hidden" value="TRUE" />';
echo '<input id='name' name="name" type="textbox" />';
echo '<input id='email' name="email" type="textbox" />';
echo '<INPUT type="submit" value="Submit">';
echo '<INPUT type="reset" value="Reset">';
echo '</center></form>';
exit;


iceman11a

Well I got the form fixed. It's just that it's real picky. any way I took a sample from the page I got and well it doesn't work. Guys, I'm sorry. Addingthis crap should not be all this hard. I know PHP coding, Just not this kind.

I only made 2 changes to it. and the error is

Fatal error: Function name must be a string in /home/dfbarrac/public_html/Sources/TPSubs.php(3487) : eval()'d code on line 38

and my code is below.


$columns = array(
array(
'name' => 'id',
'type' => 'int',
'size' => 10,
'unsigned' => true,
'auto' => true,
),
array(
'name' => 'name',
'type' => 'tinytext',
),
);

$indexes = array(
array(
'type' => 'primary',
'columns' => array('id')
),
);

$smcFunc['db_create_table']('{db_prefix}db_data', $columns, $indexes, array(), 'update_remove');


I was hoping some one would have some ideas on this.


Freddy

You're using $smcFunc['db_create_table'] which I think is only available to packages.

IchBin

db_extend('packages'); is what pulls in the extra db functions like db_create_table. You can read more about those things here:
http://simplemachines.org/community/?topic=224166.0

iceman11a

Cool, Thanks, I'm reading threw it now.

This website is proudly hosted on Crocweb Cloud Website Hosting.