Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 10:51 pm EST
Geeklog Forums
static page using php
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:
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:
11
7
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
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
13
6
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';
required.add('email', 'EMAIL';
required.add('comments', 'NOT_EMPTY';
required.add('answer_out', 'NUMERIC';
</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'">
</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'">
</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'">
</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'"></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'">
Spam prevention <a href="http://www.freecontactform.com/" target="_blank" title="Contact Form Script">Contact Form</a> question.
</span>
</div>
<div class="sp"> </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>
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';
required.add('email', 'EMAIL';
required.add('comments', 'NOT_EMPTY';
required.add('answer_out', 'NUMERIC';
</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'">
</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'">
</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'">
</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'"></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'">
Spam prevention <a href="http://www.freecontactform.com/" target="_blank" title="Contact Form Script">Contact Form</a> question.
</span>
</div>
<div class="sp"> </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>
7
10
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