Jump to content

kireol

Members
  • Posts

    43
  • Joined

  • Last visited

    Never

Everything posted by kireol

  1. nm, working now. too tired to compare and see why. bed time
  2. I did a bit more testing and still stuck. here's some more results. If i change to stdout on the cookie file curl_setopt($ch, CURLOPT_COOKIEJAR, '-'); it DOES print out a cookie to the screen. This cookie, however, is not saving to the cookie file. If I copy and paste that cookie info, into the cookie file, then re-run the script, php clears out my cookie file back to null. arggggggg!
  3. So I have a script that I wrote 2 years ago that uses cookies just fine with cURL. I started writing a new script, so I copied and started editing the new script. Now, the old file works with cookies and the new one doesnt. I stripped the new file down to basics and found a simple site that uses cookies. I verified with firefox that the site does produce cookies. but they are not saved in the cookie file this generates. Please help me figure out why. <?php function getpage($url) { $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"; $ch = curl_init(); $cookies = "cookies/cookiejar.txt"; // Please set your Cookie File path if ($cookies != '') { if (substr(PHP_OS, 0, 3) == 'WIN') {$cookies = str_replace('\\','/', getcwd().'/'.$cookies);} $fp = fopen("$cookies","w") or die("<BR><B>Unable to open cookie file $cookies for write!<BR>"); fclose($fp); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies); } else { echo "COOKIES NEED TO BE SET UP\n";exit; } curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $result = curl_exec ($ch); return($result); } $result = getpage("http://www.echoecho.com/samplecookie2.htm"); ?>
  4. I dont have access to a computer right now that runs PHP. I'm at a loss. maybe someone else can chime in?
  5. ok, hrmm. next try echoing echo "$_FILES['uploaded_file']['tmp_name']"; and make sure that that 1)that variable has the correct data and 2)the data that the variable is referencing exists as a file in the correct directory. I'm at work, so I can't run scripts, just using the compiler in my mind
  6. hrmmm. something to check on, but the directory slashes are / and \ i'm not sure how windows handles that.
  7. what I would do is like I already said. Look at the text and figure out which type was input. then adjust my SQL accordingly. MYSQL calls are costly in time. Doing it this way also allows you to do 2 things: 1)echo to your result page let the user know what type that was detected. 2) validate that what they did enter is in the correct format that you expect tracking number 1Z7301170232081682 pro number: 000695918 / 2007-05-12 23:18:43.147712 if(strstr($search_value, "/") { //user entered a pro number. make SQL search on PRO number } else { //user entred a tracking number. make SQL search on tracking number }
  8. what does a PRO number look like and what does a tracking number look like? If it were me, I would write in the PHP code to doa check to see if what the user entered was a PRO or tracking number then mod my sql to look for that particular one
  9. Post the error and the create statement
  10. list($year, $month, $day) = split("-", $row[announcement_date]; echo "$day-$month-$year";
  11. optimizing the DB should have been done before he wrote the code, but that doesnt help you
  12. did they use a web builder? You can look at the HTML, and not see any generated patterns of code or comments, so most likely, no. They still could have, or just as easily used wordpad, vi, or another text editor.
  13. well then I dont understand your question. I'm getting that you dont know how to code the indent section for the "comments", and that would be HTML/tables. the php part would handle how much the colspan would use
  14. hrmmm. well, i have to drive from detroit to atlanta this weekend. now I have something to do! hahha
  15. instead of retyping what an index is and how to use it, i googled it for you http://www.databasejournal.com/features/mysql/article.php/1382791
  16. There are systems already done that do this. try googling "php slashdot style comments". but what you are looking for is HTML <table> alignment.
  17. mysql with index is fastest for searching for strings through large amounts of data. if no index, it can be slow. moving as much as you can to mysql, will also be faster than php, as php is interpreted.
  18. Ya, I noticed the same in FF. So, do you think to do that page correctly, I would have to walk through the HTML/js that I'm getting, recreate all of that code/logic in PHP, and in theory it sure give me a URL to the final page? heh, doesnt sound worth it anymore. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); does that anyway. not sure why this web site is different. oh well. thanks though
  19. it's showing http://eppraisal.com/PropertyInfo.aspx So do you think it's doing some sort of redirect? This may sound stupid, but usually when a web site does a redirect, I hear the browser make the "click" noise.
  20. stupid question, but do you have any code above the snipet that you are posting?
  21. file_get_contents is doing the same as the cURL :-\
  22. Thanks for the help so far. Yes, I'm using the same agent. In my actual IE browser, once the page is loaded, I can View|source.There will be a line <td align="center"><span id="ctl00_ContentPlaceHolder1_MiddleValueRange" class="ValueRange">$288,725</span></td> If I run my cURL code and spit it out to a text file or to a browser, that line doesnt exist. None of the info for the house exists. the values, the # of bedrooms, square footage, etc. it's completely different. but the header (first 53 lines of HTML) is the same.
  23. the above is nice. here's an alternative which would also catch a password of "theadmin" or "1admin" <?php $username="admin"; $password="admin123"; $cheek=substr($admin,0,3); if(strstr($password,$cheek) { echo "Sorry the username and password have the same first three letters"; }else{ echo "Username and password are valid as the first three letters dont match"; } ?>
×
×
  • 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.