Jump to content

jmace

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jmace's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the response. I probably should have been more clear-- I knew what request I needed to send, I just didn't know how. I actually figured it out, though, and now it's working.
  2. Well, I've been learning Java and I managed to create an FTP client that uploads and downloads files from a server. Oddly, the thing I can't figure out is how to do an FTP delete. Can anyone help me on that? I don't want to use an API or someone else's class, such as the ever-so-popular ftpClient class. (How would I learn from that?) I've tried looking through some existing API's for hints, but their too complicated for me to figure out. You have to go from function to function in tons of files and I still don't get it. Any help or suggestions would be great! Thanks everyone.
  3. Thanks for the useful posts. There has definitely been some great information shared for me to think about.
  4. Does anyone know anything about selecting text in an editable iframe? The following code kind of works in FireFox (it's a little buggy), but doesn't work at all in anything else. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>ADVANCED EDITOR TEST PAGE</title> <script type="text/javascript"> function framego(){ document.getElementById("frame").contentDocument.designMode = "On"; document.getElementById("frame").contentWindow.document.body.innerHTML = "TEST [here] ING"; } function selectArea(){ o=document.getElementById('frame'); if(o.contentWindow.getSelection) sel = o.contentWindow.getSelection(); //FF else sel = o.contentDocument.selection.createRange(); //IE range2=sel.getRangeAt(0); var range = document.createRange(); range.setStart(sel.anchorNode,5); range.setEnd(sel.anchorNode,11); //remove the old range and add the newly created range sel.removeRange(range2); sel.addRange(range); o.focus(); } </script> </head> <body onload="framego()"> <iframe id="frame"></iframe> <button onclick="selectArea()">TEST</button> </body> </html> It's supposed to select the word "Here" in the iframe. A million thanks to anyone who can point me in the right direction on this one. :-)
  5. Well, I've made some progress, but still I still can't make it work. Here is my code: <?php $key = "MY_KEY_HERE"; set_time_limit(0); // GET THE FEED FILE $options = array( CURLOPT_RETURNTRANSFER => true, // return web page CURLOPT_HEADER => false, // don't return headers CURLOPT_FOLLOWLOCATION => true, // follow redirects CURLOPT_ENCODING => "", // handle all encodings CURLOPT_USERAGENT => "my app", // who am i CURLOPT_AUTOREFERER => true, // set referer on redirect CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect CURLOPT_TIMEOUT => 120, // timeout on response CURLOPT_MAXREDIRS => 10, // stop after 10 redirects CURLOPT_SSL_VERIFYPEER => false, ); $ch = curl_init('https://mysite.com/pull_feed.php'); curl_setopt_array( $ch, $options ); $contents = curl_exec( $ch ); curl_close( $ch ); //----------------------------------------------------// // CREATE THE REQUEST $request = "POST /ws/eBayISAPI.dll?FileExchangeUpload HTTP/1.1\r\n"; $request .= "Connection: Keep-Alive\r\n"; $request .= "User-Agent: My Client App v1.0\r\n"; $request .= "Host: bulksell.ebay.com\r\n"; $request .= "https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeUpload\r\n"; $request .= "Content-type: multipart/form-data;\r\n"; $request .= "boundary=THIS_STRING_SEPARATES\r\n"; $request .= "Content-Length: ".strlen($contents)."\r\n"; $request .= "--THIS_STRING_SEPARATES\r\n"; $request .= "Content-Disposition: form-data; name=\"token\" \r\n"; $request .= $key."\r\n"; $request .= "--THIS_STRING_SEPARATES\r\n"; $request .= "Content-Disposition: form-data; name=\"file\";\r\n"; $request .= "filename=\"listings.csv\"\r\n"; $request .= "Content-Type: text/csv\r\n"; $request .= $contents."\r\n"; $request .= "--THIS_STRING_SEPARATES\r\n"; //OPEN THE CONNECTION $conn = fsockopen('ssl://bulksell.ebay.com', 443); // SEND THE REQUEST fputs($conn, $request); // GET THE RESULT while(!feof($conn)) { echo fgets($conn, 128); } // CLOSE CONNECTION fclose($conn); ?> Here is the the request being sent: POST /ws/eBayISAPI.dll?FileExchangeUpload HTTP/1.1 Connection: Keep-Alive User-Agent: My Client App v1.0 Host: bulksell.ebay.com https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeUpload Content-type: multipart/form-data; boundary=THIS_STRING_SEPARATES Content-Length: 4102 --THIS_STRING_SEPARATES Content-Disposition: form-data; name="token" MY_KEY_HERE --THIS_STRING_SEPARATES Content-Disposition: form-data; name="file"; filename="listings.csv" Content-Type: text/csv . . . THE FILE CONTENTS ARE HERE . . . --THIS_STRING_SEPARATES The script take a long time to run, and then it finally gives me the following response from ebay: ANY help would be appreciated. I'm really having a hard time with this one. Thanks, jmace
  6. Based on your comments and some more poking around on the internet, I changed code to this: <?php // GET THE FEED FILE $options = array( CURLOPT_RETURNTRANSFER => true, // return web page CURLOPT_HEADER => false, // don't return headers CURLOPT_FOLLOWLOCATION => true, // follow redirects CURLOPT_ENCODING => "", // handle all encodings CURLOPT_USERAGENT => "website", // who am i CURLOPT_AUTOREFERER => true, // set referer on redirect CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect CURLOPT_TIMEOUT => 120, // timeout on response CURLOPT_MAXREDIRS => 10, // stop after 10 redirects CURLOPT_SSL_VERIFYPEER => false, ); $ch = curl_init('https://www.mysite.com/pull_feed.php'); curl_setopt_array( $ch, $options ); $contents = curl_exec( $ch ); curl_close( $ch ); //----------------------------------------------------// //OPEN THE CONNECTION $conn = fsockopen('ssl://bulksell.ebay.com', 443); // START THE REQUEST fputs($conn, "POST ".$_SERVER['PHP_SELF']." HTTP/1.0\r\n"); fputs($conn, "Connection: Keep-Alive\r\n"); fputs($conn, "User-Agent: My Client App v1.0\r\n"); fputs($conn, "Host:\r\n"); fputs($conn, "https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeUpload\r\n"); fputs($conn, "Content-type: multipart/form-data;\r\n"); fputs($conn, "boundary=THIS_STRING_SEPARATES\r\n"); fputs($conn, "Content-Length: ".strlen($contents)."\r\n"); fputs($conn, "--THIS_STRING_SEPARATES\r\n"); fputs($conn, "Content-Disposition: form-data; name=\"token\"\r\n"); fputs($conn, "MY_SECRET_TOKEN\r\n"); fputs($conn, "--THIS_STRING_SEPARATES\r\n"); fputs($conn, "Content-Disposition: form-data; name=\"file\";\r\n"); fputs($conn, "filename=\"listings.csv\"\r\n"); fputs($conn, "Content-Type: text/csv\r\n\r\n"); // SEND THE FILE fputs($conn, $contents."\r\n"); // END THE REQUEST fputs($conn, "--THIS_STRING_SEPARATES\r\n"); // GET THE RESULT while(!feof($conn)) { echo fgets($conn, 128); } // CLOSE CONNECTION fclose($conn); ?> Which is working a lot better, but now the response I get back is this: I am guessing it is because I am on the wrong page (ie bulksell.ebay.com instead of https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeProgrammaticDownload) What should I do now?
  7. @Thorpe: Thanks for your reply. If my server can't use https, what alternative is there? Or what should I do? @Requinix: Thanks for the insights and the tips. Where do you suggest I go to learn about all of this? I am on a time crunch and need to get this done as quick as I can, so a suggestion on what tutorials are best would be very helpful. Thank you both again.
  8. I am trying to post a feed file to ebay from our site via a PHP script, but I am new to this stuff. I found some instructions here: http://pics.ebaystatic.com/aw/pics/pdf/us/file_exchange/File_Exchange_Advanced_Instructions.pdf The most important part of that PDF is: I tried to implement it using this code: <?php // GET THE FEED FILE $options = array( CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false, CURLOPT_FOLLOWLOCATION => true, CURLOPT_ENCODING => "", CURLOPT_USERAGENT => "website", CURLOPT_AUTOREFERER => true, CURLOPT_CONNECTTIMEOUT => 120, CURLOPT_TIMEOUT => 120, CURLOPT_MAXREDIRS => 10, CURLOPT_SSL_VERIFYPEER => false, ); $ch = curl_init('https://www.mysite.com/pull_feed.php'); curl_setopt_array( $ch, $options ); $contents = curl_exec( $ch ); curl_close( $ch ); //----------------------------------------------------// //OPEN THE CONNECTION $conn = fsockopen('https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeProgrammaticDownload', 80); // START THE REQUEST fputs($conn, "POST ".$_SERVER['PATH_INFO']." HTTP/1.0"); fputs($conn, "Connection: Keep-Alive"); fputs($conn, "User-Agent: My Client App v1.0"); fputs($conn, "Host:"); fputs($conn, "https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeUpload"); fputs($conn, "Content-type: multipart/form-data;"); fputs($conn, "boundary=THIS_STRING_SEPARATES"); fputs($conn, "Content-Length: ".strlen($contents)); fputs($conn, "--THIS_STRING_SEPARATES"); fputs($conn, "Content-Disposition: form-data; name=\"token\""); fputs($conn, "MY_KEY_IS_HERE_000000000000000000000000"); fputs($conn, "--THIS_STRING_SEPARATES"); fputs($conn, "Content-Disposition: form-data; name=\"file\";"); fputs($conn, "filename=\"listings.csv\""); fputs($conn, "Content-Type: text/csv"); // SEND THE FILE fputs($conn, $contents); // END THE REQUEST fputs($conn, "--THIS_STRING_SEPARATES"); // GET THE RESULT while(!feof($conn)) { echo fgets($conn, 128); } // CLOSE CONNECTION fclose($conn); ?> UPDATE: I accidently had error reporting off. Whoops. It is giving me this error: Followed by more errors resulting from that one.
  9. Thanks you so much for the example! That works perfectly. I owe you one.
  10. You might try the date() function along with the mktime() function. Something like this: echo date("D", mktime(0, 0, 0, date('m'), date('d')+7, date('Y'))); //show next weeks day I would first figure out what day today is, then how many more day's till thursday, then start displaying the answer with code like the above. Sorry I don't have time to post more, but later if you still need help let me know.
  11. I was wonder how I can use preg_replace() to change a string like this: Into a string like this: In other words, because the word "Sponge" is in the string twice, and "Applicator" is in the string twice (except that the first ends in an s) they would be gone. I've tried stuff like: $title = preg_replace('/(?:\W|^)(\w*?)(?:\W.*?)(?=\1)/',"",$title); But it's way off and gives me: Any help would be great!
  12. So, I finally figured out how to make my java JAR file double click to open, which is exciting to a new Java programmer like myself. But I have a question about it. The program is meant to run in the cmd prompt. It does not require any user input, but it does display the results of the program. The problem is that, when I double click the program, it runs but the cmd prompt does not open, so I cannot see the results. Is there a way I can double click to start it AND have the cmd show up? Hopefully that question made sense. Thanks, jmace
  13. First of all, I'm not really sure where to post this question, so sorry if this is not the right place, but I assume this will do alright. I'm currently designing a website that will allow teachers to do things like share files with their students, post on forums, chat, etc. I am not too worried about coding this project, but I am concerned about the software and hardware that will be needed to host such a website. At work, the web host that we use for our small business site is slow, and one large process (like a SELECT * FROM table from a large MySQL table, followed by processing) seems to stop it from serving up other pages. I suspect that the problems with a file sharing website would be even more severe. Does anyone have any ideas on what I would need (ie what web hosting service I could use), and how much it might cost? Also, what tips do you have on how I can code this so that it runs the fastest? Thank you guys!
  14. You had a slight typo in your REGEXP, but yes, you were right. Solution: "/ '(.*?)' Merchant value: '(.*?)' catalog value: '(.*?)'(?= |\.)/i" That really helped me out a ton. Thank you so much for all of your help. I will have to study up more on this stuff.
  15. Has anyone done any work with Amazon's MWS? I've submitted a tab delimited text file using PHP MWS, it's processed, and now I want to pull the processing reports to save the error messages in a local database for viewing later. But I don't know how exactly I am suppose to do that. Does anyone have any experience with this? Any ideas or points in the right direction would be great. Thanks, Jmace
×
×
  • 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.