Jump to content


  • Posts

  • Joined

  • Last visited


Profile Information

  • Gender
    Not Telling

cunoodle2's Achievements


Member (2/5)



  1. step 1 is to share your code. Without it we are of zero help to you
  2. Line 17.. check there. Likely that is where your coding issue is.
  3. The issue appears to be on line 17 of your code. Try looking there and let me know what you come up with.
  4. I'm not going to download any attachments. Please place your code (and just the area that you think is in issue) in the BODY of the message (NOT as attachments). I'll take a look and let you know what the issue is.
  5. I think what the op is looking for is a way to physically execute and set up a cron job from a php file itself as apposed to manually having to set one up. stelthius can you please clarify your question for us?
  6. Am I the only one on here that noticed that June is the 6th month and not the 5th?? "June 30th 2009 (5/30/09)"
  7. If you don't mine please post your code in hopes that someone in the future would be able to learn form it. Make sure you block out all usernames/passwords and important information. It took me forever to figure out that curl stuff to log into my bank as I wrote it all "from scratch." Hopefully my code helped you and your code will help the next person. =)
  8. Here you go... //function is used to validate the number on a credit card //$ccnum is the number of the credit card as passed in //$type is the type of the card (Visa, Mastercard, Discover, Amex) function validateCC($ccnum, $type = 'unknown'){ //this code removes dashes and spaces $type = strtolower($type); $ccnum = ereg_replace('[-[:space:]]', '',$ccnum); //Do type specific checks if ($type == 'unknown') { //Skip type specific checks } elseif ($type == 'mastercard'){ if (strlen($ccnum) != 16 || !ereg('^5[1-5]', $ccnum)) return 0; } elseif ($type == 'visa'){ if ((strlen($ccnum) != 13 && strlen($ccnum) != 16) || substr($ccnum, 0, 1) != '4') return 0; } elseif ($type == 'amex'){ if (strlen($ccnum) != 15 || !ereg('^3[47]', $ccnum)) return a; } elseif ($type == 'discover'){ if (strlen($ccnum) != 16 || substr($ccnum, 0, 4) != '6011') return 0; } else { //invalid type entered return -1; } // Start MOD 10 checks $dig = toCharArray($ccnum); $numdig = sizeof ($dig); $j = 0; for ($i=($numdig-2); $i>=0; $i-=2){ $dbl[$j] = $dig[$i] * 2; $j++; } $dblsz = sizeof($dbl); $validate =0; for ($i=0;$i<$dblsz;$i++){ $add = toCharArray($dbl[$i]); for ($j=0;$j<sizeof($add);$j++){ $validate += $add[$j]; } $add = ''; } for ($i=($numdig-1); $i>=0; $i-=2){ $validate += $dig[$i]; } if (substr($validate, -1, 1) == '0') return 1; else return 0; }
  9. I wrote a script that logged into my chase bank website and it would grab information on my IRA. Then store the value in a database so that I could track it easier. Here is all the code with the obvious usernames and such blocked out... <?php ######### Set up field values ######### $fields = "authmethod=userpassword&"; $fields .= "locale=en_us&"; $fields .= "usr_name=bobby&"; $fields .= "usr_password=3456&"; $fields .= "hiddenuri=/online/logon/on_successful_logon.jsp?LOB=COLLogon&"; $fields .= "LOB=COLLogon"; $agent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"; $ref = "https://chaseonline.chase.com/colappmgr/colportal/prospect?_nfpb=true&_pageLabel=page_logonform"; ######### Prepare curl settings and variables ######### $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "https://chaseonline.chase.com/siteminderagent/forms/formpost.fcc"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt'); curl_setopt($ch, CURLOPT_MAXREDIRS, 4); curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_TIMEOUT, 120); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_REFERER, $ref); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); $buffer = curl_exech($ch); curl_close($ch); ######### Search html code for the needed string ######### //find the location of the market value $temp = "Market Value</td><td class="; $response_start = strPos($buffer, $temp); $response_mid = strPos($buffer, "$", $response_start); $response_end = strPos($buffer, " </td><td", $response_mid); $temp_code = substr($buffer, $response_mid + 1, ($response_end - $response_mid - 1)); $temp_code = ereg_replace (",", "", $temp_code); ######### minor error checking and database insert ######### //check to make sure that some long error or other bad data was not returned if (strlen($temp_code) < 15) { ######## Insert Values into database ######## //this connects to the server using the user name and password $db = mysql_connect("localhost","user","password") or die("Could not connect!"); //this then selects the database mysql_select_db($db = "ira_daderbase") or die ("Could not select database"); $now = mktime(); $today = mktime(0,0,0); $sql = "SELECT * FROM `retirement` WHERE `time` > '".$today."';"; $result = mysql_query($sql); //this is done to make sure that there is only 1 insert per day if (mysql_num_rows($result) == 0) { $sql = "INSERT INTO `retirement` ( `id` , `time` , `amount` )"; $sql .= "VALUES ('', '".$now."', '".$temp_code."');"; mysql_query($sql); } } ?> Hope that example helps you out
  10. '$keywords'" Shouldn't it be.. '$keywords')"
  11. Well every while statement MUST end with a "}" I guess you could use if statements to include a series of different files and have each one appended to the end of a previous while statement. It's worth a shot. Could NOT be WITHIN a function. would simply just have to be an included file.
  12. I did a search on google and came up with this... http://programsdb.com/script/742/15192/MySQL_database_backup.html
  13. Create a page that has the text you want on it. Then on that same page "Call" this 'random' pic you are reffering to.
  14. cunoodle2

    MySQL Help

    Please copy and paste the 1st 5 lines of BOTH php files into here. 1. The first 5 lines of "Config.php" 2. The first 5 lines of the php page that CALLS the Config.php page
  • 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.