Jump to content

cazes

New Members
  • Posts

    6
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

cazes's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Here is just some pseudo code I have written up db connect $v_date=$_POST['date']; send $v_date and $v_uniquename to database $newhtml = fopen("vod/$v_uniquename.php", "w"); fwrite($newhtml, ' <html> <body> html code in here <? php <table> <tr> <td> <FONT COLOR=\'FFFFFF\'>\'$v_date\'</font> </td> </tr> </table> ?> </body> </html>' ); So essentially the data entered into the form field $v_uniquename will become the name of the file and $v_date will become the data within a table on that page. so v_uniquename.php will look something like <html> <body> html code in here <? php <table> <tr> <td> <FONT COLOR=\'FFFFFF\'>1/1/2012</font> </td> </tr> </table>
  2. Possibly - I am not really much of a php coder more into C++ where things make sense I am trying to make a form where data can be entered and then it uses that information to make a variable php website based upon the information entered. The data is also sent to a mysql database (which I have working fine). I dont want to go into sessions they have more problems then they are worth IMO. I am thinking of using a variable to create the php file via fwrite and then use some kind of pathinfo function to recall that and uses that for a database search which can load the dynamic information based upon the file name. Long way around and I am sure there is a much more elegant method.
  3. I have now run into another problem with fwrite, I believe it has to do with scope of my functions and I am sure there is a simple work around. As above I am using a form to input data, something like $v_date=$_POST['date']; then I am shooting it off to my MySQL database with something like $query="insert into table(date) values('$v_date') mysql_query($query) then using fwrite to create a php file and I have everything working fine up until I want to reference the user input from the form ($v_date) in my fwrite .php output file by using ".$v_date." I would assume it has to do with scope, as the php file can not reference the user input once it is created with fwrite. Is there another way to do this without calling the data from MySQL database? Basically I want to send the users input to the MySQL database and to the .php output of fwrite
  4. Thanks mate worked perfectly - if you ever need C++ help let me know. Thanks again!!
  5. Parse error: syntax error, unexpected T_LNUMBER and it happens on everyline within my php code that contains a ' thanks for help
  6. Hello, I am a C++ coder who is new to php so please excuse my n00bness. I have a form which I am then passing into a MySQL database via a php script. I am also using fwrite to try and create a .php site out of the variables entered into the form. Everything is working fine and I have managed to do this with a .html site but when I try to pass php into fwrite it doesn't work. example code $newhtml = fopen("backup/$v_uniquename.php", "w"); fwrite($newhtml, ' <html code here> '); works like a charm but when I use something like (just an example) $newhtml = fopen("backup/$v_uniquename.php", "w"); fwrite($newhtml, ' <?php while($row = mysql_fetch_array($result_date)){ $date = $row['1']; $team1 = $row['2']; $team2 = $row['3']; ?> '); I get errors and I am assuming it is because I am passing using ' ' within the php code within a fwrite function. Is this correct? and is there a work around way to make a php page using this method or something similar.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.