Okay guys
I finally have my problem solved with the application I have been developing, but I still have one hurdle to jump over.
I have developed an application that keeps track of ticket sales for concerts. The administrators of the program have the ability to create events by typing in a name for the event in a form. When they submit this form a table in the mysql database is created with the same name, all data for the 3000+ tickets is dumped into this table from a master table, and an administration page for updating the data in the table is created. All of this is done with one php script that the form has been submitted to.
I have added code to this php script to create a user front end so visitors to their web site can view available tickets in real time. This means that when the administrators update a ticket for a particular event from available to sold, there is a graphical representation on the web site showing that the ticket has been sold.
Now here is my final problem. This php script is getting quite large currently it is nearly 3000 lines of code. I have 12 pages that this script must write but can only get it to write the first two. If I add more code to the script it simply returns a page cannot be displayed error. The script works fine with no problems when only the first two pages that need to be created are in the script. It stops working when another page is added. I am using the fopen() function to do this and I am using the fclose() function at the end of each page that needs to be written. Is there an efficient way to create all files needed when the submit button from the event creation form is clicked?
Below is the code I use to write the file.
<?php
$filename = "twadmin/$varname.php";
$content="The content here is actually html code for a php page";
$fp = fopen($filename,"w") or die ("Error Opening File");
fputs($fp,$content);
fclose($fp);
?>
Please note that I am passing the name that was typed in the field on the form as a variable so a php page with the same name is created.
The code for the first page is 280 lines. This is the first page that is created. This page is the data administration page.
The code for the second page is 2320 lines. This is the second page that is created for visitors to the web site to view available tickets.
This second page contains all of the information for one section of the theater where the event is taking place. There are a total of 11 sections; therefore I need to create a total of 11 corresponding pages for viewing.
Again my script works fine until I add another page creation section to it.
Please Help
Thanks
Stan Forrest
Senior Web Developer
ATG Internet