Results 1 to 11 of 11
  1. #1
    RIP
    klongmaster's Avatar
    Join Date
    Jul 2005
    Last Online
    @
    Location
    Nonthaburi
    Posts
    4,382

    php. complexities: HELP

    okay..first off please don't tell me I'm stupid...this is new to an old fella like me...but here goes...

    I want to make a booking page for my website and I've got as far as the first page but it won't connect when I press "submit"...I have the second page behind to check that they have filled in the required info but it won't like the two together...

    the pages are here and ***for the php file...nope can't load the php file...another thing I'll have to learn...

    where's wayne...he's so clever at linkys like his Flippers thread...

    TIA

    KM

  2. #2
    I'm in Jail
    Butterfly's Avatar
    Join Date
    Mar 2006
    Last Online
    12-06-2021 @ 11:13 PM
    Posts
    39,832
    ^ easy

    You are mixing HTML code in your PHP after the php tag

    the form should be above the PHP tag

    probably a lot of other things missing too

  3. #3

    R.I.P.


    dirtydog's Avatar
    Join Date
    Jun 2005
    Last Online
    @
    Location
    Pattaya Jomtien
    Posts
    58,763
    not closed
    <?php

  4. #4
    RIP
    klongmaster's Avatar
    Join Date
    Jul 2005
    Last Online
    @
    Location
    Nonthaburi
    Posts
    4,382
    DD: the close is right at the end...

    actually it's not so easy because all the "experts" on the web only show how to write the script, and not how to fit it in the page...

    appreciate the help though guys..ta muchly...

  5. #5

    R.I.P.


    dirtydog's Avatar
    Join Date
    Jun 2005
    Last Online
    @
    Location
    Pattaya Jomtien
    Posts
    58,763
    The sideways v thingy >>>>


    <form action="a_library/php/bdt_bookings.php" method=" post" class="style22">
    <?php
    <div>
    <fieldset>
    <label for="name">
    <div align="left">
    <table align="center" border="0" cellpadding="4" width="100&#37;">

  6. #6
    I'm in Jail
    Butterfly's Avatar
    Join Date
    Mar 2006
    Last Online
    12-06-2021 @ 11:13 PM
    Posts
    39,832
    Klong you need to contact a professional, website design is no longer for week-end amateurs, too many details to learn. I see in your code very basic mistakes. Even a beginner should be able to solve those in less than 10 min.

    Ask FriscoFrankie, he knows that shit from top to bottom, he will develop your site for you, cheap.

  7. #7
    Northern Hermit
    friscofrankie's Avatar
    Join Date
    Jul 2005
    Last Online
    @
    Location
    Chiangmai, Thailand
    Posts
    7,526
    Why include the php file inthe first line of the code?? The form submits to that. I see no use of any php functions n the code at all. Simply put there is no reason to include the file

    There is a second php start tag below the form tag that has no use I can see remove it.
    This block of code:
    Code:
    <?php
    <div>
    <fieldset>
    <label for="name">
    
    <div align="left">
    <table align="center" border="0" cellpadding="4" width="100&#37;">
    <div align="center">
      <p><span class="style3 style27">Booking Form</span>
        
          <input type="hidden" name="sent" value="1" />
      </p>
    </div>
    <tbody><tr></tr><tbody>
    <tr><td align="right" valign="top" class="fieldname style23 style29 style22">&nbsp;</td>
                                              <td align="left" valign="top" class="style29 style22">* Required Information </td>
                                            </tr>
    
                                            <tr>
                                              <td colspan="2" align="left" valign="top" class="style3"><p class="style26"><span class="style30">Contact Information</span> </p>                                          </td>
                                            </tr>
                                            <tr>
                                              <td class="fieldname" align="right" valign="top"><span class="required">*</span>Your Name:</td>
                                              <td align="left" valign="top"><input name="strContactName" class="box" size="50" maxlength="50" title=" Please enter your name " type="text"></td>
    
                                            </tr>
                                            <tr>
                                              <td class="fieldname" align="right" valign="top"><span class="required">*</span>Email Address:</td>
                                              <td align="left" valign="top"><input name="strEmailAddress" class="box" id="strEmailAddress" title=" Please enter a valid email address " size="50" maxlength="50" type="text"></td>
                                            </tr>
                                            <tr>
                                              <td class="fieldname" align="right" valign="top">Telephone:</td>
    
                                              <td align="left" valign="top"><input name="strTelephone" class="box" size="50" maxlength="50" title=" Please enter your telephone number " type="text"></td>
                                            </tr>
                                            <tr>
                                              <td class="fieldname" align="right" valign="top">Cell Phone:</td>
                                              <td align="left" valign="top"><input name="strAltPhone" class="box" size="50" maxlength="50" title=" Please enter your cell phone number " type="text"></td>
                                            </tr>
                                            <tr>
                                              <td colspan="2" align="left" valign="top" class="style30">Tour Information </td>
    
                                            </tr>
                                            <tr>
                                              <td class="fieldname" align="right" valign="top"><span class="required">*</span> Tour Date:</td><td align="left" valign="top"><input name="strTourDate" class="box" size="50" maxlength="50" title=" Please enter the date you want to go on the tour " type="text"></td><tr>
                                              <td colspan="2" align="left" valign="top" class="style30">Pickup Details </td>
                                            </tr>
                                            <tr>
                                              <td align="right" valign="top">Hotel Name:</td>
    
                                              <td align="left" valign="top"><input name="strHotelName" class="box" id="strHotelName" title=" Please enter the hotel name " size="50" maxlength="50" type="text"></td>
                                            </tr>
                                            <tr>
                                              <td align="right" valign="top">Hotel Telephone:</td>
                                              <td align="left" valign="top"><input name="strHotelPhone" class="box" id="strHotelPhone" title=" Please enter the hotel telephone number " size="50" maxlength="50" type="text"></td>
                                            </tr>
                                            <tr>
                                              <td align="right" valign="top">Pickup Address:</td>
    
                                              <td align="left" valign="top"><textarea name="strAddress" cols="50" rows="8" class="box" id="strAddress" title=" Please enter the pickup address "></textarea></td>
                                            </tr>
                                            <tr>
                                              <td colspan="2" class="style30" align="left" valign="top">Queries</td>
                                            </tr>
                                            <tr>
                                              <td align="right" valign="top"></td>
                                              <td align="left" valign="top"><textarea name="strRemarks" cols="50" rows="8" class="box" id="strRemarks" title=" Please enter your comments or remarks "></textarea></td>
    
                                            </tr>
                                            <tr>
                                              <td colspan="2" class="subheading" align="left" valign="top"><span class="style22 style31">Payment payable in Thai Baht when you join the tour</span><br /></td>
                      </tr>
                                     <tr>
                                              <td align="right" valign="top"><input name="btnSubmit" id="btnSubmit" value=" Submit " class="button" type="submit"></td>
                                              <td align="left" valign="top">&nbsp;</td>
                                            </tr>
    
    </div>
    </form  <<-- INVALID FORM CLOSE TAG!!!!
    ?>
    The form close tag is invalid code. On a page with only one form element this usually doesn't kill a submit but fuckin fix it fer crissake

    What the fuck are the php tags doing there anyway?

    There is absolutely no reason this file should have ANY php tags in it.

    If your server was parsing I wuld nevere see them!!!!!
    That being said, in your form opening element the method=" post" remove teh leading space inside the quotes not sure it has any affect be remove it clean up the code.

    I'm going start off with I HATE PHP tags emedded n HTML pages! I write all my code as pure html or pure php that echoes (or Prints) html out when the fucntions are called. But this ugly fuckin convention has become the web coders preferred method, the thinking is it's easy. It's a mother fucker to maintain.

    But you include the 'a_library/php/bdt_bookings.php' file at the top of the file there are no php functions in the file no variables nor are there any with in the second tags. Again WHY DO I EVEDN FUCKIN SEE THEM IN THE SOURCE????? The parser would remove them and replace with the out put of the functions of files!!!!

    That is the Biggie; the server is not set up to parse php in html files. If it was I would not even see the fucking tags. the fact that the php tags show in your code tell me the server is servig the fgile as pure html. Unless you added some slick php coding to present the php tags as strings.
    Without a full, unparsed source code I couldn;t tell you what's going on there.
    The php parser does not echo the php code as code so I am guessing here but it ain;t being parsed as php. If this is true then no problem becahse there are no php variables of fucntions being called remove them they don;t hurt shit but are unecessary (again assuming I am seeing the full unparsed code).
    Now, looking at the form code the form should submit and process as needed. Comment out the entire php file. "a_library/php/bdt_bookings.php"
    Just place
    /* after the first < ?php tage and */ before the last ? > then before the opening comment tag ( /* ) add this code:
    Code:
    var_dump($_REQUEST);
    print("<br />\n");
    foreach($_REQUEST as $key => $value)
    {
        if(is_array($value))
        {
            var_dump($value);
        }else{
            print("$key => $value<br />\n");
            
        }
    }
    foreach($_FILES as $key => $value)
    {
    var_dump($value);
    }
    or put the code in a file of it's own and include it at the top of the target script. comment out the rest. ie." include('nameofcheckfile.php'); " You should get a very basic output of all your form data in a couple of formats. I wrote this form checker a couple years ago and the out put is crude but tells me that my data is being transferred or not.I use it ever goddam day. This should indicate your form is being submitted. If it is then we need to understand what the fuck the target file is doing exactly. maybe it updates a database and returns html or may it doesn;t return the html but expects another function of file to do so. Too complex to work out with out the code.
    Ok rambling

    maybe a list is better:
    It appears that html files are not filtered through the php parser (this a good thing)
    if you want html files parsed in this manner set them as htm or phtml files the config the server to parse files with these extension through the php parser ( Ifuckin hat inline php code what fuckin bars to trouble shoot)
    If the code is as I see it in my browser's "view source" util (I'm using the firefox webdeveloper addon) THERE IS NO REASON FOR THOSE TAGS TO BE THERE!!!

    I've spent only a few minutes looking at this code I hate trouble shooting table laid out pages and usually spend an hour cleaning up the code before I even try. I didn;t do that here.
    I may have missed some things but the above stand out like a russian hooker on Loi Kroh.


    with a quick look the form should submit even with the bad close tag. I think your problem is what happens with the form data after it hits the processor script.

    I've got a a few irons in the fire right now but if you want, PM me We'll exchange emails, you can send me the source code in question and I'll' try to point you i the right direction. Or Like BF said, hire me to fix the form submit, manipulate the data output it as you want and deal with in any manner you wish (automatic email acknowledgment, billing whatever) and it'll work right out the box.
    Last edited by friscofrankie; 15-08-2007 at 12:12 AM.
    When the people fear their government, there is tyranny; when the government fears the people, there is liberty -- T. Jefferson


  8. #8
    RIP
    klongmaster's Avatar
    Join Date
    Jul 2005
    Last Online
    @
    Location
    Nonthaburi
    Posts
    4,382
    Quote Originally Posted by Butterfly
    Klong you need to contact a professional, website design is no longer for week-end amateurs, too many details to learn. I see in your code very basic mistakes. Even a beginner should be able to solve those in less than 10 min.
    very helpful BF:...not

  9. #9
    RIP
    klongmaster's Avatar
    Join Date
    Jul 2005
    Last Online
    @
    Location
    Nonthaburi
    Posts
    4,382
    Quote Originally Posted by friscofrankie
    hire me to fix the form submit, manipulate the data output it as you want and deal with in any manner you wish (automatic email acknowledgment, billing whatever) and it'll work right out the box.
    cheers Frankie...I enjoy developing things on my own but this one is way over my head...will pm you later...off to Khao Yai thia morning for some market research...as always I appreciate you help...

  10. #10
    I'm in Jail
    Butterfly's Avatar
    Join Date
    Mar 2006
    Last Online
    12-06-2021 @ 11:13 PM
    Posts
    39,832
    Quote Originally Posted by klongmaster
    very helpful BF:...not
    The truth does help, unless you want to be blind

  11. #11
    Northern Hermit
    friscofrankie's Avatar
    Join Date
    Jul 2005
    Last Online
    @
    Location
    Chiangmai, Thailand
    Posts
    7,526
    ^^ I never even clicked he submit button KM. Just looked at the code. On submit there is a syntax error
    Code:
    Parse error:  syntax error, unexpected '}' in (removed path)/public_html/bangkokdaytours/a_library/php/bdt_bookings.php on line 55
    
    this may be just a missing semicolon. usually an error like this, on line number whatever, indicates an actual syntax error on line before it in this case, 54

    I see several minor issues in the code but basic HTML and most browsers are quite forgiving as long as the basics are there.
    Another thing I forgot to mention any code before the document declaration statement (the above mentioned include statement, in this case) throws IE into Quirks Mode, While IE is shit at spec compliance you really don;t want it to any more "quirky" than it already is...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •