Jump to content

beegro

Members
  • Posts

    69
  • Joined

  • Last visited

    Never

Posts posted by beegro

  1. The function ini_set() is an "on the fly" modification to the php.ini file.  The php.ini file is the PHP configuration file which controls how PHP will operate, manage memory, allow/disallow functionality, etc.  So, by calling ini_set("display_errors", "1") you are overriding the php.ini setting of "display_errors" to now equal the value "1" for the duration of this script's execution. 

  2. You can just import the file and then parse it.  I suggest using XML because it's human and machine readable.  So if you have an XML file with the numbers you can do the following:

     

    $filename = "/some/file/location/file.xml";
    $contents = file_get_contents($filename);
    $results = SimpleXML($contents);
    // take a look at your data
    print_r($results);

  3. The easiest way is probably to add a parameter to the javascript function call with identifying information. 

     

    i.e.

    $javacode = "javascript:popup_show('popup', 'popup_drag', 'popup_exit', 'screen-top-left', 1200,  20, $player1)";

     

    Then you'll have to adjust the javascript function to use that new parameter

  4. From what I see there is a 'getKey' operation which uses a 'getKeyRequest' input message.  The 'getKeyRequest' message has the format of:

     

    <user>

    <password>

     

    So, your request would look something like.

     

    $params = array('user' => 'my_username', 
                    'password' => 'my_password');
    $client = new SoapClient('http://www.maxbounty.com/api/api.cfc?wsdl');
    $result = $client->__soapCall('getKey',$params);

     

    $result will then be of type 'getKeyResponse' which will look like an array

     

    $result['getKeyReturn']

     

    The function print_r() is definitely your friend when working with SOAP and so are try catch blocks.  :)

  5. In terms of security you're doing 2 less-than-secure things here. 

    [*]storing a users password in plain text in the database

    [*]storing the users password in the session

     

    Is there a reason you'd need the password again later in the session and not just for comparison at login?  Also, if someone, including other developers, get into the database and can see all the users individual passwords then their accounts are compromised.  It's simply bad practice to store passwords in plain text.

  6. I'm surprised that Dreamweaver gave you problems.  I used it for years without issue.  Guess I'll have to look more closely at the link Pikachu2000 sent regarding UTF encoding.  That being said, I have moved on to NetBeans as my editor of choice because of its ability to expose and navigate through OO code as well as snap into source control tools like CVS, SVN and Git.

  7. There are a few lines of code that can echo stuff out to the browser:

     

    echo "<p class='Body-error-P'><span class='Body-text-T'>You forgot to enter your username.</span></p>";

     

    and

     

    echo "<p class='Body-error2-P'><span class='Body-text-T'>You forgot to enter your password.</span></p>";

     

    assuming they aren't actually being executed because you properly passed _POST['username'] and _POST['pass'], is there any other place that sends session, cookie, header or output information to the browsers?  The error message is saying something else was outputted to the browser already and cookies have to be first.  Make sure that your opening php tag "<?php" is on the first line of the script too.

  8. Great.  That means the cookies are being set properly or you should get error messages.  As a matter of fact, you should be able to see your cookies in Firefox by right clicking somewhere on the page and selecting "View Page Info" from the menu.  Then click the "Security" menu option on the top folowed by the "View Cookies" button.  This will show you the cookies that are available to scripts on the site.  You should see your domain on the left and "firstname" and "lastname" on the right.  Click on those elements and you can see all the information about the cookie. 

     

    Can you see your cookies in Firefox?

  9. Databases can be configured not to allow certain values and types as well as to require certain values to be of specific sizes, uniqueness, ... well, almost any sort of requirement you can think of a database table can have on its values.  I think if there's an issue where sometimes people can submit data and it gets stored and other times it does not then we're looking at a problem with the data.  It would be very beneficial to turn on error reporting by putting this at the top of your handling script for some testing to see if you get a message back from MySQL about possible errors with the query when different values are passed through it.  This will also let you know if you're having undefined value assignments etc. so only use this for testing. 

     

    error_reporting(E_ALL);
    ini_set("display_errors', 1); 

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