Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Posts posted by hitman6003

  1. Variables are not persistent between page loads.  In other words, after the page is sent to the browser, all variables are destroyed, losing their value.

     

    You must put the value of "$values" from the first script either in a session variable or in a hidden form field and retrieve it in the second script.

  2. try removing the "silencers" from the file write functions and see if they are giving any errors:

     

    $fp = fopen ($path, 'a+');
    fwrite($fp, $str);
    fclose($fp);
    chmod ($path,0777);

     

    Also, are you viewing the contents of the file in your browser or in a text editor (vi, gedit, wordpad, etc)?

  3. Not sure what you mean...but I'm going to assume that you are doing this:

     

    <input type=hidden name=something value=what you want to pass with spaces>

     

    The solution is to put quotes around your tag attributes (which happens to be the proper way)...

     

    <input type="hidden" name="something" value="what you want to pass with spaces">

     

    If you are already doing this...then post some code, cause you've given us just slightly more than no information to help you.

  4. 		if (!in_array($regstatus, $options)) {
    		$html .= '
    			<option value="' . $regstatus . '" selected="selected">' . $regstatus . '</option>';
    	}

     

    If the value isn't in the array that contains the current values, then it specifically adds that one to the drop down using the above if statement...hence the use of an array...it makes checking to see if it exists easier.

  5. That's because when you call mysql_fetch_array outside of your loop it's retrieving the first row...

     

    $p_result = mysql_query("SELECT * FROM payment WHERE client_number='" . $ro['client_number'] . "'") or die(mysql_error());
    
    $ptotal = 0;
    
    while ($p_ro = mysql_fetch_assoc($p_result)) {
    echo 'Payment on ' . $p_ro['date'] . ' of ' . $p_ro['payment'] . '<br />';
    $ptotal += $p_ro['payment'];
    }
    
    echo 'Total payments: ' . $ptotal;

  6. Force your users to always enter the date in the same format, then use mysql's str_to_date function...

     

    http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_str-to-date

     

    Or, use php's date functions if you choose.  Either way, strtotime is unreliable at best with changing date formats...

     

    Using your format (xx.xx.yyyy) as an example, it can only guess what "1.11.2007" is...November 1st, or January 11th?  Users may not always use the same format by default, so you have to force them to.

  7. If you format your arrays in a more readable manner, it's much easier to see your errors:

     

    if ($PassRateRequestPackageSummary) {
       $request['RateRequestPackageSummary'] = array(
    	'TotalWeight' => array(
    		'Value' => 22.0, 
    		'Units' => 'LB'
    	),
            'TotalInsuredValue' => array(
    		'Amount' => $total, 
    		'Currency' => 'USD'
    	),
            'PieceCount' => $quan  // there was an error here
    );	
    } else {
        $request['PackageCount'] = 1;
        $request['Packages'] = array(
    	0 => array(
    		'Weight' => array(
    			'Value' => 22.0, 
    			'Units' => 'LB'
    		),
                'InsuredValue' => array(
    			'Amount' => $total, 
    			'Currency' => 'USD' // error here as well
    		)
    	)
    );
    }

  8. If your php install has the mysql functions available, then it was compiled with the mysql client library.  This means that the mysql client code is available to it.  All of the php mysql functions relate to a function in the mysql client library.

     

    What this means is that it's not going to the database to do the escaping...it's just calling the client library.

     

    The reason, I think, a connection is required is so that the mysql library knows what encoding to use (some characters may be escaped slightly differently), and possibly so it knows what version of MySQL you are inserting to (although I can't think of a good reason why it would matter).

  9. A notice isn't an error, it's just php letting you know something.  In this case, as is the case with all "undefined indexes" it means that you are trying to access an element in an array that doesn't exist...

     

    $foo = array();
    $foo['bar'] = 'a string';
    
    // No notice generated
    echo $foo['bar'];
    
    // "Undefined index" Notice generated because 'baz' doesn't exist
    echo $foo['baz']
    

  10. Most likely they take the total area of the filter (WxL), along with a modifier for the thickness, and compute the price that way.  So, if the total area is 100 in^2 (10 in x 10 in), with a thickness of 2 inches, and the standard price for a 2 inch thick filter is 25 cents per square inch, the final price would be .25 * 100 = $25.

     

    Although there are a lot of different ways...maybe they have a general price for size ranges.  Maybe they have some fat guy on the other end that sees the request and makes up a number.

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