473,513 Members | 2,554 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help pls!

2 New Member
hi! im olive, i only new the basics of php and i have this problem..our website has it's own feedback form but for some reasons it's not working, can someone help me find what could be the problem in the script coz everytime i hit the submit form in the feedback form page it always return the error 'Invalid Entry: Hit your browsers back button and resubmit the form.' and the message posted is not saved at all..here are the scripts used in our feedback form and the html form. please someone who could help me..thank you.

loginf.php

<?php
//Change these to match your site.

$bgcolor = '#FFFFFF';
$title = 'PVAO Feedback';
$font = 'Arial';
$fontcolor = '#666633';
$tfont = '"#666633';
$guestinfo_tablecolor = '#CCFFCC';
$messagebody_tablecolor = '#CCFFCC';
$guestinfo_fontcolor = '#666633';
$messagebody_fontcolor = '#666633';
$data = 'guestbook.dat';
$posted_on = Date("M d, Y");
$ok_to_post = 1;
$error_string = 'Invalid Entry: Hit your browsers back button and resubmit the form.';
?>


-----
log.php

<?php


require ("loginf.php");
echo "<html>";
echo "<head>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"pvao.css\">";
echo "<title>$title</title>";
echo "<META HTTP-EQUIV=\"refresh\" CONTENT=\"5; URL=feedbac.html\">";
echo "</head>";
echo "<body bgcolor=\"$bgcolor\">";
if(!$guest){
echo "$error_string";
$ok_to_post = 0;
exit;
}

echo "<h4>Thank you for your feedback<br>You will be redirected to the Feedback Page in a moment.<br><br><a href=\"http://server.pvao.mil.ph/feedbac.html\">Click here</a> if you don't want to wait.</h4>";
$entered = FALSE;
if (file_exists($data))
{
$guestentry = "$guest|$email|$url|$message|$R1|$R2|$posted_on\n" ;
$file = fopen($data,"a");
if(flock($file,2))
fputs($file,$guestentry);
else
exit("Error: couldn't open file");
if(flock($file,3))
fclose($file);
else
exit("Error: couldn't open file");
$entered = TRUE;
}
?>

------

logview.php

<?php
require ("loginf.php");
$home_url='http://server.pvao.mil.ph';
echo "<html>";
echo "<head>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"pvao.css\">";
echo "<title>$title</title>";
echo "<body bgcolor=\"$bgcolor\">";
echo "<center><h3>$title View </h3></center>";
echo "<a href=\"index.html\">Back to PVAO Main</a><br> <br>";


if (file_exists($data))
{
$afile = file($data);
for($num = 0; $num < count($afile); $num++)
{
$bfile = explode("|",$afile[$num]);
echo "<br><div align=\"center\">";
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"2\" width=\"85%\">";
echo "<td width=\"10%\" bgcolor=\"$guestinfo_tablecolor\" align=\"right\" valign=\"top\">";
echo "<p align=\"right\">Last Signed: <br>";
echo "By<br>";
echo "E-Mail:<br>Address:<br>R1:<br>R2:</td>";
echo "<td width=\"50%\" bgcolor=\"$guestinfo_tablecolor\" valign=\"top\">";
echo "$bfile[6]<br>$bfile[0]<br>$bfile[1]<br>$bfile[2]<br>$bfile[4]<br>$bfile[5]</td></tr></table></div>";
echo "<div align=\"center\">";
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"2\" width=\"85%\">";
echo "<tr>";
echo "<td width=\"10%\" bgcolor=\"$messagebody_tablecolor\" valign=\"top\" align=\"right\">Message:</td>";
echo "<td width=\"65%\" valign=\"top\" bgcolor=\"$messagebody_tablecolor\">$bfile[3]</td></tr></table></div>";
echo "<hr>";
}
}
else
{
echo "<tr><td>Couldn't open $data</td></tr>";
}
?>
<BR>
<BR>
<BR>
</body>
</html>
Jan 12 '08 #1
1 921
MarkoKlacar
296 Recognized Expert Contributor
Hi,

could you please re-post using code tags and change the title to something a bit more informative.

Thanks
Jan 15 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

27
3586
by: Chuck Grimsby | last post by:
(Repost, due to lack of submissions...) The Microsoft Access Product Group (the people who build Microsoft Access) want your help! One of the main things we're working on for the near future is a conversion tool to take Microsoft Access 97 databases (primarily, but also Microsoft Access 2000 or 2002/XP databases) up to Microsoft Office...
3
5044
by: bangaw | last post by:
i'm currently using c++ on windowsXP, unistd.h doesnt work for windows what other substitute for it could i use to replace it Pls. Help me Pls pls the code goes as follows #include <stdio.h> #include <unistd.h> #include <pthread.h>
0
1537
by: naheed javaid | last post by:
I m student and doing my final project. My project is related to screen capturing. my project captures screen and save the captured screen as bitmaps in a folder. while the screen recording audio is also captured.i hve saved the captured audio as wav file. i hve created avi form bitmaps only but i m not finding way how to add wav file to avi...
8
1905
by: SanjaiGandhi | last post by:
Hi ...i am new to programing....pls help to overcome this program.. The Program is..: if a = 557..using for loop or while or dowhile ..we have to get the answer for 5+5+7..that is what ever numbers we entered to a..that should be added.. for eg if a = 34 the answe should be 7 that is 3+4 using % and / we can solve this problem..pls help...
17
3986
by: Riaaaa | last post by:
Pls check my code for the stored procedure which i created for the companydetails including companyid P.K. Not Null int(4), companyname Not Null varchar (20), address varchar(30) where companyid is the primary key and it should be autogenerate.
1
1377
by: Anatha Man | last post by:
Hello All Expert and God of King Programmer ! Pls help me now . i create a dictionary project by use Database Snapshot is Back End and VB2005 is front end but i don't know how to connect to database snapshot. pls tell me and Example how to connect it to VB.NET. pls post your code a full example of how to select data from database snapshot by...
1
1455
by: vbsoft | last post by:
Hello My Name is Mike Am from Nigeria a student of computer Science, Pls i want your You to help in Using VISUAL BASIC 6.0 AND MS SQL SERVER AS DATABASE AS A CLIENT SERVER SIDE pLS: I WANT A DEMOSTRATION FORMS THAT WILL EXPLAIN HOW TO DESIGN THE DATABASE. AFTER THAT,
0
1520
by: sonuindia88 | last post by:
Some common confusions .I am reading Ritchie and Deitel and practising questions from Yashwant Kanetkar...Here are some of the confusions i am having..your help is required.... Q1) #include<stdio.h> int main() { printf("%d \n",-5%-4);
1
3122
by: ananthaisin | last post by:
Hi, This is the query i am trying to build I have attached the same in the file.... while running its throwing an error ........ NVL((SELECT USAGEMODE FROM KKTYPEMAST_AP B WHERE B.TYPE_ID_USG=A.TYPE_ID_USG AND
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7565
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7128
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5704
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4759
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3242
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
473
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.