Jump to content

EagleAmerican

Members
  • Posts

    69
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

EagleAmerican's Achievements

Member

Member (2/5)

0

Reputation

  1. Parse error: syntax error, unexpected T_VARIABLE in /home/sites/site/public_html/ftp/ftpdl.php on line 7
  2. I'm trying to make a script to download all files from an ftp directory to my hosting. I know I need to use a loop but not sure where to go from here. Any help appreciated. <?php $ftp_server = ""; $uname = ""; //Enter your ftp username here. $pwd = ""; //Enter your ftp password here. $directory = "" //Enter the dir of the files on the server here. $connection = ftp_connect($ftp_server) or die("Error connecting to $ftp_server"); $login = ftp_login($connection, $uname, $pwd); if (ftp_chdir($connection, $directory)) { echo "Changed directory to: " . ftp_pwd($connection) . "\n"; } else { echo "Error while changing directory!\n"; } ftp_pasv($connection,TRUE); $count = count(ftp_nlist($connection, ".")); ftp_close($connection); ?>
  3. Just need files, thank you very much!
  4. How would I get the number of files in an FTP directory? I have it getting to the right directory and logging in and all of that but I need to know how many files are there. Thanks.
  5. Removed the @ and no error. Just said "The parasite 'Test' has been added." But still no Removal Instructions.
  6. Same thing happens. Removal Instructions don't get added. I have a feeling that it is something in php.ini because I just switched hosts and now having a lot of problems. If so, which one could it be? Thanks, Adam
  7. Just switched hosts and now another problem with PHP. Whenever I add a parasite, the last of 5 fields doesn't get added (removal instructions). I have to edit it multiple times before it will go in. The last problem I had, register_globals was off.. is that causing this too? index.php <?php if (isset($_GET['addparasite'])): ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <label>Name:<br /> <textarea name="parasitename" rows="1" cols="50"> </textarea></label><br /> <label>Origin:<br /> <textarea name="parasitefrom" rows="1" cols="50"> </textarea></label><br /> <label>Genre:<br /> <textarea name="parasitegenre" rows="1" cols="50"> </textarea></label><br / <label>Description:<br /> <textarea name="parasitedescription" rows="5" cols="50"> </textarea></label><br /> <label>Removal Info:<br /> <textarea name="parasiteremoval" rows="5" cols="50"> </textarea></label><br /> <input type="submit" value="Add" name="parasiteadd" /> </form> if (isset($_POST['parasiteadd'])) { $parasitename = $_POST['parasitename']; $parasitefrom = $_POST['parasitefrom']; $parasitegenre = $_POST['parasitegenre']; $parasitedescription = $_POST['parasitedescription']; $parasitetechremoval = $_POST['parasiteremoval']; $sql = "INSERT INTO parasite SET parasitename='$parasitename', parasitefrom='$parasitefrom', parasitegenre='$parasitegenre', parasitedescription='$parasitedescription', parasiteremoval='$parasiteremoval'"; if (@mysql_query($sql)) { echo "<p>The parasite '$parasitename' has been added.</p>"; } else { echo '<p>Error adding submitted parasite: ' . mysql_error() . '</p>'; } } Thanks, Adam
  8. I'm pretty sure the code has nothing to do with it because it works on the other host but not on the new one.. but here it is: search.php <form method="post" action="execute_search.php"> <table width=90% align=center> <tr><td>Search for Parasite:</td><td><input type="text" name="search" size="60" maxlength="255"></td></tr> <td></td><td><input type="submit"></td></tr> </table> </form> execute_search.php (I get the message "Please go back and enter something to search for." no matter what. Even if I enter a search. <?php if ($search) // perform search only if a string was entered. { $dbcnx = @mysql_connect('', '', ''); if (!$dbcnx) { exit('<p>Unable to connect to the ' . 'database server at this time.</p>'); } $srch="%".$search."%"; $query = "select * from parasite WHERE parasitename LIKE '$srch'"; $result = mysql_db_query("adaarm_db", $query); if ($result) { echo "Search Results:<br><br>"; echo "<table width=90% align=center border=1><tr> <td align=center>Name</td> <td align=center>From</td> <td align=center>Genre</td> </tr>"; while ($r = mysql_fetch_array($result)) { // Begin while $id = $r["id"]; $name = $r["parasitename"]; $from = $r["parasitefrom"]; $genre = $r["parasitegenre"]; echo "<tr> <td><a href=view.php?id=$id>$name</a></td> <td>$from</td> <td>$genre</td></tr>"; } // end while echo "</table>"; } else { echo "Error 8574"; } } else { echo "Please go back and enter something to search for."; } ?>
  9. What could be causing this then? It says that nothing was posted when stuff was posted.
  10. I just switch hosting and now my search won't work. It uses POST to post the search to my execute_search.php page. I think that this value in php.ini is causeing the problem: max_input_time. It is set to 30.. is that my problem? My previous host had that at -1. Thanks, Adam
  11. Thanks so much! It worked. It just overflowed the imput and needed a textarea.. thanks! Thanks, Adam
  12. Take a look at the screenshot from my original post. This might fix it.. let me give it a shot. Thanks again, Adam
  13. Thank you so much for your response. Will the htmlspecialschars convert it back? Because the view.php file that I am using needs to parse the HTML for the download links, etc. Thanks, Adam
×
×
  • 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.