Jump to content

dph1077

Members
  • Posts

    20
  • Joined

  • Last visited

dph1077's Achievements

Apprentice

Apprentice (3/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. For some reason, I've got two different sites hosted w/ TCH, but one I can enter typing 'www' then the name and ther other has to be without the 'www' for it to appear. I'm curious if there is a setting I need to change so I can type the 'www' if I want to or not. Does it make a difference that the domain for the one that I can't use the 'www' in the address was bought at GoDaddy? Thanks, Dave
  2. I would like to thank everyone who has helped! TCH-David, that code in your last post works great too. I think I will use that instead of FTPing. I hope in the future I am able to help out others on the boards as you guys have done for me! Hats off to everyone from TCH!
  3. Ok, after more online research, it works, but "with errors". I'm not sure what this message means. Even though at the end it lists the gibberish file names, it actually puts the file in correctly as it should be named. Go figure. Does anyone know how to remove the warning message? I thought I had changed the permissions, hence the ability to upload the files.
  4. Just a thought, but I added an echo command to print the name of the file on the php page, and its showing the file name as those messed up characters. It seems the problem might then be with the info that is getting passed from the html form to the php page. Here is my html code: <html> <body> For Upload.php <form action="upload.php" method="post" ENCTYPE="multipart/form-data"> File: <input type="file" name="file" size="20"> <input type="submit" value="Upload"> <input type="reset"> </form> </body> </html>
  5. Yes and no. Yes, it is finally putting a file into the images directory, but no, its not the right file. I tried uploading a .txt and .bmp file a few times, and what it put into the images directory was this : phpATSuOc 0 k 644 phpKt8YQr 11 k 644 phpPKnsGp 11 k 644 opening the files shows just a bunch of gobbley-junk characters as one would expect.
  6. It worked, but then again it didn't! lol It didn't work until I removed the singe quotes ' from the '$file' part of the command. It then said that it uploaded it. But when I check the /images/ folder in cPanel, the file that is there is called phpKt8YQr.
  7. Hmmm, still not working. I get this error: EDIT:(HAD WRONG ERROR LISTED Connected to thewebxp.com, for user Warning: ftp_put(): /www/images//tmp/phpiE0vBP: No such file or directory in /home/xxxxxx/public_html/upload.php on line 26 FTP upload has failed! This is what the code looks like now: ><?php $ftp_server = 'thewebxp.com'; $ftpuser = '******'; $ftppass = '******'; $destination_file = "/www/images"; // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftpuser, $ftppass); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user_name"; exit; } else { echo "Connected to $ftp_server, for user $ftp_user_name"; } // upload the file $upload = ftp_put($conn_id, "$destination_file/$file", $file, FTP_BINARY); // check upload status if (!$upload) { echo "FTP upload has failed!"; } else { echo "Uploaded $source_file to $ftp_server as $destination_file"; } // close the FTP stream // ftp_close($conn_id); ?>
  8. Thanks for the help so far. I tried updating the $destination_file to "/www/images" but I still get an error: Connected to thewebxp.com, for user Warning: ftp_put(): /www/images: Not a regular file in /home/xxxxxx/public_html/enfieldmotorsales/upload.php on line 26 FTP upload has failed! The folder "images" does exist in my "www" directory, so I'm not sure what it means by a regular file. Hmmm, I wonder if this might have something to do with it. I moved my HTML and PHP file into the "www" directory, with the "images" folder now above it. Now I get a different error, "Connected to thewebxp.com, for user FTP upload has failed! ". Does this new error shed any light?
  9. Posting this before I go to bed (& wake up in 4 hours! LOL). To make a long story short, I am trying to use an HTML page to take a file name, send it to an PHP page and then use that page to FTP the file to the site. This is the code that I have so far. I hope the experts can easily see the mistakes I'm making. Thanks in advance for any help/advice! HTML PAGE: <html> <body> <form action="upload.php" method="post" enctype="multipart/form-data"> File: <input type="file" name="file" size="20"> <input type="submit" value="Upload"> <input type="reset"> </form> </body> </html> PHP PAGE: <?php $ftp_server = '****'; $ftpuser = '*****'; //username omitted for posting $ftppass = '*****'; //password omitted for posting $destination_file = "/home/xxxxxx/www/images"; // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftpuser, $ftppass); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user_name"; exit; } else { echo "Connected to $ftp_server, for user $ftp_user_name"; } // upload the file $upload = ftp_put($conn_id, $destination_file, '$file', FTP_BINARY); // check upload status if (!$upload) { echo "FTP upload has failed!"; } else { echo "Uploaded $source_file to $ftp_server as $destination_file"; } // close the FTP stream ftp_close($conn_id); ?> And here is a copy of the error I receive: Connected to ****, for user Warning: ftp_put(): /home/xxxxxx/www/images: No such file or directory in /home/xxxxxx/public_html/enfieldmotorsales/upload.php on line 26 FTP upload has failed! Edit TCH-Rob to remove account information.
  10. Outside of a string, the "." is the string concatenation operator (it joins strings together). For example: >echo 'This ' . 'is ' . 'a ' . 'test.'; ...is equivalent to: >echo 'This is a test.'; Inside of a string, the "." is just a plain dot character. Because of the way your original query was written, the "." was a part of the string instead of outside of it, so it was behaving as an ordinary character. <{POST_SNAPBACK}> Thanks for the quick tutorial! It was a much easier subject than I thought.
  11. I knew it would be something easy that I was doing wrong. I had the double & single quotes backwards. As for the periods, I had added them when the first couple of tries didn't work and had seen them on some site (can't remember which one) and was desperate to try anything. I am very new to PHP and am in the process of reading a book at home so I have no clue what the periods do anyway. I will also look into using the modified version that you show to stop attacks. As usual, I am indebted to others for helping me find my way!
  12. The worst thing about asking for help is when you know you are off by just a few characters (my gut feeling anyway). My problem is trying to use an SQL WHERE clause. The background to the situation is this. I've finally got my DB up and running (yay!) and now what I am doing is creating page 'A' that allows a user to put into a form a price (say 50 dollars). After clicking submit, it then goes to the next page and scrubs through the DB to display only the values that are less than the price inputted. It seems to work ok, but the 2nd page doesn't display anything other than my html code. Using other code from a sample page I know the DB is populated with 5 entries, so at least 1 should show up. Here is the SQL statement that is wrong that I am using: >$result = @mysql_query('SELECT * FROM tblproducts WHERE price <= ".$maxprice."'); HMMM, now that I think of it, the database is set up so the price field is a Float (remembering from my C days that was the decimal one). Should it be a different field type? Sorry for the long question... any help is greatly appreciated... as usual!
  13. Owatagal, thanks for your help, it works now. The password is what appears to have been stopping me! Once I took the "areacod_" part off of it, it is working now! Now I'll just have to play with the sql query part after I make the db bigger to learn to pare out the info that I want. Thanks again!
  14. As seen with the code, I have little error traps for each step. I can't even get past the first step, connecting to the database! LOL My guess is the part about the password is tripping me up. I don't think passwords were created when I made this in PHPMyAdmin. The page just shows the error trap message.
×
×
  • Create New...