-
In basic structure, here's a way to do it.
PHP Code:
<?php
// Decide whether we show the form, or try to process the form details
$showform = true;
// Set a flag for showing timesheet done message, and doing the redirect
$timesheet = false;
if (isset($_POST['submit'])) {
// Form has been submitted - try to process
// All your connection, form variables and SQL code goes here
// You should already have the necessary code from previous posts
// Assuming all went OK - allow the page to redirect
$timesheet = true;
$showform = false;
}
?>
<html>
<head>
Put whatever other header tags are needed here
<?php
if ($timesheet === true) {
// Set the redirect metatag
echo '<meta http-equiv="refresh" content="5;url=http://website/page.php">';
}
?>
</head>
<body>
<?php
if ($showform === true) {
?>
<form action="" method="post">
<!-- Put the form here -->
</form>
<?php
}
?>
<?php
if ($timesheet=== true) {
echo '<p>Your timesheet has been saved.</p>';
}?>
</body>
</html>
-
I've gotten it to show up with all the mysql code. It's just not submitting now. It just reloads the page when you press submit.
-
So please please PLEASE can you show us ALL the code of your page. Don't assume that it won't help us - I'm telling you it WILL.
-
Siteguru, Please check your pm
I'm getting ready to post the whole page.
-
1 Attachment(s)
I've attached the full page.
-
-
I've looked at the file - it does not show ANY of the changes we have suggested. I am not editing your file for you.
-
...That code is 9644 lines...and most of it is a big waste...it might be better to hire a professional.
There is no way anyone can manage or debug that.
You repeat
PHP Code:
<input type="text" name="sunworkjob2" size="12" value="<?php
mysql_select_db(time_timesheet_helloworld_com, $connection);
$result253 = mysql_query("SELECT * FROM timesheet
WHERE username='$_SESSION[user_name]'");
while($row = mysql_fetch_array($result253))
{
echo $row['sunworkjob2'];
}
?>">
like 50,000 times with errors no doubt very very ineffeciant and slow. I don't know what you are doing but this is just one big mess its time to trash it and start over with a clean slate.
-
@wickedneat:
Looked into it. You sincerely need to start over.
-
The error is with the if then statement at the top... If you press submit... It doesn't follow up in the bottom mysql statement. That is where the error lies.
-
The error is with the if then statement at the top... If you press submit... It doesn't follow up in the bottom mysql statement. That is where the error lies.
-
wow just wow, all i can say is theres TONS of unneeded code in alot of examples in this thread... start over...