Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Posts posted by phppup

  1. I have a page that will sort my DB table by name and telephone number.  And it has a button.  I want visitors to be able to input a last name, and have the telephone number provided in a SEPERATE and NEW window after they click the button.


    Any suggestions for best procedure?


    My two initial concepts are:

    1- Make this a form, with the "action" leading to a file like

    SELECT *FROM myTable WHERE last name="$inputname"

    and have then use Javascript ONSUBMIT to open a NEW window.

    (not sure it will succeed as I desire)


    2- Make this a simple BUTTON with Javascript pointing everything to the file to process the quiery.


    PS: I've heard IE doesn't always handle "_BLANK" properly, and I'm unaware of a PHP method.


    Haven't thought it through entirely, so I'm looking for pointers and advise.





  2. I have a form that was written and works well as an HTML file.  Now I've learned a little (tip of the iceberg, i'm sure) and want to place password protection BEFORE it.  To the best of my knowledge, this will require SESSIONS and turning my form into a PHP file.  (I assume LOTS of reading is ahead of me... LOL)


    Can I simply change the extension to a PHP, add the <? tags > and just keep the HTML in place?

    Or do I need to make it PHP and ECHO every line of code?

    Or is there another way?


    And while on the subject, does a PHP file require anything before publishing, the way an HTML requires the

    <!DOCTYPE> information?

  3. I got to thinking late last night (which generally leads to trouble), so please be gentle if some educating is in order, as I suppose I will touch a few related issues.


    As I develop my database, I will include two seperate columns.  One for the time/date that an order was placed.

    A second for the time/date that an order is updated (unless there's a better way, please inform me).


    I pressume that if a record is updated several times, it will continually overwrite the time/date to the point that I will only see the latest update.  Now I was wondering if I could create a third column to keep count of the number of times a record had been updated, so if it were altered 16 times, I would know when the last update occurred, and have the count number also.


    Will something like this coding work?


    SELECT updates FROM myTable WHERE id="$id"

    $updates =n

    if n<1, n=1

    }else{ n++


  4. Well, i plugged in a TIME charachter that's NEW to 5.1 and it did NOT work.  The one for 4.1 did okay though, so, being as I'm too lazy to check the server info, I'm gonna say it's 4.1


    Meanwhile, I know the server and DB is on California time. 


    Gosh, I'll have to dig up the code I once wrote that simply added 3 hours to the time (unless someone has it handy).  If I remember correctly, I had to add it in a multiple of seconds or minutes (like 3 x 60x 60).  Oh well, I have BIGGER issues with the damn database... LOL.

  5. I see what mikosiko is saying.

    Your DATE is being GIVEN on the same page.  So date and ID (which I assume is automated by the table) are sort of a guarantee.  If you're putting data in for the other fields from a form, you need to MATCH the 'name' in the form with the 'name' in this script so that it can be put into the table (make sense).

    Backtrack your steps, and make sure the form ACTION is naming THIS FILE with EXTENSION.

  6. I recognize the code (i was on that website TOO).

    And what I got needed to be tinkered with before it would work.  Try re-reading the webpages before it to make sure any files or code that was used in a tutorial PRIOR to this one, are written properly and in your pocession.


    Check to make sure all the file names and field names follow the same structure.  Good luck!

  7. I'm stillnot exactly sure that I understand EXACTLY what that first line is COMMANDING.

    (as a newbie, some code just ends up in my script because a resource SAID it SHOULD be there, and NOT because i FULLY understand WHY i would WANT it there)

  8. Never used AJAX (except in the sink!)


    It's not THAT important, was just thinking out loud.


    There's probably something burried in my Javascripting that'd do it too, but I'm trying to learn/experiment with PHP and database usage.

  9. OK, so I thought it was as simple as just slapping it in there and having it echo the time on my page.


    So I tried:


    $date = date('Y-m-d H:m');

    echo "It is now $date";


    and got the same error as above: Fatal error: Call to undefined function: date_default_timezone_set()


    but when I took out the top line: date_default_timezone_set('America/New_York');

    I got a time posting, but it is Californian.


    I suppose there are two different things I have in mind.  Fist, just to have the time display as an ECHO message.

    Second, if I can get it to run, I would add it to my table so I could get the NYtime that a record was added.


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