
EagleAmerican
Members-
Posts
69 -
Joined
-
Last visited
Never
Everything posted by EagleAmerican
-
[SOLVED] Download all files from directory
EagleAmerican replied to EagleAmerican's topic in PHP Coding Help
Parse error: syntax error, unexpected T_VARIABLE in /home/sites/site/public_html/ftp/ftpdl.php on line 7 -
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); ?>
-
Just need files, thank you very much!
-
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.
-
[SOLVED] Not all data gets submitted.
EagleAmerican replied to EagleAmerican's topic in PHP Coding Help
Thanks a lot! -
[SOLVED] Not all data gets submitted.
EagleAmerican replied to EagleAmerican's topic in PHP Coding Help
Removed the @ and no error. Just said "The parasite 'Test' has been added." But still no Removal Instructions. -
[SOLVED] Not all data gets submitted.
EagleAmerican replied to EagleAmerican's topic in PHP Coding Help
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 -
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
-
Thanks!
-
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."; } ?>
-
What could be causing this then? It says that nothing was posted when stuff was posted.
-
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
-
Thanks so much! It worked. It just overflowed the imput and needed a textarea.. thanks! Thanks, Adam
-
Take a look at the screenshot from my original post. This might fix it.. let me give it a shot. Thanks again, Adam
-
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
-
www.someplace wont work .someplace.domain.com will
EagleAmerican replied to jjmusicpro's topic in PHP Coding Help
Subdomains don't work that way. If it is a subdomain, you don't use the www. infront. The www. is only for the domain and is actually technically a subdomain. -
*Bump* Please this is really important and really is appreciated! Thanks, Adam
-
For some reason, the edit field gets messed up when editing if there is HTML in the data. How can I fix this and also how can I make the fields for parasitedescription and parasiteremoval bigger to like 3 lines in height? <fieldset><legend>Parasite Edit</legend> <form method="post" action="<?php $_SERVER['PHP_SELF']; ?>"> <br /> <br /> <br /> <table width="200" border="1"> <tr> <td><input type="hidden" name="id" value="<?php echo $data['id']; ?>" /> Parasitename:</td> <td><input type="text" name="parasitename2" value="<?php echo $data['parasitename']; ?>" /></td> </tr> <tr> <td>Parasitefrom:</td> <td><input type="text" name="parasitefrom2" value="<?php echo $data['parasitefrom']; ?>" /></td> </tr> <tr> <td>Parasitegenre:</td> <td><input type="text" name="parasitegenre2" value="<?php echo $data['parasitegenre']; ?>" /></td> </tr> <tr> <td>Parasitedescription:</td> <td><input type="text" name="parasitedescription2" cols="3" value="<?php echo $data['parasitedescription']; ?>" /></td> </tr> <tr> <td>Parasiteremoval:</td> <td><input type="text" name="parasiteremoval2" cols="3" value="<?php echo $data['parasiteremoval']; ?>" /></td> </tr> <tr> <td> </td> <td><input type="submit" value="Submit" name="parasiteedit" /></td> </tr> </table> <br /> <br /> </form> </fieldset> Screenshot also attached. Thanks so much, Adam [attachment deleted by admin]
-
*Bump*
-
*Bump*
-
Now I am getting confused too. That line below parasiteremoval is not supposed to be there. It comes from the parasiteremoval part and should be in the edit box. Let's start by making the textbox bigger. How?
-
New screenshot uploaded. Still not working right, [attachment deleted by admin]
-
Sorry but the staff area is protected by .htaccess (username and password). My webhost isn't allowing me to create anymore right now.. I can't even get into the control panel. :S But FTP is still working so I can edit the files. And how would I put them in a table layout? Like with <table><td> etc.?
-
Look in my screenshot where parasiteremoval is in the edit. Next to the text box it says SmitfraudFix tool by noahd... The removal instructions are cut off there and put outside the textbox. Also could we make the textboxes a little bigger for description and removal? Thanks, Adam
-
Screenshot attached and here is the current code because I changed it a bit. Thanks. <html> <head> <title>ParasiteDB - Research and Remove Parasites!</title> <META content="parasite, virus, malware, removal, computer, pc, database, pdb, db" name=keywords> <META content="You can research and find ways to remove hundreds of different parasites here. Come take a look!" name=description> <style TYPE="text/css"> A{text-decoration:none} A:hover{color:#FFFFFF;text-decoration:underline} } BODY { SCROLLBAR-FACE-COLOR: #000000; SCROLLBAR-HIGHLIGHT-COLOR: #000000; SCROLLBAR-SHADOW-COLOR: #0099CC; SCROLLBAR-3DLIGHT-COLOR: #0099CC; SCROLLBAR-ARROW-COLOR: #0099CC; SCROLLBAR-TRACK-COLOR: #000000; SCROLLBAR-DARKSHADOW-COLOR: #0000000; } </style> </head> <BODY BGCOLOR="#000000" TEXT="#FFFFFF" VLINK="#0099CC" ALINK="#0099CC" LINK="#0099CC" topmargin="0"> <table border="0" cellspacing="1" width="100%"> <tr> <td width="100%" background="logo.jpg"> <table border="0" cellpadding="0" cellspacing="0" width="100%" bordercolor="#FFFFFF"> <tr> <td width="100%" background="images/logo.jpg" height="80"> <p align="center"><font color="#FFFFFF" size="4" face="Arial"><b>ParasiteDB - Research and Remove Parasites!</b></font></td> </tr> </table> </td> </tr> <tr> <td width="100%"> <table border="1" cellpadding="5" cellspacing="5" width="100%" bordercolor="#FFFFFF"> <tr> <td width="20%" valign="top"> <font face="Arial" size="2"><b> Navigation</b></font><br> <font face="Arial" size="2"> - <a href="http://parasitedb.freehostia.com/index.php">Home</a><br> - <a href="mailto:[email protected]?subject=Contact Us">Contact Us</a><br> - <a href="mailto:[email protected]?subject=Advertise">Advertise</a><br> - <a href="http://parasitedb.freehostia.com/search.php">Search</a><br> - <a href="index.php">Staff Login</a><br> - <a href="view_online.php">View Users Online</a></font> <font face="Arial" size="1"> <p> </font><font face="Arial" size="2"> <font face="Arial" size="2">Google Ads Coming Soon!</font></a><font face="Arial" size="1"> <p> <font face="Arial" size="2"><b> Sponsors</b></font><br> </font><font face="Arial" size="2">- <a href="http://malwareremoval.com/">Malware Removal</a><br> - <a href="http://pchelpforum.com/">PC Help Forum</a><br> </font></td> <td width="80%" valign="top"><b><font face="Arial"><font size="2" color="#FFFFFF"><center><br> <?php if (isset($_GET['addparasite'])): // User wants to add a joke ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <label>Name:<br /> <textarea name="parasitename" rows="1" cols="50"> </textarea></label><br /> <label>From:<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> <?php else: // Default page display $dbcnx = @mysql_connect('', 'adaarm_db', ''); if (!$dbcnx) { exit('<p>Unable to connect to the ' . 'database server at this time.</p>'); } if (!@mysql_select_db('adaarm_db')) { exit('<p>Unable to locate the ' . 'database at this time.</p>'); } if (isset($_GET['edit'])) { $edit_id = $_GET['edit']; unset($_GET['edit']); $query = "SELECT * FROM parasite WHERE id='$edit_id'"; $result = mysql_query($query)or die(mysql_error()); $data = mysql_fetch_assoc($result); ?> <fieldset><legend>Parasite Edit</legend> <form method="post" action="<?php $_SERVER['PHP_SELF']; ?>"> <input type="hidden" name="id" value="<?php echo $data['id']; ?>"> Parasitename:<input type="text" name="parasitename" value="<?php echo $data['parasitename']; ?>"><br /> Parasitefrom:<input type="text" name="parasitefrom" value="<?php echo $data['parasitefrom']; ?>"><br /> Parasitegenre:<input type="text" name="parasitegenre" value="<?php echo $data['parasitegenre']; ?>"><br /> Parasitedescription:<input type="text" name="parasitedescription" cols="3" value="<?php echo $data['parasitedescription']; ?>"><br /> Parasiteremoval:<input type="text" name="parasiteremoval" cols="3" value="<?php echo $data['parasiteremoval']; ?>"><br /> <input type="submit" value="Submit" name="parasiteedit"> </form> </fieldset> <?php } if (isset($_REQUEST['parasiteedit'])) { $n = $_REQUEST['parasitename']; $f = $_REQUEST['parasitefrom']; $g = $_REQUEST['parasitegenre']; $d = $_REQUEST['parasitedescription']; $r = $_REQUEST['parasiteremoval']; $id= $_REQUEST['id']; $edit_sql = "UPDATE parasite SET parasitename='$n', parasitefrom='$f', parasitegenre='$g', parasitedescription='$d', parasiteremoval='$r' WHERE id='$id'"; $result = mysql_query($edit_sql)or die(mysql_error()); if ($result) { echo "The parasite named $edit_name has been changed.<br /> New values: <br /> Parasitename: $parasitename <br /> Parasitefrom: $parasitefrom <br /> Parasitegenre: $parasitegenre <br /> Parasitedescription: $parasitedescription <br /> Parasiteremoval: $parasiteremoval"; }else{ echo "The edit request could not be carried out."; } } if (isset($_GET['delete'])) { $delete_id = $_GET['delete']; unset($_GET['delete']); $delete_sql = "DELETE FROM parasite WHERE id='$delete_id'"; $result = mysql_query($delete_sql)or die(mysql_error()); if ($result) { echo "The parasite has been deleted."; } else { echo "The delete could not be carried out."; } } 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>'; } } include'notes.php'; echo '<br><p><a href="' . $_SERVER['PHP_SELF'] . '?addparasite=1">Add a Parasite</a></p>'; $sql = mysql_query("SELECT parasitename,parasitefrom,parasitegenre,parasitedescription,parasiteremoval,id FROM parasite ORDER BY parasitename ASC") or die(mysql_error()); echo "<h3>Parasites in Database:</h3><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> <td align=center>Delete</td> <td align=center>Edit</td> </tr>"; while ($r = mysql_fetch_array($sql)) { // Begin while $id = $r["id"]; $name = $r["parasitename"]; $from = $r["parasitefrom"]; $genre = $r["parasitegenre"]; $description = $r["parasitegenre"]; $removal = $r["parasiteremoval"]; /* create a $_GET variable called delete using the objects id. Edit the this page link to the name of this page.*/ echo "<tr> <td><a href=view.php?id=$id>$name</a></td> <td>$from</td> <td>$genre</td> <td><a href='index.php?delete=$id' onclick='javascript: var x = confirm (\"Are you sure you want to delete?\"); if(x==false){ return false;}'>Delete</a></td> <td><a href='index.php?edit=$id'>Edit</a></td></tr>"; } // end while echo "</table>"; endif; ?> </table> </center> </div> <p> </td> </tr> </table> </td> </tr> <tr> <td width="100%"> <p align="center"><font size="2"><font face="Arial">All Site Content © 2007 - ParasiteDB<br>All Rights Reserved</font></td> </tr> </table> </BODY> </html> [attachment deleted by admin]