Jump to content

ricmetal

Members
  • Posts

    351
  • Joined

  • Last visited

Posts posted by ricmetal

  1. hi, yeah

    i'm running an if statement to include a php script, depending on if $_SERVER['REQUEST_METHOD'] equals POST. this included php script needs the config variables i was talking about, include at the top of the page. and this if statement is called after these config vars are included.

     

    the included php script which is included due to the server request method being post needs the config variables, yet it appears it doesn't find them, like they don't exist yet. also, if i run a print in this included php script, and another in the config vars php file included at the top of the page, the print that appears first is the included php script from the server method request if statement.

     

    something like

    include 'config.php'; // holds variables and the print statement // outputs 'config vars here'
    if($SERVER['REQUEST_METHOD' == 'POST']) { include 'anotherPHPscript.php'; } // holds a print  that outputs 'server request method queried<br>'
    

    my webpage has a form submit button that submits to the same webpage.

     

    the output of the above, on submit is:

    server request method queried
    config vars here
    

     

    so this should not be happening you say?

    regards

  2. interessting the fact that the POST var in REQUEST_METHOD is called before any other variable on a script, no matter where these are placed.

    is this true? am i doing something wrong here?

     

    im inluding a few config variables on the very top of my webpage and calling an if statement to check in a POST request has been made way after these config variable are set. yet, the REQUEST_METHOD POST if statement check (which needs some of these config variables to run successfully) fails.

     

    could someone please point me to reading material on this 'read' order?

    thanks

  3. hi

     

    i am calling some text from a database with php and echoing it to flash. i have no idea the charset anything is in. all i can see is that calling the text from the database and placing into flash yields in some missing chars, but if echo the called text to the browser, copy it and echo that to flash, all characters appear. now, i kow this is not a flash forum, and im not going to ask for a flash solution because there's just too many different charsets and code i cannot control/ nor see so i was thinking of doing something along the line of having php creating a clone of the copied text that appears in the browser, and having it echo that text to flash. it there something php can do, similar to what i described?

     

    regards

  4. i hit a wtf moments

    print $_POST['idName']; // prints 0, correct, the value of the selected select element item is indeed 0
    print '<br>';
    $value = intval($_POST['idName']); // otherwise its a string
    if($value == 'empty') { print '<br>wtf does this get printed?'; }
    

     

    the $values value is the number zero, not the string 'empty', so why does it eval as one?

     

     

  5. yeah, i had to do something like that, because depending on the amount of where clauses i needed to set the same amount of variables for the fetched information to be stored in.

    im using MySQLi. i don't remember how MySQL worked in order to fetch the data from the query into the variables, but..anyway,

    unless there's some other way to get the data fetched into the variables (in MySQLi) using a dynamic WHERE if query then i guess manually is the way to go.

    regards

  6. i have a few html select elements. they all have items like cat, dog, bear (categorized by type: animals, car brands, etc) and one item 'all'. when the user selects a specific item from a select, like dog, i need to retrieve the dogs, but if the user selects the all item (to include dogs, cats, bears), i need to retrieve all animals.

  7. okay, i think i found the problem :/

    i am working on a website on the same domain where i have another website. and that other website is using and setting variables to the session global variables. and also i am using the same 'user' session variable name in both websites. dang, i did not know about this.

     

    regarding the error reporting, i have set both directives to display the errors. they have not yielded errors, and maybe they should'nt, but where would i see these errors being displayed? on the website or are they logged on the server somewhere?

     

    and finally, in the end what are the global associative array members the manual talks about?

     

     

     

     

  8. hi guys.

    i am trying to set a variable to the session global variable. I've initialized the session with session_start();  at the very beginning of my website, and then i try finding if a session variable has been set like so

    if(isset($_SESSION['user'])) { print 'user is logged in'; }

    but this works in reverse.  i have not set any session variables, but asking if it is set, results in an affirmative answer.

     

    so i am thinking this is because of register_globals. because i went to read about register_globals, and it says that if register_globals is turned off, i cannot use any other varibale except members of the session array. i dont know what that is yet, but a question before: in the php manual it says register_globals is deprecated, and it appears i need to enable it to set other variables as session variables besides it's associative array. if this is true, how to enable register_globals and allow other variables to be used as session variables?

  9. hi all.

    how can i do something like

    SELECT * FROM table WHERE column_1 = if(the value to use is 'a', use 'a' as the search value, else if the value is 'z', then select all the rows; select rows that have a,b,c..z)?

    (this is MySQLi)regards

  10. @litebearer

    i designed the database using separate columns because i thought the data would be easier to fetch, in case i wanted to select these date columns'data. as to the invalid date columns, sometimes i insert a row with data regarding an event, and not always do i know when the event is going to exactly happen so i need to let the zeros be accepted.

     

    im not sure how you are formatting your dates. in the USA you place the month in a different location than in other countries, so.

    anyway, im not sure, but according to my current query, rows are being selected be year first, then month, then day.

     

    @PFM

    thanks, i will have to look into that and see if that works.thanks

  11. what appears on my website is not the data i fetch from these three date database columns (the columns are on the database!).

    what i am trying to do is to display (on my website) the data fetched from other columns, and ordered by these three date columns, by descent, with the extra quick where if any of the three date columns is zero, those rows will be fetched first.

     

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