Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 10:51 pm EST

Geeklog Forums

static page using php


Status: offline

rdunne

Forum User
Junior
Registered: 07/02/07
Posts: 27
blank
Hi all
Im trying to run some code for a form script which uses php. I tell the static page to use php and i get the following error
Parse error: syntax error, unexpected '<' in /home/bhaa1/public_html/plugins/staticpages/functions.inc(841) : eval()'d code on line 1
if i dont execute php i get the form but with no php running ...
any one any ideas?

thanks

Richard :banghead:
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Don't use the <?php at the beginning and the ?> at the end of your document. You're already in a php document, so just put the code in there
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

rdunne

Forum User
Junior
Registered: 07/02/07
Posts: 27
well you on to sme thing. now its
Parse error: syntax error, unexpected '<' in /home/bhaa1/public_html/plugins/staticpages/functions.inc(838) : eval()'d code on line 10
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
That's still the same (sort of) error as above.

Did you read the documentation?

bye, Dirk
 Quote

Status: offline

rdunne

Forum User
Junior
Registered: 07/02/07
Posts: 27
Hi all
yes i read the doc.
I think my problem is mixing the php and html .. I dont know how to!! below is the script with PHP. I have two sets of php code. But if i take out the <?php ?> , it still fails , If i can get this working , I will turn it into a geeklog block. it's a very good anti spam form script using a random number instead of captra words.

Richard

<?php
include 'config.php';
?>

<script src="validation.js"></script>
<script>
required.add('fullname', 'NOT_EMPTY'Wink;
required.add('email', 'EMAIL'Wink;
required.add('comments', 'NOT_EMPTY'Wink;
required.add('answer_out', 'NUMERIC'Wink;
</script>
<link rel="stylesheet" type="text/css" href="form_style.css" />


<form name="fcform2" method="post" action="process_form.php" onsubmit="return validate.check()">
<div id="fcf2">
<h3>Contact Us Form</h3>
<p>All fields marked with <em>*</em> are required.</p>

<div class="r">
<label for="fullname" class="req">Full Name: <em>*</em></label>
<span class="f">
<input type="text" name="fullname" size="40" id="fullname" onBlur="trim('fullname'Wink">
</span>
</div>

<div class="r">
<label for="email" class="req">Email Address: <em>*</em></label>
<span class="f">
<input type="text" name="email" size="40" id="email" onBlur="trim('email'Wink">
</span>
</div>

<div class="r">
<label for="phone">Telephone: </label>
<span class="f">
<input type="text" name="phone" size="40" id="phone" onBlur="trim('phone'Wink">
</span>
</div>

<div class="r">
<label for="comments" class="req">Comments: <em>*</em></label>
<span class="f">
<textarea cols="30" rows="8" name="comments" id="comments" onBlur="trim('comments'Wink"></textarea>
</span>
</div>

<div class="r">
<label for="quest" class="req"><?php echo $question; ?> <em>*</em></label>
<span class="f">
<input type="text" name="answer_out" size="6" id="answer_out" onBlur="trim('answer_out'Wink"> &nbsp;

Spam prevention <a href="http://www.freecontactform.com/" target="_blank" title="Contact Form Script">Contact Form</a> question.


</span>
</div>

<div class="sp">&nbsp;</div>

<?php
if(isset($_GET['done'])) {
echo '<div align="center" style="color:red;font-weight:bold">'.$confirmation_message.'</div><br />';
}
?>

<p align="center">
<input type="submit" value="Submit">
<br /></p>
</div>


<input type="hidden" name="answer_p" value="<?php echo $answer_pass; ?>">
<input type="hidden" name="enc" value="<?php echo $enc; ?>">
</form>
 Quote

All times are EST. The time is now 10:51 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content