Jump to content

somo

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

somo's Achievements

Member

Member (2/5)

0

Reputation

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