This topic is locked

How do I Invoke the ADD Screen

9/22/2005 12:03:53 PM
PHPRunner General questions
jimhnet author

I know how to create a separate project to just allow adding of data.
How do I make it come up with the add screen already in place and once submitted not allow them add anymore or preferrably go to a landing page.
Jim Freeman

admin 9/23/2005

Jim,
to open Add page just use it's URL, i.e.

http://www.mydomain.com/.../..._add.php
You can modify generated ..._add.php file to redirect to other page after the record is added.

Open it with a text editor, find this line of code:

$message="<div class=message><<< "."Record was added"." >>></div>";



and insert the following just after it:

header("Location: http://www.mydomain.com/index.html");;

return;



where http://www.mydomain.com/index.html is your desired URL.

jimhnet author 9/24/2005

Sergey:
When I add the code I get the error message below.
Also, do you have anykind of logic flow chart to follow on the generation of the code. I guess after 30+ years I'm getting senile and have trouble following the php flow.
BTW, I've only linked to an add screen about thousands of times(slept through it this time).
Thanks
Jim
PHP error happened
Technical information

Error type 2

Error description Cannot modify header information - headers already sent by (output started at /home/host/public_html/dalrcforms/surveyenhanced/register_add.php:23)

URL www.pvshosting.com/dalrcforms/surveyenhanced/register_add.php

Error file /home/host/public_html/dalrcforms/surveyenhanced/register_add.php

Error line 230

SQL query insert into `register` (`email`, `lstname`, `fstnames`, `name`, `addr1`, `city`, `st`, `zip`, `status`, `phone`, `phone2`, `fax`, `emplnum`, `hiredt`, `dept`, `dob`, `donor`) values ('jimhnet@Olp.net', 'jim', 'jim', 'jim', 'jim', 'jim', 'ok', '74153', 'Retired', '9185551212', '9185551212', '1', '1234', '2005-9-29', 'adsf', '2005-10-1', 'dsfasdfdsa')

admin 9/27/2005

Jim,
sorry, my fault.

Here is the correct snippet to be inserted in the same location.

?>

<script>

window.location="http://www.mydomain.com/index.html";;

</script>

<?php

return;