Jump to content

XCalibre3

Members
  • Posts

    49
  • Joined

  • Last visited

Everything posted by XCalibre3

  1. I fixed it by moving: <?php $servername='localhost'; $username="root"; $password=""; try { $con=new PDO("mysql:host=$servername;dbname=calendar",$username,$password); $con->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); //echo 'connected'; } catch(PDOException $e) { echo ''.$e->getMessage(); } ?> <?php $searchErr = ''; $customer_details=''; if(isset($_POST['save'])) { if(!empty($_POST['search'])) { $search = $_POST['search']; $stmt = $con->prepare("select * from reservations where fname like '%$search%' or lname like '%$search%' or resnum like '%$search%' or email like '%$search%' or phone like '%$search%'"); $stmt->execute(); $customer_details = $stmt->fetchAll(PDO::FETCH_ASSOC); //print_r($customer_details); ?> <div class="table-responsive"> <table class="table"> <thead> <tr> <th>#</th> <th>Name</th> <th>Email</th> <th>Phone</th> <th>Reservation #</th> </tr> </thead> <tbody> <?php if(!$customer_details) { } else{ foreach($customer_details as $key=>$value) { ?> <tr> <td><?php echo $key+1;?>&nbsp&nbsp</td> <td><?php echo $value['fname'];?>&nbsp<?php echo $value['lname'];?></td> <td>&nbsp&nbsp&nbsp&nbsp<?php echo $value['email'];?></td> <td>&nbsp&nbsp&nbsp&nbsp<?php echo $value['phone'];?></td> <td>&nbsp&nbsp&nbsp&nbsp<?php echo $value['resnum'];?></td> </tr> <?php } } ?> <?php } else { $searchErr = "Please enter the information"; } } ?> <html> <head> <link rel="stylesheet" href="bootstrap.css" crossorigin="anonymous"> <!-- Optional theme --> <link rel="stylesheet" href="bootstrap-theme.css" crossorigin="anonymous"> <style> .container{ width:70%; height:20%; padding:20px; } </style> </head> <body> <div class="container"> <h3><u>Navarre Beach Scuba Name and Reservation Search</u></h3> <form class="form-horizontal" action="#" method="post"> <div class="row"> <div class="form-group"> <label class="control-label col-sm-4" for="email"><b>Search Customer Reservations:</b>:</label> <div class="col-sm-4"> <input type="text" class="form-control" name="search" placeholder="search here"> </div> <div class="col-sm-2"> <button type="submit" name="save" class="btn btn-success btn-sm">Submit</button> </div> </div> <div class="form-group"> <span class="error" style="color:red;">* <?php echo $searchErr;?></span> </div> </div> </form> </tbody> </table> </div> </div> <script src="jquery-3.2.1.min.js"></script> <script src="bootstrap.min.js"></script> </body> </html> lol, probably the easiest reply I've had so far... and I knew this but was up 18 hours working on this and just didn't think. Thank you.
  2. When I first go to do a search, it shows the input box to insert your search, but then it also shows: # Name Email Phone Reservation # I don't want that showing until after I do the search. How can I do that? Here is my code. Thank you for any help. <?php $servername='localhost'; $username="root"; $password=""; try { $con=new PDO("mysql:host=$servername;dbname=calendar",$username,$password); $con->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); //echo 'connected'; } catch(PDOException $e) { echo '<br>'.$e->getMessage(); } ?> <?php $searchErr = ''; $customer_details=''; if(isset($_POST['save'])) { if(!empty($_POST['search'])) { $search = $_POST['search']; $stmt = $con->prepare("select * from reservations where fname like '%$search%' or lname like '%$search%' or resnum like '%$search%' or email like '%$search%' or phone like '%$search%'"); $stmt->execute(); $customer_details = $stmt->fetchAll(PDO::FETCH_ASSOC); //print_r($customer_details); } else { $searchErr = "Please enter the information"; } } ?> <html> <head> <link rel="stylesheet" href="bootstrap.css" crossorigin="anonymous"> <!-- Optional theme --> <link rel="stylesheet" href="bootstrap-theme.css" crossorigin="anonymous"> <style> .container{ width:70%; height:30%; padding:20px; } </style> </head> <body> <div class="container"> <h3><u>Navarre Beach Scuba Name and Reservation Search</u></h3> <br/><br/> <form class="form-horizontal" action="#" method="post"> <div class="row"> <div class="form-group"> <label class="control-label col-sm-4" for="email"><b>Search Customer Reservations:</b>:</label> <div class="col-sm-4"> <input type="text" class="form-control" name="search" placeholder="search here"> </div> <div class="col-sm-2"> <button type="submit" name="save" class="btn btn-success btn-sm">Submit</button> </div> </div> <div class="form-group"> <span class="error" style="color:red;">* <?php echo $searchErr;?></span> </div> </div> </form> <h3><u>Search Result</u></h3><br/> <div class="table-responsive"> <table class="table"> <thead> <tr> <th>#</th> <th>Name</th> <th>Email</th> <th>Phone</th> <th>Reservation #</th> </tr> </thead> <tbody> <?php if(!$customer_details) { } else{ foreach($customer_details as $key=>$value) { ?> <tr> <td><?php echo $key+1;?>&nbsp&nbsp</td> <td><?php echo $value['fname'];?>&nbsp<?php echo $value['lname'];?></td> <td>&nbsp&nbsp&nbsp&nbsp<?php echo $value['email'];?></td> <td>&nbsp&nbsp&nbsp&nbsp<?php echo $value['phone'];?></td> <td>&nbsp&nbsp&nbsp&nbsp<?php echo $value['resnum'];?></td> </tr> <?php } } ?> </tbody> </table> </div> </div> <script src="jquery-3.2.1.min.js"></script> <script src="bootstrap.min.js"></script> </body> </html>
  3. I just reinstalled everything since there was a billion errors. Sorry for the post, but it might help somsone maybe lol.
  4. I got it to work by doing.... BUT.... lol, always a but... Step 1: Moved(cut/paste) all the files in C:\xampp\mysql\data to desired backup location. Step 2: After that copied all the files from C:\xampp\mysql\backup to C:\xampp\mysql\data Step 3: Restarted mysql and checked the phpmyadmin url, it worked. Step 4: After that stopped mysql that copied ibdata1 file from backup location to C:\xampp\mysql\data Step 5: Restarted mysql Step 6: After that copied all database folders and checked all the tables, It worked. Now I get this error, and even though it's started, I cannot access anything but phpmyadmin, my localhost htm file, and that's it. The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. Makes no sense that I can access localhost/index.html but nothing else in any of the directories. Also when I click anything in the phpmyadmin database I get this:
  5. It keeps stopping even though I have it as a service. Apache is working, but I get this error when starting MySQL 2023-04-21 13:44:02 0 [Note] Starting MariaDB 10.4.28-MariaDB source revision c8f2e9a5c0ac5905f28b050b7df5a9ffd914b7e7 as process 10328 Cannot find checkpoint record at LSN (1,0x5556) 2023-04-21 13:44:02 0 [ERROR] mysqld.exe: Aria recovery failed. Please run aria_chk -r on all Aria tables and delete all aria_log.######## files 2023-04-21 13:44:02 0 [ERROR] Plugin 'Aria' init function returned error. 2023-04-21 13:44:02 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed. 2023-04-21 13:44:02 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2023-04-21 13:44:02 0 [Note] InnoDB: Uses event mutexes 2023-04-21 13:44:02 0 [Note] InnoDB: Compressed tables use zlib 1.2.12 2023-04-21 13:44:02 0 [Note] InnoDB: Number of pools: 1 2023-04-21 13:44:02 0 [Note] InnoDB: Using SSE2 crc32 instructions 2023-04-21 13:44:02 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M 2023-04-21 13:44:02 0 [Note] InnoDB: Completed initialization of buffer pool 2023-04-21 13:44:02 0 [Note] InnoDB: 128 out of 128 rollback segments are active. 2023-04-21 13:44:02 0 [Note] InnoDB: Creating shared tablespace for temporary tables 2023-04-21 13:44:02 0 [Note] InnoDB: Setting file '\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 2023-04-21 13:44:02 0 [Note] InnoDB: File '\xampp\mysql\data\ibtmp1' size is now 12 MB. 2023-04-21 13:44:02 0 [Note] InnoDB: Waiting for purge to start 2023-04-21 13:44:03 0 [Note] InnoDB: 10.4.28 started; log sequence number 328146; transaction id 309 2023-04-21 13:44:03 0 [Note] Plugin 'FEEDBACK' is disabled. 2023-04-21 13:44:03 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool 2023-04-21 13:44:03 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded 2023-04-21 13:44:03 0 [ERROR] Failed to initialize plugins. 2023-04-21 13:44:03 0 [ERROR] Aborting And this is the error I get: 1:44:09 PM [mysql] Error: MySQL shutdown unexpectedly. 1:44:09 PM [mysql] This may be due to a blocked port, missing dependencies, 1:44:09 PM [mysql] improper privileges, a crash, or a shutdown by another method. 1:44:09 PM [mysql] Press the Logs button to view error logs and check 1:44:09 PM [mysql] the Windows Event Viewer for more clues 1:44:09 PM [mysql] If you need more help, copy and post this 1:44:09 PM [mysql] entire log window on the forums
  6. Yes, the first mail I use sends the information to me saying so and so reserved so and so date and gives me name, phone, email, etc... Second mail is sent to them, which provides their information with their reservation number. I have it working, but might have to remove the html, as it's not showing... it just shows this in the email. html> <head> <title>Welcome to Navarre Beach Scuba</title> </head> <body> <h1>Thanks you for your reservation. We cant wait to get started. See you soon!</h1> <table cellspacing="0" style="border: 2px dashed #FB4314; width: 100%;"> <tr> <th>Name:</th><td>Navarre Beach Scuba</td> </tr> <tr style="background-color: #e0e0e0;"> <th>Email:</th><td>[email protected]</td> </tr> <tr> <th>Website:</th><td><a href="[http://www.navarrebeachscuba.com">Website</a></td]http://www.navarrebeachscuba.com">Website</a></td> </tr> </table> </body> </html>
  7. One goes to the person that makes the reservation and their reservation number.... then one goes to me that tells me someone has made a reservation.
  8. I actually got this to work, but doesn't show html... but will look into phpmailer. Does it have to be in the main directory? $to = "$email"; $subject = 'Send HTML Email in PHP by Navarre Beach Scuba'; $htmlContent = ' <html> <head> <title>Welcome to Navarre Beach Scuba</title> </head> <body> <h1>Thanks you for your reservation. We cant wait to get started. See you soon!</h1> <table cellspacing="0" style="border: 2px dashed #FB4314; width: 100%;"> <tr> <th>Name:</th><td>Navarre Beach Scuba</td> </tr> <tr style="background-color: #e0e0e0;"> <th>Email:</th><td>[email protected]</td> </tr> <tr> <th>Website:</th><td><a href="http://www.navarrebeachscuba.com">Website</a></td> </tr> </table> </body> </html>'; // Set content-type header for sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // Additional headers $headers = "From: [email protected]" . "\r\n"; // $headers .= 'Cc: [email protected]' . "\r\n"; // $headers .= 'Bcc: [email protected]' . "\r\n"; // Send email if(mail($to, $subject, $htmlContent, $headers)){ echo 'Email has sent successfully.'; }else{ echo 'Email sending failed.'; }
  9. Okay, I updated the information you suggested.... no go *cries* lol //This one I've tried so many different ways it's crazy. This one needs the users email that makes the reservation so I can send their info. $to = "$email"; $from = "[email protected]"; $fromName = "Navarre Beach Scuba"; $subject = 'Send HTML Email in PHP by Navarre Beach Scuba'; $htmlContent = ' <html> <head> <title>Welcome to Navarre Beach Scuba</title> </head> <body> <h1>Thanks you for your reservation. We cant wait to get started. See you soon!</h1> <table cellspacing="0" style="border: 2px dashed #FB4314; width: 100%;"> <tr> <th>Name:</th><td>Navarre Beach Scuba</td> </tr> <tr style="background-color: #e0e0e0;"> <th>Email:</th><td>[email protected]</td> </tr> <tr> <th>Website:</th><td><a href="http://www.navarrebeachscuba.com">Website</a></td> </tr> </table> </body> </html>'; // Set content-type header for sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // Additional headers $headers = 'From: ' . $fromName . "\r\n"; // $headers .= 'Cc: [email protected]' . "\r\n"; // $headers .= 'Bcc: [email protected]' . "\r\n"; // Send email if(mail($to, $subject, $htmlContent, $headers)){ echo 'Email has sent successfully.'; }else{ echo 'Email sending failed.'; }
  10. Yes I know I have the ".." there, I was testing a billion ways to make it work. It should get the users email from the GET email, but it's not doing it. As stated, the first one works using the GET info, but the second one is not. I don't get it. I will also look at your link. Thank you. And I also tried: $to = "$email"; I've tried 100 ways lol
  11. For the likes of me, I cannot figure out how to send two emails at the same time. I have seen examples, but none of them work. I need to send a message to me, that someone has reserved a certain day for scuba diving... this one works. It gives me that email, but I cannot get the second one to work unless I put a certain email in, like mine. I don't want that. I need the user that made the reservations email address so I can send them the confirmation number and information. This is what I have so far. Thanks for any help. if (isset($_POST["submit"])) { unset($_POST[submit]); $servername = "127.0.0.1"; $username = ""; $password = ""; $dbname = ""; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT * FROM reservations WHERE oid = $_GET[oid]"; $result = $conn->query($sql); $fname = $_GET['fname']; $lname = $_GET['lname']; $phone = $_GET['phone']; $dropdown = $_GET['dropdown']; $oid = $_GET['oid']; $dived = $_GET['dove']; $email = $_GET['email']; $date = $_GET['$date']; if(! get_magic_quotes_gpc() ) { $fname = addslashes ($fname); $lname = addslashes ($lname); $email = addslashes ($email); $phone = addslashes ($phone); $dived = addslashes ($dived); $dropdown = addslashes ($dropdown); $date = addslashes ($date); $resnum = addslashes ($code); } else { $fname = $_GET['name']; $email = $_GET['email']; $lname = $_GET['lname']; $phone = $_GET['phone']; $dived = $_GET['dived']; $dropdown = $_GET['dropdown']; $date = $_GET['$date']; } $sql = "INSERT INTO reservations ". "(fname,lname,email,phone,dived,dropdown,reserved,resnum) "."VALUES ". "('$fname','$lname','$email','$phone','$dived','$dropdown','$time','$resnum')"; $to_email = '[email protected]'; //This one works $subject = 'Navarre Scuba Reservation'; $message = "A Reservation has been make on: $time\n \n". "Username: $fname $lname"."\n\nContact Phone: $phone.\r\nEmail Address: $email\r\n\nReservation number: $code\r\n\nNavarre Beach Scuba Reservation Autoresponder"; $headers = 'From: [email protected]'; mail($to_email,$subject,$message,$headers); //This one I've tried so many different ways it's crazy. This one needs the users email that makes the reservation so I can send their info. $to = "'.$email.'"; $from = 'navarrebeachscuba.com'; $fromName = 'Navarre Beach Scuba'; $subject = "Send HTML Email in PHP by Navarre Beach Scuba"; $htmlContent = ' <html> <head> <title>Welcome to Navarre Beach Scuba</title> </head> <body> <h1>Thanks you for your reservation. We cant wait to get started. See you soon!</h1> <table cellspacing="0" style="border: 2px dashed #FB4314; width: 100%;"> <tr> <th>Name:</th><td>Navarre Beach Scuba</td> </tr> <tr style="background-color: #e0e0e0;"> <th>Email:</th><td>[email protected]</td> </tr> <tr> <th>Website:</th><td><a href="http://www.navarrebeachscuba.com">Website</a></td> </tr> </table> </body> </html>'; // Set content-type header for sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // Additional headers $headers .= 'From: '.$fromName.'<'.$from.'>' . "\r\n"; // $headers .= 'Cc: [email protected]' . "\r\n"; // $headers .= 'Bcc: [email protected]' . "\r\n"; // Send email if(mail($to, $subject, $htmlContent, $headers)){ echo 'Email has sent successfully.'; }else{ echo 'Email sending failed.'; } Also, I have unset the submit so that it wouldn't post a double email, which changes the confirmation number... but it's not working either. I'm almost bald as it is don't need to lose anymore hair. Thanks for any help.
  12. In my experience with PHP and APACHE, if you want port changes, they are in the ini files that are in the Apache php.ini. I could be way off as I have never dealt with what you are trying to setup, so I hope it helps.
  13. In your Apache Httpd.conf file, there is a place to set this. I'm new to much of this, but since you mentioned it. Fine # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 152.37.156.203:1000 Listen 80 and probably change that to 8000. Just trying to help solve the issue; by no means a professional at this... especially since I don't work with VB. Just change that info; stop Apache and then restart. Good luck.
  14. I would assume you would change your .ini file to 8000 instead of the default 80? Have you given that a try?
  15. This wasn't quite working, but I did use it and then set the opacity to zero and the button at least doesn't show the way I wanted it. But your code helped tremendously, thank you.
  16. with the above code is there a way to make the "Show Div" text disappear instead of toggle? When it shows the new div that is, and then I can have that button do something else.
  17. I'm not looking for a toggle... I can use this for a toggle.... echo" <br><br><button name='submit' class = 'btn' id='mydiv'>Click to Verify Information</button>"; echo" </form>"; ?> <meta charset="utf-8"> <script type='text/javascript'> function showDiv() { let thediv = document.getElementById("mydiv") if (thediv.style.display == "block") { thediv.style.display = "none" } else { thediv.style.display = "block" } } </script> <style type='text/css'> #mydiv { display: none; } </style> </head> <body> <button onclick='showDiv()'>Show Div</button> I need the button to go away and the next button to submit info or do whatever I need it to do. Not sure if this is possible
  18. Essentially I'm looking for a way to make a button say "verify your information".... when it is clicked, I would like it to go away and then open another button that says finalize your reservation".... I've tried many ways and I can't figure it out. Is this possible? Thank you!
  19. lol to both of you I'm 51 and ancient... Hven't coded in a long time. I will find another way. Thanks.
  20. I can't figure out why this doesn't work. I do have al the input ID's from the from the same as the ID's in the script. echo" <br><br><button name='submit' type='button' class = 'btn' id='btn' onclick='InsertRecord()'>Click to Verify Information</button>"; echo" </form>"; ?> <script type="text/javascript" > function InsertRecord() { var txtfname = document.getElementById('fname').value; var txtlname = document.getElementById('lname').value; var txtphone = document.getElementById('phone').value; var txtdived = document.getElementById('dived').value; var txtdropdown = document.getElementById('dropdown').value; if (txtfname.length != 0 || txtlname.length !=0 || txtphone.length !=0 || txtdived.length !=0 || txtdropdown.length !=0 ) { var connection = new ActiveXObject("ADODB.Connection"); var connectionstring = "Data Source=localhost;Initial Catalog=reservations;User ID=ID;Password=PW;Provider=SQLOLEDB"; connection.Open(connectionstring); var rs = new ActiveXObject("ADODB.Recordset"); rs.Open("insert into reservations values('" + txtfname + "','" + txtlname + "','" + txtphone + "','" + txtdived + "','" + txtdropdown "')", connection); alert("Insert Record Successfuly"); connection.close(); } else { alert("Fill all fields out please"); } } </script>
  21. This resolved the issue. Thank you both! It worked by putting the closing brace and changing type. Thanks much! I don't know who to mark as solution.
  22. This does nothing at all. I click the button and it just stays there as if I never clicked it.
  23. The button comes back. It should disappear.
  24. Why isn't this working? echo" <br><br><button name='submit' class = 'btn' id='btn' onclick='hideButton()'>Click to Verify Information</button>"; echo" <br><br><button name='submit' class = 'btn' id='btn' onclick='hideButton()'>Click to Verify Information</button>"; THen Function: <script> function hideButton(){ document.getElementById('btn').style.display= 'none'; </script> the button does disappear but then comes back after a blink. So you can see if disappear. I'n lost on why it doesn't just stay gone. If you need more code just ask. Thank you!
×
×
  • 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.