Welcome to Geeklog Saturday, August 24 2019 @ 07:27 am EDT

Geeklog Forums

static page using php


Status: offline

rdunne

Forum User
Junior
Registered: 02/07/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:

Status: offline

beewee

Forum User
Full Member
Registered: 05/08/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

Status: offline

rdunne

Forum User
Junior
Registered: 02/07/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

Status: offline

Dirk

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

Did you read the documentation?

bye, Dirk

Status: offline

rdunne

Forum User
Junior
Registered: 02/07/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>

All times are EDT. The time is now 07:27 am.

  • 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