Create Csv File
I have php pages that fetch data from MySQL and displays it in table format. I need to be able to have export to excel link and have it prompt to save the page as an excel file.. Any ideas on an easy way to do this? Is there a query which creates a csv file or any other ideas?
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
Implode - Read The Contents Of A File (servers) And Create A New File
I am trying to read the contents of a file (servers) and create a new file off of it with more information line by line. You will see the logic soon. I know how to do this via a script but not php. The end result is servers2 should have (ssh root@$count 'echo $user|passwd --stdin root' ; done). The variable $count is the list of servers in the (servers) file, so it will have the line above for each server name. Code:
View Replies !
View Related
Function In PHP To Create Files Such As A Php File Or Txt File?
I am currently creating a file manager to add/edit/delete files and folders, etc but i was wondering if there is a function in PHP to create files such as a php file or txt file? All i want is a function that will allow you to create a file from the name you give! Is this possible? I have seen a script called Genesis but the problem is that it is Perl! and i dont have a clue about Perl!
View Replies !
View Related
Create A .txt File Or Skip If .txt File Already Exists
I am currently trying to write a favourites script which will store all the information on a .txt file using the following line of code, $file = fopen("mytextfile.txt","w"); All works great apart from one tiny problem... Every time i reload the page it re-creates the .txt file and deletes all the content. I need the code to create a .txt file if one doesn't exist (and skip the creation if one does) then run the rest of my program. My guess so far is this... If 'text file' doesn't exist, create one then run rest of code. If 'text file' does exist, simply run the rest of the code.
View Replies !
View Related
Can Php Create A New Txt File?
I'm trying to build an e-card page for a client using php, but they don't want to use a mySQL database, so I was wondering if PHP can create new text files when someone enters their information into a form and then the recipient gets an email with that txt file reference in a link and can then go to a page that populates with that particular text. Does it sound like I'm on the right path?
View Replies !
View Related
Create New File
I have been messing with php ftp connections, and for the purpose of my new site, i need to create a new file. I am currently working in this directory htdocs/this_directory when a user signs up, they recieve their own directory htdocs/username i want to create a file called index.html in their directory, but the code to create index.html must be placed in the htdocs/this_directory
View Replies !
View Related
Create A Php File
I'd like to create a php file after a user submit a thread. For example, i post this thread with the title of "create a php file like this forum does", then i want to create a php file with a name of "create-a-php-file- like-this-forum-does.php". I tried to create a php file as following, but it does not work. <?php error_reporting(e_all); $myFile="create-a-php-file- like-this-forum-does"; $e=".php"; $myFile="$myFile$e"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "<html>welcome to mypage, I am testing</html>"; fwrite($fh, $stringData); fclose($fh); ?>
View Replies !
View Related
Create A Cgm File
I'm looking for a php library that would let me create a cgm file (a map) reading from a mysql spatial database... It would be good to create other kinds of vectorial files (svf, for example) do you know a good one? free, possibly...
View Replies !
View Related
Create PHP File
Edit a .htaccess file to redirect users from a specific folder to a file having problems with this as the address contains a? mark which messes up the address (Example test.php?user=1) and when I go to the folder it does redirect (Made the script add it to .htaccess) but I get a 404 as the? is coming up as a %3f Create a blank index.php (I can then write a custom redirect from there.
View Replies !
View Related
Cannot Create File When Uploading
Hi. I use this script to upload file (taken by Zend.com website) This works locally, but when i upload to server i get an error. script... //$campofile is the file field filled before in a form... $archive_dir = "../folder1"; $filename = basename($campofile_name); $filesize = basename($campofile_size); $filetype = basename($campofile_type); if($campofile!='') { if(!copy($campofile,"$archive_dir/$filename")) echo "Error: $filename could not be uploaded."."<br>"; } After executing that script i get this error:
View Replies !
View Related
Cannot Upload And Create File
I've written this script to upload files to my server, and if the file being uploaded is an image file, a thumbnail is automatically created along with it. But right now, after you select the file, and hit upload, you are brought to a blank screen. I check the directories, and the files are not uploaded. Everything LOOKS right, I just don't know what's wrong. PHP Code:
View Replies !
View Related
How Do I Create An Url That Downloads An Mp3 File?
i want to write a script that lets me create a url that downloads an mp3 file like this: http://domain.com/songs.php?m=killerfx and have that goto this file http://domain.com/music/abc.mp3 this is what I have so far, could someone help me with the missing part? <?php $m = $_GET['m']; $file = 'music/'.$m.'.mp3';?>
View Replies !
View Related
Create Downloadable Xml File
I need to make a downloadable xml google sitemap based off of mysql data. What fuctions would I use. I assume I would be using fopen to write it, but how do I make it downloadable. I don't want there to be a copy of it on the server (permissions wouldn't allow it anyway), I just want people to hit a button, generate the file, and download it.
View Replies !
View Related
Script Will Not Create A File
why my script will not create the desired file I want. The paths are correct so it is not them. PHP Code: <?php   error_reporting(E_ALL);     /* Count number of hits on the site when user enters site    * for the first time every three hours    */   function countPageHits() {     $date = date('m_d_Y');     $ip = $_SERVER['REMOTE_ADDR'];
View Replies !
View Related
Create An Ms Word File
I have customer contact information in a MySQL DB. The standard stuff: first name, last name, city, state, zip, etc. I'd like to write a PHP script that will take a customer ID range (e.g., customer 10000 - 11000) and stick those into an MS Word document, plain text document, or a PDF (any of the three will work). The key is that each record has to have a page break after it so that each customer prints on a separate piece of paper. Anyone know how to do this?
View Replies !
View Related
File Create / Download
I have a text file which stores MAC addresses. I would like to have a form prompt for the last six characters of the MAC maybe in a text area field (the first six will never change so I'll code them statically) and upon submitting, generate a text file with the MAC's listed in the order entered, with colons at the normal spacing. The output file should look like this: 00:10:36:0E:21:A2 00:10:36:20:14:33 00:10:36:05:1F:44 00:10:36:04:71:5B and it could have several hundred entries. I think I can do the coding to get the file created but pretty much don't know where to begin putting the values into the file and then make the file automatically pop up with a "save as" dialog box so I can choose to save it locally instead of to the server.
View Replies !
View Related
Create A File (txt) To Download
does anyone knows which are the functions I've to use to create a file, in this case a txt or a csv, that will be asked in runtime to the user to download it? So I suppose without creating any file on the server. Something like the dump in phpmyadmin when we choose to save as.
View Replies !
View Related
Create A Text File
how to create a text file in remote server from local system with full path of that file. I created a text file in my system. $fp = fopen( http:://192.168.192.168/icronex/text.txt ,w+) fwrite($fp,"icronex is my name"); fclose($fp); But i got an error like *** can't find file in this directory...........*** but i need to create a text file on remote system like.
View Replies !
View Related
How To Create A File With A Php Extension
Just purchased mac mini and upgraded to Tiger 10.4. I want to create a small web app with php that links up with a mySQL db. I have mySQL installed and php installed. Problem is, I do not know how to create a file with a php extension (e.g. info.php). I thought developer tools xCode2 came standard with Tiger, but TextEdit does not allow php extensions. I think I have already configured Apache to work with php pages.
View Replies !
View Related
Alter And Create New Png File
I'm trying to take an existing png file, modify it in php, and then to create a new png, but haven't got it work yet. I've been trying with the imagecreatefrompng (http://us.php.net/manual/en/function.imagecreatefrompng.php) function, but always keep getting a black image, and not the updated modify image.
View Replies !
View Related
Create A .txt File Online
I am trying to create a PHP script that will create a .txt file online, and then fill it with a string. At the moment, i'm keeping it simple, so just need the code to create a new .txt file if this is even possible.
View Replies !
View Related
Create A Table Regarding A Text File
I have this .txt file : Roger|tow25$rank259 Isabelle|tow36$rank24 Pascal|tow12$rank29 Sergeï|tow45$rank5 Michel|tow1245$rank45478 Frédéric|tow1$rank125425 And this programm php3 <?php $fichier = "classeur.txt"; if($fp = fopen($fichier,"r")){ $ligne=1; echo "<table border=1 bordercolor="#00CCFF" width=500> "; echo "<tr align=center><td colspan=3>TITRE</td>"; while (!feof($fp)) { list( $name, $tampon ) = explode( "|tow", $fp ); list( $tow, $obj ) = explode ( "$rank", $tampon ); echo " <tr>"; echo "<td align=center><b>Nom".$name."</b></td><td>Tow".$tow."</td><td>Obj".$obj."</td[color=blue] >";[/color] echo "</tr> "; $ligne++; echo "</table> "; echo "$cell"; fclose($fp); }else{ echo "Error : open impossible ".$fichier; exit(); } ?> I would like to past each value of the lines in the tex file, in 3 variables $nom; $tow; $obj and create a table with 3 column ( column 1 the name, in 2 the tow, and in 3 the obj)
View Replies !
View Related
PHPMyadmin - Create Configuration File
i am trying to learn php mysql and i am trying to learn these on an apache server. Mysql seems to work fine and so does my php and apache ( i downloaded them all from the official sites) I have now tried to download phpmyadmin but i just don't understand how you setup the program I have clicked to the following page http://localhost/phpMyAdmin/index.php but get this error message: Probably reason of this is that you did not create configuration file. You might want to use setup script to create one. Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO) What do i have to do to fix this problem i have been searching through google and followed some tutorials but still can't get it to work.
View Replies !
View Related
Create A Zip File Of The Contents Of A Folder?
Im wondering if there is a way, through a php script, to create a zip file of the contents of a folder? E.g. the web user would submit a form, and after a bit of validation, a zip file would be created, and a download forced. How could would i go about creating the zip file through php? (Im hosted on a Windows mashine)
View Replies !
View Related
File Upload With Create Folder
I am trying to have a file uploaded into a directory, based on user input. If the folder they are uploading to doesn't exist, it is created. The only thing I can think of, is that this method of file uploading will only work to 1 folder deep. That is only a guess though. Also the "destination" will only be 1 word long. Code:
View Replies !
View Related
Script To Create Html File
I'm looking for a php script that will look in my images folder and for each image in there, create an html file named <imagename>.html and store it in a folder called "pages". I currently use the code inserted below that scans my image folder, creates an xml file that contains a list of the images and the my Flash image gallery reads the xml file to create the gallery. but I would rather do it by the method I'm requesting above and get away from flash. Any ideas? Even if there's a way to modify the code below to do what I want, that would be great. Code:
View Replies !
View Related
How To Create Only One Binary Log File In Mysql?
I am working on linux platform....as soon as mysql is started then [binary_update_log_filename] is created...if I again restart mysql then new log file is created... ie at first: [binary_update_log_filename].000001 and next [binary_update_log_filename].000002 now is there any method to maintain same log file that is: [binary_update_log_filename].000001 when I restart mysql ie not creating new binary file ie [binary_update_log_filename].000002 .
View Replies !
View Related
Fopen - Create A File For Each Record
I've got a database that has three fields: (1) id (2) filename (3) domain Each record in the database needs it's own html page and what I want to do is write a php script that will create a file for each record. Is there a quick way to do this? I've been reading about fopen and fwrite, but I'm a little unsure of exactly how to do it.
View Replies !
View Related
Create A File And Send To User
I need to create a data file from my PHP for the user to load into their word processor as a mail merge data source. Organising the data into rows of comma separated values isn't too difficult; what puzzles me is how to get that data into a .txt file somewhere on the user's PC. How, in general terms, should I go about doing that? Presumably I generate and present it in some format which causes the browser to issue a "save as" dialog box?
View Replies !
View Related
Create A Flat File From EXCEL
I need to create a flat file for a program to run against to load Ledger information. Basically I need to ensure that column 1 takes up 10 spaces regardless of how many characters are present, and column 2 takes up 5 spaces etc. how I can do this?
View Replies !
View Related
Create Directory Then Writing Txt File
i got it to create and write a txt file but now i'm trying to get it to create a new directory then write the file. <?php   $newDirName = ["clientsName"]  $_POST["repsName"] . $_POST["clientsName"]. $_POST["clientsPhone"]. $_POST["clientsUrl"]. $_POST["shortDescroption"]. $_POST["longDescription"]; if(is_dir("./files")) mkdir("./files/"$newDirName, 0755); $mode = file_exists('user_input.txt')?'a':'w'; // append if file exists otherwise create it $fp = fopen('user_input.txt',$mode);  // open file fwrite($fp,print_r($_POST,true)." ");  // dump the contents of the $_POST array to the file fclose($fp); ?> Â
View Replies !
View Related
Cant Create Directory (or Write File In It)
wSub.php is supposed to take a form and, based on the forms contents, create a directory and record the forms contents in that directory. I know from testing with echo commands that the directory name and file name are good, but when I "uncomment" the code below which is supposed to create the directory and write the file, I get the errors that follow the code. Code:
View Replies !
View Related
F12 Preview Weird Create New File
I've just started using/learning PHP and I seem to have everything running ok except for this one thing. I'm using Dreamweaver 8 and WAMP 5 (Apache 1.3.33 and PHP 5.1.1). When I hit F12 to preview a page, lets say index.php, in my browser, instead of index.php opening an identical page is created, opened and called something like "TMP9te8rr8zx6.php". This page is then added to the contents of sites root directory. If I were to type in www.localhost.com or www.localhost.com/index.php then this does not happen.
View Replies !
View Related
Create PDF File :: Page Not Found
I have some problems with using php to create PDF file. I have tested my php and making PDF already enabled. But when testing the code below, it always takes me to Page not found. <?php try { $p = new PDFlib(); $p->begin_document(NULL,NULL); $p->set_info("Creator", "hello.php"); $p->set_info("Author", "Rainer Schaaf"); $p->set_info("Title", "Hello world (PHP)!"); $p->begin_page_ext(595, 842, ""); $font = $p->load_font("Helvetica-Bold", "winansi", ""); $p->setfont($font, 24.0); $p->set_text_pos(50, 700); $p->show("Hello world!"); $p->continue_text("(says PHP)"); $p->end_page_ext(""); $p->end_document(""); $buf = $p->get_buffer(); $len = strlen($buf); header("Content-type: application/pdf"); header("Content-Length: $len"); header("Content-Disposition: attachment; filename=hello.pdf"); print $buf; } catch (PDFlibException $e) { die("PDFlib exception occurred in hello sample: " . "[" . $e->get_errnum() . "] " . $e->get_apiname() . ": " . $e->get_errmsg() . " "); } catch (Exception $e) { die($e); } $p = 0; ?> I wonder what the reason is? Thanks in advance for your help.
View Replies !
View Related
|