
tebrown
Members-
Posts
114 -
Joined
-
Last visited
Everything posted by tebrown
-
Yup i just did that, but when you apply a position: fixed to it, it then doesn't push the left section, middle section, and right section down. It just goes overtop of it. http://jsfiddle.net/tebrown/fwgPJ/31/
-
When you click on the 'DROPDOWN' div, and then you scroll down, the white class (.hidden1) also goes behind it aswell. This needs to stay fixed. Cheers
-
Hey Guys, Ok this is really annoying me. I have provided a link, which shows the problem i have ran into. Basically when you mouse click the "DROPDOWN" div, another div drops down. This part works fine. The issue that i have is when you scroll down this div goes with the middle content. What i want is the middle section (place holder text) to scroll as normal, with the 'DROPDWON' div fixed so that it doesnt move. This would allow the placeholder text to scroll behind it. http://jsfiddle.net/tebrown/fwgPJ/4/ * Please excuse the messy code. Testing purposes. Cheers
-
Hey Guys, I have attached a link which shows my jsFiddle document. Basically what is happening is when i press the (x) on the right hand side, it closes all divs. I am trying to make it just close the specific one. Anyone be able to help me out? http://jsfiddle.net/tebrown/baCrx/ * Please excuse the messy css, i just copied it from my document as is. Cheers Browny
-
I've got the results i need, although if there a NO results, i want it to display the echo message.
-
Hey Guys, Im having problems with my code. What im trying to do is run a mysql query and show the results, but if the query returns no data, echo out "No incoming requests!" Here is my code: <? $check = "SELECT * FROM requests WHERE club='" . $_SESSION['club'] . "' AND team='" . $_SESSION['team'] . "' AND accepted='0'"; $result=mysql_query($check); if (mysql_num_rows($result) == 0) { while ($getinfo = mysql_fetch_array($result)) { $time = $getinfo["time"]; $who = $getinfo["player_name"]; $whofor = $getinfo["toplayfor"]; $from = $getinfo["team"]; $idp = $getinfo["player_id"]; echo "<a href='profile.php?id=".$idp."&team=".$from."'>".$who." </a><div style='float:right;'>(".$from.")</div><br />"; echo "<div style='margin-top: 2px;'></div>"; echo date('l, F jS, g:ia',$time); echo "<br /><div style='margin-top: 2px;'></div><a href='accept.php?playerid=".$idp."&toplayfor=".$whofor."'>Accept</a> | Decline"; echo "<div id='newsline'></div>"; } } else { echo 'No incoming requests'; } ?> Could someone help me out here? Thanks Heaps!
-
Hey Guys, I've come across this error and yes i have tried to google it but haven't come across any help. Any suggestions? Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'As WHERE id='34'' at line 1 <?php $player_id=$_GET['playerid']; $toplayfor=$_GET['team']; $move=mysql_query("UPDATE users SET team=$toplayfor WHERE id='$player_id'") or die(mysql_error()); if($move) { header('Location: players.php'); } ?>
-
Im currently working on a new feature called 'Request Player'. Basically what this does is allows managers to request players within their club for a upcoming fixture. There a multiple teams within a club (Senior As, Senior Bs, Colts U21s). Each team is controlled by a manager. And then they can add players as they need. Anyway, I'm having problems with the sql JOIN. I have currently got this: $check = "SELECT u.* FROM users AS u LEFT JOIN requests AS r ON (u.id = r.player_id) WHERE (u.id = r.player_id)"; I have got two tables. users - all the managers and players. requests - all the requests the managers make to other teams within their club. In the request table i have got this: id player_id - the players that has been requested. fixture_id - the fixture the manager wants to have that player for. accepted - if he has been accepted or not. This comes later on. At the moment i have got it working so that it inserts this data, although the code is working but i want to have a mysql query that checks if a manager has any incoming requests from other teams within the club. BUT only request that has been made to his team.... Could someone please help me out?
-
Ok, i tried, but failed. I followed your method but not getting anywhere. Im having no errors, but its just not holding the value when i press submit... <?php $id=$_GET['id']; $sql="SELECT * FROM fixtures WHERE id=$id AND club='$club' AND team='$team'"; $result=mysql_query($sql); $row=mysql_fetch_array($result); $selectplayers="SELECT * FROM players WHERE club='$club' AND team='$team' ORDER by lname DESC"; $player=mysql_query($selectplayers); $option_str = ''; while($rowplayer = mysql_fetch_array($player)) { $fname=$rowplayer["fname"]; $lname=$rowplayer["lname"]; $option_str .= "<OPTION VALUE=\"$fname $lname\">$fname $lname</OPTION>"; } ?> <form id="form" action="lineup.php?id=<? echo $row['id']; ?>" name="lineup" method="post"> <table class='lineups' width="560" cellpadding="5"> <tr> <td colspan="2">Starting Lineup</td> <td colspan="2">On the Bench</td> </tr> <tr> <td width="119"> </td> <td width="160"> </td> <td width="69"> </td> <td width="160"> </td> </tr> <tr> <td>Prop</td> <td><select name="prop1" style="width: 150px"> <option <?php if(isset($_POST['prop1']) && $_POST['prop1'] == "prop1"){echo 'selected="selected"';}?>><?php echo $option_str; ?></option> </select></td> <td>16.</td> <td><select name="r16" style="width: 150px"> <option value="<? echo $row['r16']; ?>"><? if (empty($row['r16'])) { echo "Select Player"; } else { echo $row['r16']; } ?></option> <?php echo $option_str; ?> </select></td> </tr> </table><br /><br /> <input type="submit" name="lineup" value="Save Lineup" />
-
Thanks for the reply. Im working with multiple drop down lists. That is what the $options_str variable if for. <?php $id=$_GET['id']; $sql="SELECT * FROM fixtures WHERE id=$id AND club='$club' AND team='$team'"; $result=mysql_query($sql); $row=mysql_fetch_array($result); $selectplayers="SELECT * FROM players WHERE club='$club' AND team='$team' ORDER by lname DESC"; $player=mysql_query($selectplayers); $option_str = ''; while($rowplayer = mysql_fetch_array($player)) { $fname=$rowplayer["fname"]; $lname=$rowplayer["lname"]; $option_str .= "<OPTION VALUE=\"$fname $lname\">$fname $lname</OPTION>"; } ?> And i see what you mean by 'two identical items in your dropdown'. This is currently happening. I will give it a shot and get back to you. Cheers.
-
Thanks for replying, i tried this but doesnt seem to work? <td>Prop</td> <td><select name="prop1" style="width: 150px"> <option <?php if (isset($_POST['prop1'])) { print ' value="' . $_POST['prop1'] . '"'; } ?>><? if (empty($row['prop1'])) { echo "Select Player"; } else { echo $row['prop1']; } ?></option> <?php echo $option_str; ?> </select></td>
-
Hey Guys, Im working with a form and need some help. So at the moment i have got it working so that if the user doesn't select the values from the drop down list, an error will occur saying 'Please select all fields'. What i want to do now is make it so that if this error occurs, the value of the drop down list will stay as it is an NOT reset. Could someone help me out? * Note that the code below is currently ok, basically it checks if there is a value, if not it will say "Select Player". <td>Prop</td> <td><select name="prop1" style="width: 150px"> <option value="<? echo $row['prop1']; ?>"><? if (empty($row['prop1'])) { echo "Select Player"; } else { echo $row['prop1']; } ?></option> <?php echo $option_str; ?> </select></td> <td>16.</td> <td><select name="r16" style="width: 150px"> <option value="<? echo $row['r16']; ?>"><? if (empty($row['r16'])) { echo "Select Player"; } else { echo $row['r16']; } ?></option> <?php echo $option_str; ?> </select></td>
-
Let me explain. I've got a table in my database called 'fixtures'. I have already input 2 fixtures within the 'fixtures' table. (Have a look at first screenshot). Now with the script below i want to UPDATE that fixture and insert the players (1,2,3...20,21,22). These players will be selected from my 'players' table. Thats why i have been asking the following questions regarding how to get the players into the drop down list. <?php $id = $_GET['id']; $selectplayers="SELECT * FROM players WHERE club='$club' AND team='$team' ORDER by lname DESC"; $player=mysql_query($selectplayers); $option_str = ''; while($rowplayer = mysql_fetch_array($player)) { $option_str .= '<option value='. $rowplayer['fname'] . ' ' . $rowplayer['lname'] .'>'.$rowplayer['fname'].' '.$rowplayer['lname'].'</option>'; } ?> <form id="form" action="fixtures.php" name="lineup" method="post"> <table class='lineups' width="560" cellpadding="5"> <tr> <td colspan="2">Starting Lineup</td> <td colspan="2">On the Bench</td> </tr> <tr> <td width="119"> </td> <td width="160"> </td> <td width="69"> </td> <td width="160"> </td> </tr> <tr> <td>Prop</td> <td><select name="1" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> <td>16.</td> <td><select name="16" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> </tr> <tr> <td style="padding-top: 8px;">Hooker</td> <td style="padding-top: 8px;"><select name="2" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> <td style="padding-top: 8px;">17.</td> <td style="padding-top: 8px;"><select name="17" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> </tr> <tr> <td style="padding-top: 8px">Prop</td> <td style="padding-top: 8px"><select name="3" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> <td style="padding-top: 8px;">18.</td> <td style="padding-top: 8px;"><select name="18" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> </tr> <tr> <td style="padding-top: 8px;">Lock</td> <td style="padding-top: 8px;"><select name="4" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> <td style="padding-top: 8px;">19.</td> <td style="padding-top: 8px;"><select name="19" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> </tr> <tr> <td style="padding-top: 8px;">Lock</td> <td style="padding-top: 8px;"><select name="5" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> <td style="padding-top: 8px;">20.</td> <td style="padding-top: 8px;"><select name="20" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> </tr> <tr> <td style="padding-top: 8px;">Blindside Flanker</td> <td style="padding-top: 8px;"><select name="6" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> <td style="padding-top: 8px;">21.</td> <td style="padding-top: 8px;"><select name="21" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> </tr> <tr> <td style="padding-top: 8px;">Openside Flanker</td> <td style="padding-top: 8px;"><select name="7" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> <td style="padding-top: 8px;">22.</td> <td style="padding-top: 8px;"><select name="22" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> </tr> <tr> <td style="padding-top: 8px;">Number 8</td> <td style="padding-top: 8px;"><select name="8" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> <td> </td> <td> </td> </tr> <tr> <td style="padding-top: 8px;">Scrum Half</td> <td style="padding-top: 8px;"><select name="9" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> <td style="padding-top: 8px;">Kicker</td> <td style="padding-top: 8px;"><select name="23" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> </tr> <tr> <td style="padding-top: 8px;">Fly Half</td> <td style="padding-top: 8px;"><select name="10" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> <td style="padding-top: 8px;">Captain</td> <td style="padding-top: 8px;"><select name="24" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> </tr> <tr> <td style="padding-top: 8px;">Left Wing</td> <td style="padding-top: 8px;"><select name="11" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> <td> </td> <td> </td> </tr> <tr> <td style="padding-top: 8px;">Inside Centre</td> <td style="padding-top: 8px;"><select name="12" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> <td> </td> <td> </td> </tr> <tr> <td style="padding-top: 8px;">Outside Centre</td> <td style="padding-top: 8px;"><select name="13" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> <td> </td> <td> </td> </tr> <tr> <td style="padding-top: 8px;">Right Wing</td> <td style="padding-top: 8px;"><select name="14" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> <td> </td> <td> </td> </tr> <tr> <td style="padding-top: 8px;">Fullback</td> <td style="padding-top: 8px;"><select name="15" style="width: 150px"> <option>Select Player</option> <?php echo $option_str; ?> </select></td> <td> </td> <td> </td> </tr> </table> <input type="submit" name="lineup" value="Save Lineup" /> <?php if (isset($_POST['submit'])) { $prop1 = trim($_POST['1']); $hooker = trim($_POST['2']); $prop3 = trim($_POST['3']); $lock4 = trim($_POST['4']); $lock5 = trim($_POST['5']); $blindside = trim($_POST['6']); $openside = trim($_POST['7']); $number8 = trim($_POST['8']); $scrumhalf = trim($_POST['9']); $flyhalf = trim($_POST['10']); $leftwing = trim($_POST['11']); $inside = trim($_POST['12']); $outside = trim($_POST['13']); $rightwing = trim($_POST['14']); $fullback = trim($_POST['15']); $r16 = trim($_POST['16']); $r17 = trim($_POST['17']); $r18 = trim($_POST['18']); $r19 = trim($_POST['19']); $r20 = trim($_POST['20']); $r21 = trim($_POST['21']); $r22 = trim($_POST['22']); if (empty($_POST['1']) || empty($_POST['2'])) { echo "<div id='error'>Please fill out Prop and Hooker</div>"; } else { $query = mysql_query("UPDATE fixtures WHERE id='$id' ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22') VALUES ('$prop1','$hooker','$prop3','$lock4','$lock5','$blindside','$openside','$number8','$scrumhalf','$flyhalf','$leftwing','$inside','$outside','$rightwing','$fullback','$r16','$r17','$r18','$r19','$r20','$r21','$r22')"); if($query) { return true; } else { throw new Exception(mysql_error()); return false; } } } ?>
-
Thanks, how would i make it so that the value of each dropdown will be the one i select in the actual dropdown itself? So then i can then insert that into the database. Cheers
-
Thanks for the reply. I gave it a go, although im having trouble again. At the moment, its populating the first dropdown list, but now i want to populate another. Although its not working.... is this right? <? $selectplayers="SELECT * FROM players WHERE club='$club' AND team='$team'"; $player=mysql_query($selectplayers); ?> <table class='lineups' width="560" cellpadding="5"> <tr> <td colspan="2">Starting Lineup</td> <td colspan="2">On the Bench</td> </tr> <tr> <td width="119"> </td> <td width="160"> </td> <td width="69"> </td> <td width="160"> </td> </tr> <tr> <td>Prop</td> <td><select name="secondary" style="width: 150px"> <? while($rowplayer = mysql_fetch_array($player)) { ?> <option value=''><?php echo $rowplayer['fname']; ?></option> </select></td> <td>16.</td> <td><select name="secondary16" style="width: 150px"> <? while($rowplayer = mysql_fetch_array($player)) ?> <option value=''><?php echo $rowplayer['fname']; } ?></option> </select></td> </tr>
-
Hey Guys, I know it may seem pretty simple, but im having trouble populating a drop down list. Here is my code at the moment, but what it's doing is displaying the names all in one value, where it should be in separate select values. *Note that i have only done it to the first one. See attachment. 'AntonMatt' are next to each other, they should be separate select values. <? $id = $_GET['id']; $selectplayers="SELECT * FROM players WHERE club='$club' AND team='$team'"; $player=mysql_query($selectplayers); ?> <table class='lineups' width="560" cellpadding="5"> <tr> <td colspan="2">Starting Lineup</td> <td colspan="2">On the Bench</td> </tr> <tr> <td width="119"> </td> <td width="160"> </td> <td width="69"> </td> <td width="160"> </td> </tr> <tr> <td>Prop</td> <td><select name="secondary" style="width: 150px"> <option value='' selected="selected"><? while($rowplayer = mysql_fetch_array($player)) { echo $rowplayer['fname']; } ?></option> </select></td> <td>16.</td> <td><select name="secondary16" style="width: 150px"> <option value='' selected="selected">Secondary Position</option> </select></td> </tr> <tr> <td style="padding-top: 8px;">Hooker</td> <td style="padding-top: 8px;"><select name="secondary2" style="width: 150px"> <option value='' selected="selected">Secondary Position</option> </select></td> <td style="padding-top: 8px;">17.</td> <td style="padding-top: 8px;"><select name="secondary17" style="width: 150px"> <option value='' selected="selected">Secondary Position</option> </select></td> </tr> </table> </div> </div>
-
Hey Guys, Im currently working on this sport management system where managers can control their team. At the moment im trying to add a feature where if a player is injured on your team, the manager can click an 'injury' button and say how long he will be injured for. Although, what i would like to do with this feature is when it's stored into the database i want to make it so that when his injury time runs out he will become available again (not injured). How would i go about doing this feature? Cheers Browny
-
Cheers Mate
-
Hey Guys, I am having some trouble trying to figure this out. It is saying this error: Caught exception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary, secondary) VALUES ('Bob', 'Brown', '[email protected]', '87e6a5baa4' at line 1 Notice: Undefined variable: result in /Users/Tim/Sites/FINALRM/players.php on line 158 Error Adding Player The form code is this: <form id="form" action="players.php" name="addplayer" method="post"><div style='margin-top: 10px;'></div> First Name: <br /><input class="form" type="text" name="fname" size="32" <?php if (isset($_POST['fname'])) { print ' value="' . $_POST['fname'] . '"'; } ?>/> <div id='spacing'></div> Last Name: <br /><input class="form" type="text" name="lname" size="32" <?php if (isset($_POST['lname'])) { print ' value="' . $_POST['lname'] . '"'; } ?>/> <div id='spacing'></div> Email: <br /><input class="form" type="text" name="email" size="32" <?php if (isset($_POST['email'])) { print ' value="' . $_POST['email'] . '"'; } ?>/> <div id='spacing'></div> Mobile: <br /><input class="form" type="text" name="number" size="32" <?php if (isset($_POST['number'])) { print ' value="' . $_POST['number'] . '"'; } ?>/> <div style='margin-top: 10px;'></div> <select name="primary" style="width: 190px"> <option>Primary Position</option> <option value="1">Loosehead Prop</option> <option value="2">Hooker</option> <option value="3">Tighthead Prop</option> <option value="4">Lock</option> <option value="5">Lock</option> <option value="6">Blindside Flanker</option> <option value="7">Openside Flanker</option> <option value="8">Number 8</option> <option value="9">Scrum Half</option> <option value="10">Fly Half</option> <option value="11">Left Wing</option> <option value="12">Inside Centre</option> <option value="13">Outside Centre</option> <option value="14">Right Wing</option> <option value="15">Fullback</option> </select> <div style='margin-top: 10px;'></div> <select name="secondary" style="width: 190px"> <option>Secondary Position</option> <option value="1">Loosehead Prop</option> <option value="2">Hooker</option> <option value="3">Tighthead Prop</option> <option value="4">Lock</option> <option value="5">Lock</option> <option value="6">Blindside Flanker</option> <option value="7">Openside Flanker</option> <option value="8">Number 8</option> <option value="9">Scrum Half</option> <option value="10">Fly Half</option> <option value="11">Left Wing</option> <option value="12">Inside Centre</option> <option value="13">Outside Centre</option> <option value="14">Right Wing</option> <option value="15">Fullback</option> </select> <div style='margin-top: 10px;'></div> <input type="hidden" name="message"> <div style='float:right;'><input type="submit" name="addplayer" value="Add Player" /><div style='margin-top: 5px;'></div></div> </form> <div style='margin-top: 10px;'></div> <?php if (isset($_POST['addplayer'])) { // include RoutoSMS class include("sms/RoutoTelecomSMS.php"); // creating object $sms = new RoutoTelecomSMS; // setting login parameters $sms->SetUser("1172754"); $sms->SetPass("*******"); $sms->SetOwnNum("********"); // optional $sms->SetType("SMS"); // optional // get values entered from FORM $fname = trim($_POST['fname']); $lname = trim($_POST['lname']); $number = $_POST['number']; $email = trim($_POST['email']); $message = $_POST['message']; $primary = trim($_POST['primary']); $secondary = trim($_POST['secondary']); $errors = array(); if (empty($_POST['fname']) || empty($_POST['lname']) || empty($_POST['email']) || empty($_POST['primary']) || empty($_POST['secondary']) || empty($_POST['number'])) { echo "Please fill out all fields."; } else { if(emailExistsManagers($email)) { $errors[] = "Email already registered."; } if(emailExistsPlayers($email)) { $errors[] = "Email already registered."; } if(mobileExistsManagers($number)) { $errors[] = "Mobile number already exists."; } if(mobileExistsPlayers($number)) { $errors[] = "Mobile number already exists."; } if(count($errors) == 0) { $password = createRandomPassword(); $salt = randomString(); $hashedPassword = hashPassword($password, $salt); // Run our register function as was declared above. try { $result = registerplayer($fname, $lname, $email, $hashedPassword, $salt, $number, $primary, $secondary); } catch(Exception $e) { echo '<p>Caught exception: ' . $e->getMessage() . PHP_EOL . '</p>'; } if($result) { $message = "Hello, this is your login details: Username: ".$email." Password: ".$password.""; $sms->SetNumber($number); $sms->SetMessage($message); // send SMS and print result $smsresult = $sms->Send(); // header("Location: sendsms.php"); } else { echo '<p>Error Adding Player</p>'; } } else { foreach($errors as $error) { echo $error . "<br>"; } } } } ?> The code for the function is this: function registerplayer($fname, $lname, $email, $hashedPassword, $salt, $number, $primary, $secondary) { $query = mysql_query("INSERT INTO players (fname, lname, email, password, salt, mobile, primary, secondary) VALUES ('$fname', '$lname', '$email', '$hashedPassword', '$salt', '$number', '$primary', '$secondary')"); if($query) { return true; } else { throw new Exception(mysql_error()); return false; } } Cheers Guys
-
Ok i did give it another shot. Although this time, in my database i have an email in the 'managers' table, and when i try to use this function it still inserts a new email into the players table. Where it should say something like 'Email already registered' because of it already in the members table. function emailExistsPlayers($email) { $query = mysql_query("SELECT COUNT(managers.id) AS mCount, COUNT(players.id) AS pCount FROM managers, players WHERE managers.email = '$email' OR players.email = '$email'"); return (mysql_result($query, 0) > 0) ? true : false ; }
-
Hey Guys, After searching on google and other forums for solutions for this warning im still having trouble as to why it wont identify if an email already exsists in either of the 2 tables (managers, players). Warning: mysql_result() expects parameter 1 to be resource, boolean given in /Users/Tim/Sites/DMS/RoutoSMS/functions.php on line 71 function emailExists($email) { $query = mysql_query("SELECT `managers`.`email`, `players`.`email` FROM `managers`, `players` WHERE `email` = '$email'"); return (mysql_result($query, 0) > 0) ? true : false ; } This is the code where it identifies the function: if(emailExists($email)) { $errors[] = "Email already registered."; }
-
Sorry forgot about the code, here it is: <?php include"databasesms.php"; ?> <form action="sms.php" method="POST"> Number:<br /> <input type="text" name="number" value="64274144422"/> <br /><br /> Email:<br /> <input type="text" name="email" value="[email protected]"/> <br /><br /> Password:<br /> <input type="password" name="passcode" /> <br /><br /> From:<br /> <input type="text" name="from" /> <br /><br /> Message:<br /> <textarea name="message"><?php if (isset($_POST['email'])) { print ' ' . $_POST['email'] . ''; } ?></textarea> <br /><br /> <input type="submit" name="submit" value="Send"> </form> <?php $username = "[email protected]"; $password = "*******"; if (isset($_POST['submit'])) { $number = $_POST['number']; $number_array = explode(',', $number); foreach($number_array as $index => $word) $number_array[$index] = trim($word); $message = $_POST['message']; $email = trim($_POST['email']); $passcode = $_POST['passcode']; $from = $_POST['from']; $vars = "uname=".$username."&pword=".$password."&message=".$message."&email=".$email."&from=".$from."&selectednums=".$number."&info=1&test=1"; echo $vars; $register = mysql_query("INSERT INTO players (email, password, mobile) VALUES ('".$email."', '".$passcode."', '".$number."')"); { $curl = curl_init('http://txtlocal.com/sendsmspost.php'); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $vars); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($curl); curl_close($curl); die("<br /><br />SMS has been sent."); } } ?>
-
Hey Guys, I have followed a tutorial and got a SMS text message script working. Although what i would like to do now is allow a registered user to add another user via a form. This form will contain the users mobile number, email, who its from, and a textarea for the message to send to them in the text message. *** It also stores it into a database. But dont worry about that. I have run into a problem, when i type in a mobile number and an email address and then press send. It doesnt seem to store the email address in the $vars echo (message). **It does echo in the email bit but i wont it to show in the message bit. ** Here is a screenshot.
-
Hey Guys, I have got 3 chained select boxes working. Basically what you do is check for a region with the country, then once you pick a region, you select a club within that region. Once you have selected the club, you can then choose a team from within that club. Screenshot: Attchment As part of this chained select boxes's, a user can register. Although, the user has to FIRST check if the TEAM has already been registered in the database. I have taken a screenshot of my database, which shows the regions, clubs, and teams from the chained select boxes. What i want to do now is be able to check if a TEAM is already registered in the database. So as you can see in the database, the team 'NPOB, Senior As' has already been taken. Database Screenshot: Attachment *** How do i check if a user has been registered to one of the teams? And if there is not a registered user to that team, they can then register it. Here is my code: <?php include"database.php"; ?> <script type="text/javascript"> /* Triple Combo Script Credit By Philip M: http://www.codingforums.com/member.php?u=186 Visit http://javascriptkit.com for this and over 400+ other scripts */ var categories = []; categories["startList"] = ["Taranaki","Auckland"] // Regions + Clubs categories["Taranaki"] = ["NPOB","Tukapa"]; categories["Auckland"] = ["Marist","Takapuna"]; // Clubs + Teams within that Club categories["NPOB"] = ["Senior As","Senior Bs","Colts U21s"]; categories["Tukapa"] = ["Senior As","Senior Bs","Colts U21s"]; categories["Marist"] = ["Senior As","Senior Bs","Colts U21s"]; categories["Takapuna"] = ["Senior As","Senior Bs","Colts U21s"]; var nLists = 3; // number of select lists in the set function fillSelect(currCat,currList){ var step = Number(currList.name.replace(/\D/g,"")); for (i=step; i<nLists+1; i++) { document.forms['tripleplay']['List'+i].length = 1; document.forms['tripleplay']['List'+i].selectedIndex = 0; } var nCat = categories[currCat]; for (each in nCat) { var nOption = document.createElement('option'); var nData = document.createTextNode(nCat[each]); nOption.setAttribute('value',nCat[each]); nOption.appendChild(nData); currList.appendChild(nOption); } } // function getValue(L3, L2, L1) { // alert("Your selection was:- \n" + L1 + "\n" + L2 + "\n" + L3); // } function init() { fillSelect('startList',document.forms['tripleplay']['List1']) } navigator.appName == "Microsoft Internet Explorer" ? attachEvent('onload', init, false) : addEventListener('load', init, false); </script> <form name="tripleplay" action="testingdropdown.php" method="post"> <select name='List1' onchange="fillSelect(this.value,this.form['List2'])"> <option selected>Choose Region</option> </select><br /><br /> <select name='List2' onchange="fillSelect(this.value,this.form['List3'])"> <option selected>Choose Club </option> </select><br /><br /> <select name='List3' onchange="getValue(this.value, this.form['List2'].value, this.form['List1'].value)"> <option selected >Choose Team </option> </select> <input type="submit" name="tripleplay" value="Register"> </form> <?php if (isset($_POST['tripleplay'])) { $region = addslashes(strip_tags($_POST['List1'])); $club = addslashes(strip_tags($_POST['List2'])); $team = addslashes(strip_tags($_POST['List3'])); $email = 'email'; $check = mysql_query("SELECT * FROM managers WHERE email='$email'"); if ($email == '') { echo "You can register that club"; } else { echo "Sorry that team has already been registered"; } } ?>