snrecords Posted July 9, 2008 Share Posted July 9, 2008 I transferred my site from one server to another and now my csv upload doesn't work ... Does anyone know how to fix the following errors? It's funny because I copied the site twice onto a database with the same php/mysql software and the site with the security cert. doesn't work, but the one without it does. Please help! Warning: fopen() expects parameter 1 to be string, array given in /home/content/b/u/z/buzzhawa/html/inc/modules/tour/html/load_tour_form.ihtml on line 59 Warning: fgetcsv(): supplied argument is not a valid stream resource in /home/content/b/u/z/buzzhawa/html/inc/modules/tour/html/load_tour_form.ihtml on line 60 Warning: fgetcsv(): supplied argument is not a valid stream resource in /home/content/b/u/z/buzzhawa/html/inc/modules/tour/html/load_tour_form.ihtml on line 70 Link to comment https://forums.phpfreaks.com/topic/113869-csv-upload-doesnt-work/ Share on other sites More sharing options...
trq Posted July 9, 2008 Share Posted July 9, 2008 Post some code. Specifically, the code around line 59. Link to comment https://forums.phpfreaks.com/topic/113869-csv-upload-doesnt-work/#findComment-585173 Share on other sites More sharing options...
snrecords Posted July 9, 2008 Author Share Posted July 9, 2008 Hi!... here's the code from line 59 on to 87 $fp = fopen($load_file_name,"r"); $line = fgetcsv($fp,1024); /* while ($line = fgetcsv($fp, 1024)){ print "<p>". count($line) . "fields:</p>"; print_r($line); } */ while($line = fgetcsv($fp,1024)){ $island = $line[0]; $activity_cat = $line[1]; $activity = addslashes($line[2]); $act_keywords = addslashes($line[3]); $act_description = addslashes($line[4]); $act_prod_name = addslashes($line[5]); $prod_keywords = addslashes($line[6]); $prod_description = addslashes($line[7]); $display_order = $line[8]; $attribute = $line[9]; $att_type = $line[10]; $activity_sku = $line[11]; $act_price = $line[12]; if ($act_price{0} == '$'){ $act_price = substr($act_price, 1); } Link to comment https://forums.phpfreaks.com/topic/113869-csv-upload-doesnt-work/#findComment-585666 Share on other sites More sharing options...
snrecords Posted July 9, 2008 Author Share Posted July 9, 2008 Could GoDaddy's curl code have anything to do with it? The checkout cart didn't work until curl code was inputted too ?? Link to comment https://forums.phpfreaks.com/topic/113869-csv-upload-doesnt-work/#findComment-585765 Share on other sites More sharing options...
trq Posted July 9, 2008 Share Posted July 9, 2008 Where do you define $load_file_name? Link to comment https://forums.phpfreaks.com/topic/113869-csv-upload-doesnt-work/#findComment-585827 Share on other sites More sharing options...
snrecords Posted July 10, 2008 Author Share Posted July 10, 2008 The html form's input is defining the $load_file_name ... I tried using a test csv file replacing $load_file_name with a.csv and tried various paths with a.csv ... and I got a new error ... Warning: fopen(): URL file-access is disabled in the server configuration in /home/content/b/u/z/buzzhawa/html/inc/modules/tour/html/load_tour_form.ihtml on line 59 I'm thinking this has to do with godaddy's server that I'm on ... now i have to figure out the cURL code or have them enable file access ... anyhow the form code is shown below ... <form method="post" action="<?php $sess->purl(SECUREURL . "?page=$modulename/load_tour_form&load=1") ?>" name="product_form" enctype="multipart/form-data"> <?php global $ps_vendor_id; if(@$load == 0) { ?> <table width="50%" border="0" cellspacing="0" cellpadding="0" align="left"> <tr> <td> <h1> <br/>Load Tour Data </h1> </td> </tr> <tr> <td> Use this form to load tour information from CSV file.<br/><br/> </td> </tr> <tr> <td></td> </tr> <tr > <td width="50%"> <input class="input" type="file" name="load_file_name" size="32" maxlength="255"> </td> </tr> <tr > <td width="50%"> <input type="radio" checked="checked" name="type" value="insert">insert </td> </tr> <tr > <td width="50%"> <input type="radio" name="type" value="update">update </td> </tr> <tr> <td> <br/> <input type="submit" name="formbutton1" value=" GO " style="font-family:'Palatino Linotype'; font-weight:normal; font-size:11; color:white; background-color:rgb(0,153,204); border-width:1; border-color:white; border-style:none;"></p> </td> </tr> </table> thanks thorpe! Link to comment https://forums.phpfreaks.com/topic/113869-csv-upload-doesnt-work/#findComment-586165 Share on other sites More sharing options...
trq Posted July 10, 2008 Share Posted July 10, 2008 The html form's input is defining the $load_file_name ... Then it should be.... $_POST['load_file_name'] Register globals has been off by default for over two years and so it should be. Link to comment https://forums.phpfreaks.com/topic/113869-csv-upload-doesnt-work/#findComment-586211 Share on other sites More sharing options...
snrecords Posted July 11, 2008 Author Share Posted July 11, 2008 Hi again Thorpe ... I tried what you said ... and still get the other two errors ... Warning: fgetcsv(): supplied argument is not a valid stream resource in /home/content/b/u/z/buzzhawa/html/inc/modules/tour/html/load_tour_form.ihtml on line 60 Warning: fgetcsv(): supplied argument is not a valid stream resource in /home/content/b/u/z/buzzhawa/html/inc/modules/tour/html/load_tour_form.ihtml on line 70 LINE 59: $fp = fopen($_POST['load_file_name'],"r"); LINE 60: $line = fgetcsv($fp,1024); /* while ($line = fgetcsv($fp, 1024)){ print "<p>". count($line) . "fields:</p>"; print_r($line); } */ LINE 70: while($line = fgetcsv($fp,1024)){ Any ideas? Link to comment https://forums.phpfreaks.com/topic/113869-csv-upload-doesnt-work/#findComment-587176 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.