PHP - Slot Machine
Does any one know where I can find a PHP slots machine script?
Similar TutorialsHello Friends,
I am trying to execute Time slot booking for an application. - When user selects a date - Each time slot can be booked by 2 users User 1 selected a date (2nd March)and selected a time slot (10:00 - 11:00 AM).
User 2 selected a date (2nd March)and selected a time slot (10:00 - 11:00 AM). Please find the script below. Your help is really appreciated. <?php include('database.php'); $fname=""; $lname=""; $email=""; $phone=""; $date=""; if(isset($_POST['fname'])){ $fname=$_POST['fname'];} if(isset($_POST['lname'])){$lname=$_POST['lname'];} if(isset($_POST['email'])){$email=$_POST['email'];} if(isset($_POST['phone'])){$phone=$_POST['phone'];} if(isset($_POST['date'])){$date=$_POST['date'];} else $date=date("m-d-Y") $result=mysqli_query($conn,"SELECT exam_time,count()from test_booking_confirm where DATEDIFF('exam_date',DATE_FORMAT('"+$date+"','%m-%d-%Y'))=0 group by exam_date,exam_time having count()>1"); $slots=array(); $i=0; if (mysqli_num_rows($result) != 0) { while($row = mysqli_fetch_assoc($result)) { $slots[$i]=$row["exam_time"]; $i++; } } ?> <!doctype html> <html> <head> <title></title> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/bootstrap.min.css" /> <!-------date picker-------> <link rel="stylesheet" href="css/jquery-ui.css" /> <script src="js/jquery.js"></script> <script src="js/jquery-ui.js"></script> <script> $(document).ready(function(){ $("#datepicker").datepicker({ beforeShowDay: function(date) { var day=date.getDay(); if(day==2) { return [false]; } else { return [true]; } } }); }); </script> <script> $(document).ready(function() { $('#datepicker').datepicker(); $('#datepicker').datepicker("show"); }); </script> <script> function setToday() { var n = new Date(); y = n.getFullYear(); m = n.getMonth() + 1; d = n.getDate(); var x=m + "/" + d + "/" + y; document.getElementById("datepicker").value = x; } function datechange(vv) { document.myform.action="test_booking.php"; document.myform.submit(); } </script> </head> <body OnLoad="document.myform.fname.focus();setToday()"> <div class="container register"> <div class="row"> <div class="col-md-3 training_bk register-left"> <img src="images/ESStechlogo.png" alt=""/> <h3>Welcome</h3> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p> </div> <div class="col-md-9 register-right"> <form method="post" action="test_booking_review.php" name="myform"> <div class="tab-content" id="myTabContent"> <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab"> <h3 class="register-heading">Book your Training</h3> <div class="row register-form"> <div class="col-md-6"> <div class="form-group"> <input type="text" autofocus name="fname" required class="form-control" placeholder="First Name*" /> </div> <div class="form-group"> <input type="text" name="lname" required class="form-control" placeholder="Last Name*" /> </div> <h5>Your Preferred Slot</h5> <div class="form-group"> <!--<div id="datepicker" required name="date" ></div>--> <input type="text" id="datepicker" required name="date" placeholder="mm/dd/yyyy" class="form-control" onChange ="datechange(this.value)"> </div> </div> <div class="col-md-6"> <div class="form-group"> <input type="email" name="email" required class="form-control" placeholder="Email*" /> </div> <div class="form-group"> <input type="number" name="phone" required class="form-control" placeholder="Phone*" /> </div> <!--<div class="form-group"> <select class="form-control"> <option class="hidden" selected disabled>City</option> <option>option</option> <option>option</option> <option>option</option> </select> </div>--> <div class="form-group"> <div class="maxl"> <?php if (!in_array("08:00AM TO 09:00AM", $slots)) { ?> <label class="radio inline"> <input type="radio" name="time" value="08:00AM TO 09:00AM" checked> <span>08:00AM TO 09:00AM (Available)</span> </label> <?php } if (!in_array("09:00AM TO 10:00AM", $slots)) { ?> <label class="radio inline"> <input type="radio" name="time" value="09:00AM TO 10:00AM"> <span>09:00AM TO 10:00AM (Available)</span> </label> <?php } if (!in_array("10:00AM TO 11:00AM", $slots)) { ?> <label class="radio inline"> <input type="radio" name="time" value="10:00AM TO 11:00AM"> <span>10:00AM TO 11:00AM (Available)</span> </label> <?php } if (!in_array("11:00AM TO 12:00PM", $slots)) { ?> <label class="radio inline"> <input type="radio" name="time" value="11:00AM TO 12:00PM"> <span>11:00AM TO 12:00PM (Available)</span> </label> <?php } if (!in_array("12:00PM TO 01:00PM", $slots)) { ?> <label class="radio inline"> <input type="radio" name="time" value="12:00PM TO 01:00PM"> <span>12:00PM TO 01:00PM (Available)</span> </label> <?php } ?> </div> </div> <input type="submit" class="btnRegister" value="Continue"/> </div> </div> </div> </div> </form> </div> </div> </div> </body> Edited March 4, 2020 by Barand Added code tags
Hello, Hi everyone, I'm trying to get the name of the machine in use. If I use this feature locally, it works.
function visitor_machine_name(){
return $machine_name;
But as soon as I try it on an online server I get the DNS name back, like this:
What can I do? Could Someone Help Me Make A Gumball Machine My Site Is Toxicpets.co.cc And the page is gumballs.php but i need it to give gumballs I am trying to make a gumball machine on my site which gives you a gumball every time you click the button. This is the code I am using to generate a gumball: Code: [Select] <?php $balltype = rand(1,50); if ($balltype = 1) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30978','1','1')"); $gummy = "You won a <b>Blue Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_blue.gif" width="80" height="80" border="0">'; } elseif ($balltype = 2) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30978','1','1')"); $gummy = "You won a <b>Blue Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_blue.gif" width="80" height="80" border="0">'; } elseif ($balltype = 3) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30978','1','1')"); $gummy = "You won a <b>Blue Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_blue.gif" width="80" height="80" border="0">'; } elseif ($balltype = 4) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30978','1','1')"); $gummy = "You won a <b>Blue Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_blue.gif" width="80" height="80" border="0">'; } elseif ($balltype = 5) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30983','1','1')"); $gummy = "You won a <b>Green Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_green.gif" width="80" height="80" border="0">'; } elseif ($balltype = 6) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30983','1','1')"); $gummy = "You won a <b>Green Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_green.gif" width="80" height="80" border="0">'; } elseif ($balltype = 7) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30983','1','1')"); $gummy = "You won a <b>Green Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_green.gif" width="80" height="80" border="0">'; } elseif ($balltype = 8) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30983','1','1')"); $gummy = "You won a <b>Green Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_green.gif" width="80" height="80" border="0">'; } elseif ($balltype = 9) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30985','1','1')"); $gummy = "You won an <b>Orange Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_orange.gif" width="80" height="80" border="0">'; } elseif ($balltype = 10) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30985','1','1')"); $gummy = "You won an <b>Orange Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_orange.gif" width="80" height="80" border="0">'; } elseif ($balltype = 11) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30985','1','1')"); $gummy = "You won an <b>Orange Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_orange.gif" width="80" height="80" border="0">'; } elseif ($balltype = 12) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30985','1','1')"); $gummy = "You won an <b>Orange Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_orange.gif" width="80" height="80" border="0">'; } elseif ($balltype = 13) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30986','1','1')"); $gummy = "You won a <b>Purple Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_purple.gif" width="80" height="80" border="0">'; } elseif ($balltype = 14) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30986','1','1')"); $gummy = "You won a <b>Purple Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_purple.gif" width="80" height="80" border="0">'; } elseif ($balltype = 15) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30986','1','1')"); $gummy = "You won a <b>Purple Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_purple.gif" width="80" height="80" border="0">'; } elseif ($balltype = 16) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30986','1','1')"); $gummy = "You won a <b>Purple Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_purple.gif" width="80" height="80" border="0">'; } elseif ($balltype = 17) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30990','1','1')"); $gummy = "You won a <b>Yellow Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_yellow.gif" width="80" height="80" border="0">'; } elseif ($balltype = 18) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30990','1','1')"); $gummy = "You won a <b>Yellow Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_yellow.gif" width="80" height="80" border="0">'; } elseif ($balltype = 19) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30990','1','1')"); $gummy = "You won a <b>Yellow Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_yellow.gif" width="80" height="80" border="0">'; } elseif ($balltype = 20) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30990','1','1')"); $gummy = "You won a <b>Yellow Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_yellow.gif" width="80" height="80" border="0">'; } elseif ($balltype = 21) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30981','1','1')"); $gummy = "You won a <b>Cola Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_cola.gif" width="80" height="80" border="0">'; } elseif ($balltype = 22) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30981','1','1')"); $gummy = "You won a <b>Cola Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_cola.gif" width="80" height="80" border="0">'; } elseif ($balltype = 23) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30981','1','1')"); $gummy = "You won a <b>Cola Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_cola.gif" width="80" height="80" border="0">'; } elseif ($balltype = 24) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30979','1','1')"); $gummy = "You won a <b>Chocolate Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_bronze.gif" width="80" height="80" border="0">'; } elseif ($balltype = 25) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30979','1','1')"); $gummy = "You won a <b>Chocolate Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_bronze.gif" width="80" height="80" border="0">'; } elseif ($balltype = 26) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30979','1','1')"); $gummy = "You won a <b>Chocolate Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_bronze.gif" width="80" height="80" border="0">'; } elseif ($balltype = 27) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30984','1','1')"); $gummy = "You won an <b>Ice Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_ice.gif" width="80" height="80" border="0">'; } elseif ($balltype = 28) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30984','1','1')"); $gummy = "You won an <b>Ice Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_ice.gif" width="80" height="80" border="0">'; } elseif ($balltype = 29) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30984','1','1')"); $gummy = "You won an <b>Ice Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_ice.gif" width="80" height="80" border="0">'; } elseif ($balltype = 30) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30987','1','1')"); $gummy = "You won a <b>Rock Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_rock.gif" width="80" height="80" border="0">'; } elseif ($balltype = 31) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30987','1','1')"); $gummy = "You won a <b>Rock Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_rock.gif" width="80" height="80" border="0">'; } elseif ($balltype = 32) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30987','1','1')"); $gummy = "You won a <b>Rock Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_rock.gif" width="80" height="80" border="0">'; } elseif ($balltype = 33) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30988','1','1')"); $gummy = "You won a <b>Strawberry Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_strawberry.gif" width="80" height="80" border="0">'; } elseif ($balltype = 34) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30988','1','1')"); $gummy = "You won a <b>Strawberry Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_strawberry.gif" width="80" height="80" border="0">'; } elseif ($balltype = 35) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30988','1','1')"); $gummy = "You won a <b>Strawberry Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_strawberry.gif" width="80" height="80" border="0">'; } elseif ($balltype = 36) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30980','1','1')"); $gummy = "You won a <b>Dark Chocolate Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_chocolate2.gif" width="80" height="80" border="0">'; } elseif ($balltype = 37) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30980','1','1')"); $gummy = "You won a <b>Dark Chocolate Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_chocolate2.gif" width="80" height="80" border="0">'; } elseif ($balltype = 38) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30977','1','1')"); $gummy = "You won a <b>Black Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_black.gif" width="80" height="80" border="0">'; } elseif ($balltype = 39) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30977','1','1')"); $gummy = "You won a <b>Black Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_black.gif" width="80" height="80" border="0">'; } elseif ($balltype = 40) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30982','1','1')"); $gummy = "You won a <b>Digital Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_digital.gif" width="80" height="80" border="0">'; } elseif ($balltype = 41) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30982','1','1')"); $gummy = "You won a <b>Digital Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_digital.gif" width="80" height="80" border="0">'; } elseif ($balltype = 42) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30989','1','1')"); $gummy = "You won a <b>Silver Gumball</b>."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gum_silver.gif" width="80" height="80" border="0">'; } elseif ($balltype = 43) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30991','1','1')"); $gummy = "You won a <b>Burnt Gumball</b>. Ur... Well done..."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gumball_burnt.gif" width="80" height="80" border="0">'; } elseif ($balltype = 44) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30991','1','1')"); $gummy = "You won a <b>Burnt Gumball</b>. Ur... Well done..."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gumball_burnt.gif" width="80" height="80" border="0">'; } elseif ($balltype = 45) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30991','1','1')"); $gummy = "You won a <b>Burnt Gumball</b>. Ur... Well done..."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gumball_burnt.gif" width="80" height="80" border="0">'; } elseif ($balltype = 46) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30991','1','1')"); $gummy = "You won a <b>Burnt Gumball</b>. Ur... Well done..."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gumball_burnt.gif" width="80" height="80" border="0">'; } elseif ($balltype = 47) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30991','1','1')"); $gummy = "You won a <b>Burnt Gumball</b>. Ur... Well done..."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gumball_burnt.gif" width="80" height="80" border="0">'; } elseif ($balltype = 48) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30991','1','1')"); $gummy = "You won a <b>Burnt Gumball</b>. Ur... Well done..."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gumball_burnt.gif" width="80" height="80" border="0">'; } elseif ($balltype = 49) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30991','1','1')"); $gummy = "You won a <b>Burnt Gumball</b>. Ur... Well done..."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gumball_burnt.gif" width="80" height="80" border="0">'; } elseif ($balltype = 50) { mysql_query("INSERT INTO usersitems2 (owner,item_id,parts_left,game) VALUES ('$userid','30991','1','1')"); $gummy = "You won a <b>Burnt Gumball</b>. Ur... Well done..."; $picture = '<img src="http://www.bubblemagic.co.cc/images/gumballs/gumball_burnt.gif" width="80" height="80" border="0">'; } else { $gummy = "Nooooooooo!!!!! The gumball machine is broken!!! It still took your money though..."; } ?> Every time I try it, it gives me a burnt gumball EDIT: All that CODE hurts.... use some CODE formatting for godsakes. Is there a way to get my visitors PC or Device Name? I am not looking for server name or ip. I need to get my current visitors computer name. Example: MAIN, HOME, OFFICE, TOM32154}}{|\] like when first naming a PC with a new windows install. I am working on a task where the user of the webpage can amend to a text file, but when I try it on Windows, I get messages such as Warning: fopen(C: mpp\htdocs cm\denman2.txt) [function.fopen]: failed to open stream: Invalid argument in C:\xampp\htdocs\amendfile.php on line 8 Warning: fputs() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\amendfile.php on line 10 Warning: fclose() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\amendfile.php on line 11 And nothing is appended. I don't know what the problem is, considering the only aspect I really changed was the file path since I was using Ubuntu to try to accomplish this. Here is the coding of my Amend File Script: Code: [Select] <html> <head><title>Amend File</title></head> <?php if($_POST['append'] !=null) { $filename="C:\xampp\htdocs\rcm\denman2.txt"; $file=fopen($filename, "a"); $msg="Updated Information: " .$_POST['append']. "<br>"; fputs ($file, $msg); fclose($file); } ?> <body> <h1>Do you want to append to a document?</h1> Enter Updated Information: <form action="amendfile.php" method="post"> <input type="text" size="40" name="append"><br><br> <input type="submit" value="Add name to report"> </form> <form action="viewfile.php" method="post"> <input type="submit" value="View Web Blog"> </form> <a href="viewfile.php">View Web Blog</a></body></html> Any help is appreciated! Hello, I am wondering if there is any way with PHP to get a list of the processes running on the client that hits the PHP server script. If that is not possible, is there a way I have have my PHP script do an 'exec' call on something that will do it? Thanks Mike hello and good day dear php-freaks which is the passwd for the mysql db run opensuse - therein i have installed a myql serfver and an apache now i want to port over a cms-system from a server to the localhost. question: the passwd of the configuriatin of the cms has got the following db connecgtion host : localhost db-name db-passwd question: does the db passwd need to match the passwd of the local mysql server!? is this true love to hear from you helo dear linux experts my girlfriend runs a windows 8.0 she claims that sometimes the wlan access gets lost. Despite the fact that the notebook (lenovo g 780) just is very close to the wlan router. question: how to make sure that windows 8 does not corrupt wlan access? hello dear php-experts i run opensuse 13-2 and i am very very happy the time does not get displayed correct. it falls back to UTC all day. What can i do. i have had look at the documents here https://en.opensuse....uring_the_clock https://tr.opensuse....T_Date_and_Time how to set up correct to the local time - note i live in GERMANY near francfurt In php.ini on my local development server, error_reporting is set to Quote error_reporting = E_ALL | E_STRICT And I get no errors. However, on the remote web server I found a bunch of warnings in the error log. I fixed most of them, but this error/warning should have popped up on my development console: Quote [02-Dec-2011 17:47:22] PHP Warning: array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in /home/bpslk/public_html/cart-checkout.php on line 177 [02-Dec-2011 17:47:22] PHP Warning: Invalid argument supplied for foreach() in /home/bpslk/public_html/cart-checkout.php on line 177 I can fix the code to eliminate the warning, no prob. But why am I NOT seeing this error on my development machine? --Thanks --HarryG Is it possible to read from a file that is located on the user's local machine and not on the server? I have a CSV file that is about 70MB that I have to parse through and insert the data into a database. I have no problem doing this if I hard code the path to the file. Is there a way to get the path of the file that the user wants to be parsed into the database? I don't think uploading the file would be a good idea because, like I said, it is 70MB and is nearly 2 million lines. Simply parsing the file takes long enough without throwing in upload time.. This topic has been moved to Other Web Server Software. http://www.phpfreaks.com/forums/index.php?topic=347581.0 I am new to php and starting to write my first programs. I have a laptop (my local pc) and I am wondering if there is some kind of php-interpreter available so I can test them out on my local machine without having to upload them to my website? Is there anyway I can avoid having to install a web-sever on my machine? Is there an all-in-one php interpreter? (someone suggested something called Xampp, - is this the best?) thanks,, Hello, I need help with php, I don't understand what that could be , otherwise I run the page via a wampserver, I would be grateful for any kind of help. Hey guys I usually code in C and I started looking into PHP which I think is pretty good. I'm wondering if there's a function that can be used to execute a command from a remote server on my local machine??? As example if I'd like to have a PHP page/script running on my server which when logged onto would display me a page with buttons like "PING, NETSTAT, IPCONFIG, TRACERT" and when clicked on it would exec those commands but not on the server but from my machine??? So that I would get the PING from my local machine to google.com instead of from the server to google.com ??? making any sense ??? thanks |