Jump to content

soupy127

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

Everything posted by soupy127

  1. thanks alot again for all your help, your a life saver!!
  2. getting this error Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\Final\adminbookingform.php on line 88 Message sent think it might go away when i upload it to my website, hopefully that will fix the problem !
  3. really sorry chum, but still nothing ! thanks alot again for your help.
  4. thanks very much for your reply, I copy and pasted your code and nothing seemed to happen, i entered a test email address which is my own and it didnt seem to do anything ! thanks for your help again
  5. I have this form set up <form action="emailbooking.php" method="send"> <table> <tr> <td>Name:</td> <td> <input type="text" name="name" value="" maxlength="100" /></td> </tr> <tr> <tr><td>To:</td> <td><select name="email"> <option value ="info@royalportrushgolfclub.com">Royal Portrush Golf Club</option> <option value ="golf@royalcountydown.org">Royal County Down Golf Club</option> <option value ="bill@portstewartgc.co.uk">Portstewart Golf Club</option> <option value ="moyolapark@btconnect.com ">Moyola Park Golf Club</option> <option value ="info@belvoirparkclubhouse.co.uk">Belvoir Park Clubhouse</option> <option value ="info@castlerockgc.co.uk">Castle Rock Golf Club</option> <option value ="info@ardglassgolfclub.com">Ardglass Golf Club</option> </select></td> <tr><td>From(Email Address): </td> <td> <input type="text" name="emailfrom" value="" maxlength="200" /></td> </tr> <tr><td>Subject: </td> <td> <input type="text" name="subject" value="" maxlength="75" /></td> </tr> <tr> <td>Query:</td> <td> <textarea rows="3" cols="20" name="query"></textarea></td> </tr> <tr><td> </td> <td> <input type="submit" value="Send" /></td> </tr> </table> just wandering how I can make the from send to whatevery email address the user selects from the drop down menu?? any ideas, any help would be greatly appreciated !! thanks
  6. Thanks alot for your help i just got it working there ! thanks again! oh just one more question while im logged on, how would i go about creating a dropdown list, that would be populated by the usernames from my users table, so that when the admin selects the username from the dropdown table it will display their results ? and can it be linked with another another drop down men (i.e. name of course?) im not to sure how to use the join function !
  7. sorry im abit of a noob when it comes to php haha, should echoing the data again after it has been submitted update the database ?
  8. I have an updatemember.php, and updatemember2.php. the first updatemember.php calls the info from the database using the session function and displays it into a form where the user can enter the details. Once the user is happy he clicks the update button which updatemember2.php is susposed to update in the database but it is currently just saying record updated but doesnt change the values in the database ? here are the scripts below. please help ! updatemember.php <?php session_start(); if (isset($_SESSION['username'])) { //the username exists echo "Welcome, ".$_SESSION['username']."!<br> <a href='logout.php'>Logout</a>"; } else die("Sorry but you must be logged in to view this Area"); ?> <?php $con = mysql_connect("localhost", "root", ""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("duffers", $con); $result = mysql_query("SELECT * FROM users WHERE username = '$_SESSION[username]'"); while($row = mysql_fetch_array($result)) { $x1 = $row['username']; $x2 = $row['name']; $x3 = $row['contactnumber']; $x4 = $row['email']; $x5 = $row['handicap']; } mysql_close($con); ?> <form method="post" action="updatemember2.php"> Username: <input type="text" name="username" value="<?php echo $x1; ?>"> <br> Name: <input type="text" name="name" value="<?php echo $x2; ?>"> <br> Contact Number: <input type="text" name="contactnumber" value="<?php echo $x3; ?>"> <br> Email: <input type="text" name="email" value="<?php echo $x4; ?>"> <br> Handicap: <input type="text" name="handicap" value="<?php echo $x5; ?>"> <br> <br><input type="submit" value="Update"> </form> and updatemember2.php <?php session_start(); if (isset($_SESSION['username'])) { //the username exists echo "Welcome, ".$_SESSION['username']."!<br> <a href='logout.php'>Logout</a>"; } else die("Sorry but you must be logged in to view this Area"); ?> <?php $con = mysql_connect("localhost", "root", ""); $username =$_POST['username']; $name =$_POST['name']; $contactnumber =$_POST['contactnumber']; $email =$_POST['email']; $handicap =$_POST['handicap']; if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("duffers", $con); mysql_query("UPDATE users SET username = '$_POST[username]', name = '$_POST[name]', contactnumber = '$_POST[contactnumber]', email = '$_POST',handicap = '$_POST[handicap]' WHERE username = '$_POST[username]'"); echo "Record updated!"; mysql_close($con); ?>
  9. Have 2 problems that i am currently having trouble with and i have to have these sorted by monday so stressing out, the first is I have a table called users and a table called courses (golf courses) so goin to make a results table combining both so that it can display the users result for that specific course. Wanting to have on the webpage 2 list boxes so that the admin can select the user from the first list and then select the course from the second list and then it will display the users result for that course? just wandering how i would go about doing this... the 2nd question is that I have put the website up on to a free hosting website and they gave me a connect url for phpmyadmin so that my database will work with the site, but when the php scripts are coming up duffers.users table does not exist? (duffers being the name of the database and users being the name of the table) but it seems like it is connecting to the database but just isnt recognising the tables :S any ideas? PLZZZZ Help im desperate haha. it will be greatly appreciated.
  10. Thanks for your reply Ken2k7 ! Im going to change of the variables tonight to see if it works and use that code you provided for the php self, and i will report back what happens ! hopefully it will work ok. thanks very much again !
  11. Hello there ! I am currently designing a golf website for my final year project. What i am hoping to do is have is 2 drop down lists, one with the golfers names and the other with the name of the course (both of these list will be fed from the mysql database). then i want the user to be able to hit submit and it displaying that golfers results for that course? any ideas how i would go about structuring the databases? and how i would go about coding the query?? any help would be greatly appreciatied as i dont even know were to start ! haha please help thanks
  12. here is also the database code to set up the table, if anyone wants to try it for themselves ! [attachment deleted by admin]
  13. soz that was the wrong class.file, as i have been trying to edit that one. here is the orignal, sorry again. I think the script itself should be ok as I think a few people on this site have it working, just not working for me for some reason :S haha i tried changing if($_POST['user']){ $user=$_POST['user']; to if(!empty($_POST['user'])){ $user = empty($_POST['user']); and the undefined error for user went away, should i do this for each of the variables? or is that coding wrong ! [attachment deleted by admin]
  14. yep have indeed ! I used the sql file that came with it ! Heres the code hope this helps [attachment deleted by admin]
  15. Hello there ! I am currently designing a golf website for my final year project. What i am hoping to do is have is 2 drop down lists, one with the golfers names and the other with the name of the course (both of these list will be fed from the mysql database). then i want the user to be able to hit submit and it displaying that golfers results for that course? any ideas how i would go about structuring the databases? and how i would go about coding the query?? any help would be greatly appreciatied as i dont even know were to start ! haha please help thanks
  16. Thanks alot guys for all the replys and all your help !! I tried de.monkeyz solution and it is working brilliantly now ! Thanks alot again !!
  17. Tried your solution ! and got Notice: Undefined index: post in C:\wamp\www\Final\post.php on line 64 I dont understande why my orignal code isnt working as i have declared the body part of the form 'body' and the actual code is adding it to the database, but still get the error :S kind of weird. Body:<br> <textarea rows='6' cols='35' name='body'></textarea><p> Notice: Undefined index: body in C:\wamp\www\Final\post.php on line 69 :S thanks again for your help!!
  18. lol thanks, i replaced it with this $gh->setupdb('root','','duffers'); and still getting the errors Notice: Undefined index: user in C:\wamp\www\handicap system\agolfhandicap.php on line 19 Notice: Undefined index: delete in C:\wamp\www\handicap system\agolfhandicap.php on line 23 Notice: Undefined index: edit in C:\wamp\www\handicap system\agolfhandicap.php on line 27 Notice: Undefined variable: PHP_SELF in C:\wamp\www\handicap system\agolfhandicap.php on line 32 thanks again for your help !!
  19. Hello there, please help if you can ive created a post form for posting news into my msql database and a news.php to view it. It is all working perfectly but for some reason an error keeps appearing. Here is the code below <?php if ($_POST['post']) { //get data $title = $_POST['title']; $body = $_POST['body']; //Check for existance if ($title&&$body) { //insert data mysql_connect("localhost","root","") or die (mysql_error()); mysql_select_db("duffers") or die(mysql_error()); $date = date("y-m-d"); $insert = mysql_query("INSERT INTO news VALUES ('','$title','$body','$date')") or die(mysql_error()); die("Your news has been posted!!"); } else echo "Please fill out Title and Body <p>"; } ?> <form action ='post.php' method='POST'> Title:<br> <input type='text' name='title'><p> Body:<br> <textarea rows='6' cols='35' name='body'></textarea><p> <input type='submit' name='post' value='Post this news'> </form> and the error im getting is Notice: Undefined index: body in C:\wamp\www\Final\post.php on line 69 any ideas :S? thanks for the help
  20. Thanks for the reply ! When i edit the funtion to look like this $gh->setupdb('localhost','root','duffers'); duffers being the name of the database. I get these errors Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'localhost'@'localhost' (using password: YES) in C:\wamp\www\handicap system\class.agolfhandicap.php on line 65 Notice: Undefined index: user in C:\wamp\www\handicap system\agolfhandicap.php on line 19 Notice: Undefined index: delete in C:\wamp\www\handicap system\agolfhandicap.php on line 23 Notice: Undefined index: edit in C:\wamp\www\handicap system\agolfhandicap.php on line 27 Notice: Undefined variable: PHP_SELF in C:\wamp\www\handicap system\agolfhandicap.php on line 32 if i click the submit button i get even more errors !! please help if you can !! thanks again.
  21. Sorry im useless at this, is this what you where looking for? as when i change these values to localhost, root, duffers i get errors ! include "class.agolfhandicap.php"; $gh=new agolfhandicap(); // ######### Edit the next line to put your MySQL username, password, and database name. ######## $gh->setupdb('username','password','databasename'); thanks for the help again
  22. Sorry I dont have the config file as it is actually from a Golf handicap script that is free from a website. The entire code has been attached hope this helps ! [attachment deleted by admin]
  23. Thanks for your help !! but wanted to know were to put localhost, root and duffers (which is the name of the database) do i have to remove the password variable as there is no password? i.e. tried this but got errors , function setupdb($dbuser,$pw,$dbase) { $this->localhost=$dbuser; $this->''=$pw; $this->duffers=$dbase; $this->db = mysql_connect('localhost',$dbuser,$pw); } thanks for your help!!
  24. Hi just wandering if anybody could help me edit this connect file so that it works with Loccalhost, root and duffers as the name of the db? function setupdb($dbuser,$pw,$dbase) { $this->dbuser=$dbuser; $this->pw=$pw; $this->dbase=$dbase; $this->db = mysql_connect('localhost',$dbuser,$pw); } Everytime i edit it i get errors ! could somebody help me please?
×
×
  • 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.