Jump to content

ryanfilard

Members
  • Posts

    252
  • Joined

  • Last visited

Posts posted by ryanfilard

  1. Here is my code, it is not working.

    	 
    <?PHP 
    
    function USPSParcelRate($weight,$dest_zip) {
    
    $userName = '696RYANW7228';
    $orig_zip = '11705'; 
    
    
    $url = "http://Production.ShippingAPIs.com/ShippingAPI.dll";
    $ch = curl_init();
    
    
    curl_setopt($ch, CURLOPT_URL,$url);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
    
    
    curl_setopt($ch, CURLOPT_POST, 1);
    
    $data = "API=RateV3&XML=<RateV3Request USERID=\"$userName\"><Package ID=\"1ST\"><Service>PRIORITY</Service><ZipOrigination>$orig_zip</ZipOrigination><ZipDestination>$dest_zip</ZipDestination><Pounds>$weight</Pounds><Ounces>0</Ounces><Size>REGULAR</Size><Machinable>TRUE</Machinable></Package></RateV3Request>";
    
    // send the POST values to USPS
    curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
    
    $result=curl_exec ($ch);
    $data = strstr($result, '<?');
    // echo '<!-- '. $data. ' -->'; // Uncomment to show XML in comments
    $xml_parser = xml_parser_create();
    xml_parse_into_struct($xml_parser, $data, $vals, $index);
    xml_parser_free($xml_parser);
    $params = array();
    $level = array();
    foreach ($vals as $xml_elem) {
    if ($xml_elem['type'] == 'open') {
    	if (array_key_exists('attributes',$xml_elem)) {
    		list($level[$xml_elem['level']],$extra) = array_values($xml_elem['attributes']);
    	} else {
    	$level[$xml_elem['level']] = $xml_elem['tag'];
    	}
    }
    if ($xml_elem['type'] == 'complete') {
    $start_level = 1;
    $php_stmt = '$params';
    while($start_level < $xml_elem['level']) {
    	$php_stmt .= '[$level['.$start_level.']]';
    	$start_level++;
    }
    $php_stmt .= '[$xml_elem[\'tag\']] = $xml_elem[\'value\'];';
    eval($php_stmt);
    }
    }
    curl_close($ch);
    // echo '<pre>'; print_r($params); echo'</pre>'; // Uncomment to see xml tags
    return $params['RATEV3RESPONSE']['1ST']['1']['RATE'];
    }
    
    echo USPSParcelRate(10,11705);
    
    ?>
    

     

  2. I need help with my website www.celbre.com. It is a website for people/small businesses to give their customers updates. If you helped code you would receive a percentage of the profits.

     

    PHP/HTML Programmer [1] - 20% of profits

    PHP Debugger [1] - 20% of profits

    Graphics [1] - 20% of profits

     

    PHP Programer:

     

    Needs to be able to search the profiles on the database and if the user does not want to be in search results block it.

    Block HTML tags in text boxes.

     

    PHP Debugger:

     

    Check over the php programmer's script and make sure it works properly.

     

    Graphics:

     

    Simple graphics are needed.

     

     

    Please email me what you can do ryanweekly@gmail.com

     

    P.S. I am not the best programmer.

  3. This is my code:

    $req = $_GET['s'];
    $as = "SELECT users.username, users.fname, users.lname, users.tags FROM users.users WHERE ";
    $terms = explode(" ", $req);
    
    foreach($terms as $smart){
    $a++;
    
    if ($a == 1)
    $as .= "users.tags = '$req' ";
    
    else
    
    $as .= "OR users.tags LIKE '$req' ";
    
    }
    
    
    mysql_select_db($database_Users, $Users);
    $query_Recordset1 = "SELECT username, fname, lname, tags FROM users";
    $Recordset1 = mysql_query($smart, $Users) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($smart);
    $totalRows_Recordset1 = mysql_num_rows($smart);
    

     

    This is What I Get:

     

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'nah' at line 1

     

    URL:

     

    http://www.celbre.com/search.php?s=nah&button=Search

     

  4. <?PHP 
    //Data to write
    $newsletterinfo = '_a';
    $newsletterinfo = $_REQUEST['email'];
    //Open the file directory
    $fdir = fopen('created/1.txt', 'a');
    //Write The Data
    fwrite($fdir, $newsletterinfo );
    //Close the connection
    fclose($fdir);
    ?>

×
×
  • 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.