gangsterwanster1 Posted May 8, 2009 Share Posted May 8, 2009 Is there any way once a user opens a page with a php script to automatically make a .html with a couple columns in the newly made file? Link to comment https://forums.phpfreaks.com/topic/157343-php-basic-help/ Share on other sites More sharing options...
jackpf Posted May 8, 2009 Share Posted May 8, 2009 fopen() & fwrite() Link to comment https://forums.phpfreaks.com/topic/157343-php-basic-help/#findComment-829318 Share on other sites More sharing options...
gangsterwanster1 Posted May 8, 2009 Author Share Posted May 8, 2009 what about specifically making a table + fwrite Link to comment https://forums.phpfreaks.com/topic/157343-php-basic-help/#findComment-829331 Share on other sites More sharing options...
Axeia Posted May 8, 2009 Share Posted May 8, 2009 fwrite is a 'global' way of creating files, it's not specific to any particular kind of string. You'd simply need to pass in the second parameter as '<table><tr><td></td></tr></table>'. http://php.net/fwrite Link to comment https://forums.phpfreaks.com/topic/157343-php-basic-help/#findComment-829367 Share on other sites More sharing options...
gangsterwanster1 Posted May 10, 2009 Author Share Posted May 10, 2009 Why do i get a syntax error with this? fwrite($file, <table><tr><td>l_DATA .</td></tr></table>"\n"); Link to comment https://forums.phpfreaks.com/topic/157343-php-basic-help/#findComment-830836 Share on other sites More sharing options...
Ken2k7 Posted May 10, 2009 Share Posted May 10, 2009 fwrite($file, '<table><tr><td>' . l_DATA . "</td></tr></table>\n"); Link to comment https://forums.phpfreaks.com/topic/157343-php-basic-help/#findComment-830838 Share on other sites More sharing options...
gangsterwanster1 Posted May 10, 2009 Author Share Posted May 10, 2009 fwrite($file, '<table><tr><td>' . l_DATA . "</td></tr></table>\n"); No error came up but i don't see the table either? //Why doesn't this become bold? : '<br>' . "Data: " . '</br>' . Link to comment https://forums.phpfreaks.com/topic/157343-php-basic-help/#findComment-830844 Share on other sites More sharing options...
Ken2k7 Posted May 10, 2009 Share Posted May 10, 2009 You're using <br> instead of <b>? Link to comment https://forums.phpfreaks.com/topic/157343-php-basic-help/#findComment-830846 Share on other sites More sharing options...
gangsterwanster1 Posted May 10, 2009 Author Share Posted May 10, 2009 You're using <br> instead of <b>? oops, my bad. Last question. fwrite($f, '<table><tr><td>' . '<b>' . "Data1: " . '</b>' . l_DATA . '<b>' . "Date2: " . '</b>' . l_DATA2 . '<b>' . "Date3: " . '</b>' . l_DATA3 . "</td></tr></table>\n"); How can i do it so there is 3 columns; data1, data2, data3. And l_data goes under the title column? Link to comment https://forums.phpfreaks.com/topic/157343-php-basic-help/#findComment-830850 Share on other sites More sharing options...
Ken2k7 Posted May 10, 2009 Share Posted May 10, 2009 $data = '<table><tr><td>' . I_DATA . '</td><td>' . I_DATA2 . '</td><td>' . I_DATA3 . '</td></tr></table>'; fwrite($f, $data); Link to comment https://forums.phpfreaks.com/topic/157343-php-basic-help/#findComment-830854 Share on other sites More sharing options...
gangsterwanster1 Posted May 10, 2009 Author Share Posted May 10, 2009 $data = '<table><tr><td>' . I_DATA . '</td><td>' . I_DATA2 . '</td><td>' . I_DATA3 . '</td></tr></table>'; fwrite($f, $data); [/quote Thanks. //Is it possible to set the background color of the file i am writing to 'fwrite'? Link to comment https://forums.phpfreaks.com/topic/157343-php-basic-help/#findComment-830860 Share on other sites More sharing options...
Ken2k7 Posted May 10, 2009 Share Posted May 10, 2009 Add a body tag and use some CSS? Link to comment https://forums.phpfreaks.com/topic/157343-php-basic-help/#findComment-830861 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.