Jump to content

somo

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Everything posted by somo

  1. somo

    form

    Thanks so much for that, i feel like a right tool , it was staring me in the face the whole time and i didnt pick it up. thanks! :) [quote author=sanfly link=topic=100861.msg398523#msg398523 date=1153136147] You have additional form tags in there [quote]<td valign="top" class="bodyText"><table><?PHP displayLogin(); ?> <form name="formcheck" onsubmit="return formCheck(this);" method="POST" action="details.php"> <p>Please supply your booking details in the fields below</p> <tr><td>Room Type: </td> [color=red]<form>[/color]<td><select name="R_ID"> <option value="1">Double <option value="2">Single <option value="3">Twin <option value="4">Accessible Room</td></select>[color=red]</form>[/color]</tr> <tr><td>Arrival Date: </td><td><input id='date1' type="text" name="arrive" onclick="scwShow(document.getElementById('date1'),this);" /></td></tr> <tr><td>Departure Date: </td><td><input id='date2' name="depart" onclick="scwShow(document.getElementById('date2'),this);" /></td></tr> <tr><td>Number of Rooms: </td> <td><select name="no_of_rooms"> <option value="1">1 <option value="2">2 <option value="3">3 <option value="4">4 <option value="4">5 <option value="4">6 <option value="4">7 <option value="4">8 <option value="4">9 <option value="4">10 </td></select></tr> <tr><td>Number of Adults <i>(per room)</i>: </td> <td><select name="adults"> <option value="1">1 <option value="2">2 </td></select></tr> <tr><td>Number of Children <i>(per room)</i>: </td> <td><select name="childs"> <option value="0">0 <option value="1">1 <option value="2">2 </td></select></tr> <tr><td><br /><input type="submit" value="Submit" ></td><td><br /><input type="reset"></td></tr> </form> </table> <?PHP }else{ echo "<p>Sorry user does not exist please go back </p>"; } ?> <p>&nbsp;</p> </td> </tr> </table> </td>[/quote] [/quote]
  2. somo

    form

    Hi i know this sin't strictly php but its being used with bits of php code but i cant figue out why the form in this code won't submit, when i go to press the submit button it does nothing, ive been looking at it for ages and i cant find the cause of the error. thanks. [code] <td valign="top" class="bodyText"><table><?PHP displayLogin(); ?> <form name="formcheck" onsubmit="return formCheck(this);" method="POST" action="details.php"> <p>Please supply your booking details in the fields below</p> <tr><td>Room Type: </td> <form><td><select name="R_ID"> <option value="1">Double <option value="2">Single <option value="3">Twin <option value="4">Accessible Room</td></select></form></tr> <tr><td>Arrival Date: </td><td><input id='date1' type="text" name="arrive" onclick="scwShow(document.getElementById('date1'),this);" /></td></tr> <tr><td>Departure Date: </td><td><input id='date2' name="depart" onclick="scwShow(document.getElementById('date2'),this);" /></td></tr> <tr><td>Number of Rooms: </td> <td><select name="no_of_rooms"> <option value="1">1 <option value="2">2 <option value="3">3 <option value="4">4 <option value="4">5 <option value="4">6 <option value="4">7 <option value="4">8 <option value="4">9 <option value="4">10 </td></select></tr> <tr><td>Number of Adults <i>(per room)</i>: </td> <td><select name="adults"> <option value="1">1 <option value="2">2 </td></select></tr> <tr><td>Number of Children <i>(per room)</i>: </td> <td><select name="childs"> <option value="0">0 <option value="1">1 <option value="2">2 </td></select></tr> <tr><td><br /><input type="submit" value="Submit" ></td><td><br /><input type="reset"></td></tr> </form> </table> <?PHP }else{ echo "<p>Sorry user does not exist please go back </p>"; } ?> <p>&nbsp;</p> </td> </tr> </table> </td>[/code]
  3. To encrypt data on a page that would be sending debit/credit card details to mysql/ Is there any other ssl distribution that can be used under windows and apache and how does it work?
  4. I need to use SSL and i hear openssl is a good secure socket layer binary. I have never used it before does any one know how you intstall or use it with PHP, apache etc ?? Anyone's help who has used it before is most greatfull as i am stuck on how to use it! Cheers.
  5. somo

    Mysql...

    cheers mate that sorted it, you just don't see them when you look at the code for too long, anyways thanks. [quote author=GingerRobot link=topic=100446.msg396412#msg396412 date=1152804284] try: $result = mysql_query("SELECT C_Email FROM Customer WHERE U_Username = '$username' LIMIT 1") or die(mysql_error()); [/quote]
  6. somo

    Mysql...

    Im trying to select and email address of a customer where their username matches the variable in my script. I'm gettin "Unknown column 'somo' in 'where clause' " somo is a username and is in the databse. Any clues? [code] <? //select the email address of the user that is booking $result = mysql_query("SELECT C_Email FROM Customer WHERE U_Username = "$username" LIMIT 1") or die(mysql_error()); $row = mysql_fetch_assoc($result); $C_Mail = $row['C_Email'];// return email ?> [/code]
  7. Hi All, I am going to create a script that will process and store (in mysql) credit/debit card details; i would like to know people's opinions in which are the best ways to code to process and store these details since this data is sensative? Cheers, Somo.
  8. can any one help please  ???
  9. im not to sure where to place the isset if statement. What from the code below needs changing to get it to work? [code] <input type='submit' value='Confirm Booking'> <? if (isset($_POST['submit'])) {     mysql_query("INSERT INTO Bookings VALUES ('$username', '$R_ID', '$Todays_Date', '$Arrive', '$Depart', '$date_diff', '$Adults', '$Childs', '$Cost')")or die("Error Inserting Customer Details: ".mysql_error()); mysql_close($link); print "<p>Booking Added, re-driecting you to payment page</p>";   } [/code] [quote author=obsidian link=topic=100313.msg395771#msg395771 date=1152716573] you'll always get that before your form is submitted. that's why you need to check if it is set instead of just referencing the variable: [code] <?php if (isset($_POST['submit'])) {   // form has been submitted } ?> [/code] [/quote]
  10. i didnt put the ";" on the code on hear. Im getting undefined index on the if statement [quote author=effigy link=topic=100313.msg395764#msg395764 date=1152715934] You need a semicolon at the end of your echo statement. [/quote]
  11. i have got an if statement to submit data to a mysql db. But get an error shown in bold below.  I think its as i havent reference the submit button properly, can any one tell me how? cheers. [code] echo "<input type='submit' value='Confirm Booking' >"   if ($_POST['submit']) { // <----------error here     //add data to database   } else {     //otherwise error msg   }[/code]
  12. somo

    mysql help

    that isn't doing anything (and theres not even errors  ???) the format is D M Y e.g. 09 July 2006. i just need the amount of fields in the database that have todays date. if there are 2 fields with 11 July for example (i need a variable to store 2) any ideas?
  13. i realise the code below is cr@p but can any one tell me how i can retrieve all todays dates (i.e. $Todays_Date) and return the number of rows that exist in all of the "B_Checkout" field this is all i need .  Can any one help i realise this is simple and will kick myself when im told but i have been workin for to long and my brain is warped lol What ive got at mo: $result = mysql_query("SELECT B_CheckoutDate FROM Bookings WHERE B_CheckoutDate = ".$Todays_Date." ") or die(mysql_error()); while ($get_info = mysql_fetch_row($result)){ foreach ($get_info as $field) print "\t<td><p>$field</p></td>\n"; }
  14. Thanks for that its working now cheers! :) [quote author=kenrbnsn link=topic=99971.msg394056#msg394056 date=1152462879] You only need to specify the field name as the index: [code]<?php $R_RoomAvailability = $row['R_RoomAvailiability']; ?>[/code] Ken [/quote]
  15. Another error lol Undefined index: SELECT R_RoomAvailiability $result = mysql_query("SELECT R_RoomAvailiability FROM Room WHERE R_ID = ".$R_ID." LIMIT 1") or die(mysql_error()); $row = mysql_fetch_assoc($result); <b>$R_Room_Availability = $row['SELECT R_RoomAvailiability']; //<-- error here now :( </b> [quote author=Gast link=topic=99971.msg394049#msg394049 date=1152462035] Try this: [code]<?php $result = mysql_query("SELECT R_RoomAvailiability FROM Room WHERE R_ID = ".$R_ID." LIMIT 1") or die(mysql_error()); $row = mysql_fetch_assoc($result);  //<---error is here for some reason</b> $R_RoomAvailability = $row['SELECT R_RoomAvailiability']; echo $R_RoomAvailability; ?>[/code] [/quote]
  16. im gettin a parse errror $result = mysql_query( "SELECT R_RoomAvailiability FROM Room WHERE R_ID=$R_ID " ) <b>$row = mysql_fetch_assoc($result);  <---error is here for some reason</b> $R_RoomAvailability = $row['SELECT R_RoomAvailiability']; [quote author=ShogunWarrior link=topic=99971.msg394044#msg394044 date=1152461113] Ok, first I think R_ID is probably a number so you don't need quotes, e.g: [b]$R_ID[/b] instead of [b]'$R_ID'[/b] To get the values do this: [code] $row = mysql_fetch_assoc($result); $R_Room_Availability = $row['SELECT R_RoomAvailiability']; [/code] [/quote]
  17. I know this is simple but i just cant get it working.. how would you about return one value in a datbase? $result = mysql_query( "SELECT R_RoomAvailiability FROM Room WHERE R_ID='$R_ID' " ) i need the value from this query can any one help? cheers
  18. No i have a mini calendar that gets the user to select a date which is autoimatically put into a field. All i need to do is get the field contents e.g. 09 July 2006  and store this as a variable in php sp i can use that variabile in an amount of days calculation script. [quote author=redarrow link=topic=99953.msg393922#msg393922 date=1152448832] when you sat date you mean the date the user post the form if so i got this ok. $date=date("y/m/d"); year month day. for debuging purpose the date will be shown in the input box you can easly put hidden ok. <input type="text" name="date" value=<?echo $date; ?>"> [/quote]
  19. Hi, does anybody know how i can get the contents of an input field?  I need a date entered by a user that i then need to use in a script on the same page. im don't know how i can go around doin it thanks.  :)
  20. somo

    forms

    i've sorted out the problem - ignore this  ;D
  21. somo

    forms

    Hi, I have got a php page that lets customer's details be entered in fields - i have used javascript to validate user's input. But i have one main form (to check certain fields are entered) and other sub forms in the page to validate user input (e.g. email and postcode) ... when the data is submitted to code that sends the data to the databse i get "Notice: Undefined index: email", "Notice: Undefined index: postcode etc. Is there a way around this so that all sub forms can send the data they have all as one to mysql? Many thanks, somo.
  22. How would you use this in relation to a html post code field? Sorry im new to php and just trying to teach myself the language bit by bit. thanks. [quote author=wildteen88 link=topic=99508.msg391867#msg391867 date=1152099904] For the UK Postcode I have this: [code]^[A-Z]{2}[0-9]{1,2} ([0-9]{1}[A-Z]{2})$[/code] Here is a step through of what above expression does: [A-Z]{2} - Check the first two characters of the Postal code are letters from a through to z [0-9]{1,2} - Checks that there are at least one or two characters after the first two are numbers, from 0 - 9 [0-9]{1} - Does the same as above, but checks the the next character is a number after the space [A-Z]{2} - Check the  last two characters of the Postal code are letters from a through to z Here it is action: [code=php:0]$regexp = "^[A-Z]{2}[0-9]{1,2} ([0-9]{1}[A-Z]{2})$"; $postal = 'AB1 2BC'; if(!ereg(strtoupper($regexp), $postal)) {     echo '<i>'.$postal.'</i> - invalid postal code'; } else {     echo '<i>'.$postal.'</i> - valid postal code!'; }[/code] [/quote]
  23. Hi, i need validation for UK postcode field, UK telephone number field and to check with mysql datbase if there are existing users with the same username there also. These fields need checking and sending (with other data such as address etc)  to a mysql database to be stored. Anyone got any ideas on how i can go about doing this?  any code would be aprreciated. Cheers.
  24. ;D ;D ;D  FOUND THE ISSUE WITH THE EXTRA RECORD!! SSI - IM USING INCLUDES IN THE SITE IM CREATING AND JUST USING THE FORM (WITHOUT THE INCLUDES) AND SUBMITTING THE PAGE; THE PROBLEM HAS BEEN RESOLVED. DONT KNOW WHY BUT THE INCLUDES HAVE BEEN CAUSING THE EXTRA RECORD SET! THANKS FOR EVERYONES INPUT, CHEERS!!!  ;)
  25. i understand what everyone is sayin... but how can the script go from working fine then when i come to it next its adding an extra record set. still havent got it working gtg to work in a mo so will see what others think and try again in the morning. cheers.
×
×
  • 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.