Jump to content

hoopplaya4

Members
  • Posts

    161
  • Joined

  • Last visited

    Never

Everything posted by hoopplaya4

  1. That worked, thanks. But the main point of my page is because it acts as an "archive" for all of the MySql records. Thus, how might I display it in a way like below: > 2008 > 2007 > 2006, etc Then, a user will click the year, which will then spill out all the MySql records for that year. Does that make sense? Is there a tutorial anywhere out there that teaches how to make an archive?
  2. Thanks for the reply. That's getting me in the right direction. However, how can I implement names of months (e.g., November, December, etc..) as opposed to just having the numbers? Thanks!
  3. Hi All, I'm currently querying some database fields that are dates. They are all in the following format: 11/12/2008. My question is this: How can I query the database to get all these fields, and then group them into separate (links) by Month. For example, all the 11/xx/xxxx will be displayed under a link that would say "November." Then users would click "November" and then all 11/xx/xxxx database entries would be displayed. Is this going to be too complicated? Or is there an easy way to achieve this? Please let me know if I'm being vague! Thanks.
  4. Sorry if I wasn't specific. The issue resolved what that the defined function was still inside the "if" statement. I ended the if statement before the function, and that was it.
  5. That was it. Thank you everyone! I learned something new today. I'm appreciative of how helpful everyone is with me learning PHP. Thanks again.
  6. Hi Blade: Thanks for the reply. I thought I had that function on Line 32. <?php function viewPractice() { Is there something else I'm doing wrong? Thanks!
  7. I'm pretty new to this, but if someone could perhaps tell me what is wrong with my code, I'd much appreciate it! I'm trying to execute a function, but I get the error: Here's my code: <?php session_start(); require("includes/header.php"); require("includes/secureHeader.php"); if ($_POST['submit'] == null){ if ($_SESSION['sessUsrFirstName'] != "") { if($_GET["action"] == "view") { viewPractice(); } // end if if ($_GET["action"] == "") { ?> <h1>Practices </h1> <a href="addPractice.php"><img src="../images/add.gif" border="0" /></a> <a href="addPractice.php">Add a Practice Plan</a><br /><br /> <?php require("../connection.php"); $rs = mysql_db_query($DBname,$sql,$link); //Retrieves data from MySQL $data = mysql_query("SELECT * FROM tblPractices ORDER BY practiceDate LIMIT 10") or die(mysql_error()); //Puts it into an array while($info = mysql_fetch_array( $data )) { //Outputs the list and other data Echo "<a href='practice.php?action=view&num=" . $info['practiceID'] . "'>".$info['practiceDate'] . "</a> <br>"; } ?> <?php function viewPractice() { $sql = "SELECT * FROM tblPractices WHERE (practiceID = " . $_GET["num"] . ")"; require("../connection.php"); $rs = mysql_db_query($DBname,$sql,$link); if ($rs) { while ($row=mysql_fetch_array($rs)){ ?> <div id="communicate"> <form class="uniForm" enctype="multipart/form-data" action="add.php" method="POST"> <table width="80%" cellpadding="0"> <div class="ctrlHolder"> <fieldset> <legend> Practice Date and File </legend> <input id="idhere" name="name" type="text" style="width: 80px;" maxlength="10" /> <div style="float:left" class="col"> <input type="file" class="fileUpload" name="photo" > </div> </fieldset> </div> <div class="ctrlHolder"> <fieldset> <legend>Comments</legend> <TEXTAREA id="styled" ols="115" rows="6" wrap="soft" type="text" name = "email" value="<?= $_GET["practiceComments"] ?>" ></TEXTAREA> </fieldset> </div> <div class="ctrlHolder"> <fieldset> <legend>Private</legend> <TEXTAREA id="styled" wrap="soft" cols="115" rows="6" type="text" name = "phone"></TEXTAREA> </fieldset> </div> <div class="buttonHolder"> <fieldset> <input class="submitButton" type="submit" value="Add Practice"> </fieldset> </div> </table> </form> </div> <?php } //end while } // end if } // End Function editEvent } //end If } } ?> <?php require("../includes/footer.php"); ?>
  8. Thanks for the reply alexweber. But I'm not looking to send SMS messages, I'm trying to send actual IM's.
  9. Does anyone know of any scripts that will send an Instant Message (AIM, MSN, Google Talk, etc) via email or through a PHP script? I've been searching around and can't find anything. I wonder if this is something that would have to be built from scratch. Thanks!
  10. Thanks mgallforever and laffin, both worked pefectly! I just had one question, for mgallforever. Can you explain to me what's happening in the code snippet you provided? I'd like to learn a little bit about what was going on. Or if you can point me to a tutorial, that'd be helpful. Thanks again guys!
  11. Hi All, I've tried googling this for the past hour, but I haven't been able to find anything to help me. I'm trying to insert 3 different fields (it's a phone number-- area code, prefix, suffix) into one row in my mySQL database. How would I go about doing this? Here's my HTML: <label for="phone">Phone Number</label> <input type="text" size=3 maxlength="3" name="phone[]" id='phone[]'/>- <input type="text" size=3 maxlength="3" name="phone[]" id='phone[]'/>- <input type="text" size=4 maxlength="4" name="phone[]" id='phone[]'/> And here's my PHP Script: $usrPhone = str_replace("'", "''", $_POST["phone"]); $sql = "INSERT INTO tblUsers (usrPhone)"; $sql .=" VALUES ('$usrPhone')"; Thanks!
  12. Thanks for the replies fellas. Yes, I am currently using javascript. I'm just looking for something ''pretty."
  13. Hi Everyone: Does anyone know where I might be able to find a stylish, web 2.0ish, delete confirmation box script that uses PHP, DIVs, and CSS or something. I'm tired of the typical alert box that pops up. Thanks!!
  14. Hi Everyone: Does anyone know where I might be able to find a stylish, web 2.0ish, delete confirmation box script that uses Ajax, DIVs, CSS or something. I'm tired of the typical alert box that pops up. Thanks!!
  15. Hi, I'm pulling several times from a MySQL database and putting into a table format in PHP. However, the times right now come up as: 16:00:00, as opposed to 4:00 PM. How can I query the database and convert it into a readable time? Here's a quick look at my code: <?php $loopCount = 0; $sql = "SELECT classID, classTitle, classStart, classEnd, classDays"; $sql .= " FROM tblCourses WHERE (usrID = " . $_SESSION['sessUsrID'] . ")"; $sql .= " ORDER BY classID"; require("../connection.php"); $rs=mysql_db_query($DBname,$sql,$link); if ($rs) { while ($row=mysql_fetch_array($rs)){ $daysSTR = $row['classDays']; $chars = array("M", "T", "W", "Th", "F", "S", "Su"); $nums = array("1", "2", "3", "4", "5", "6", "7"); $daysSTR = str_replace($nums, $chars, $daysSTR); $daysSTR = str_replace(",", "", $daysSTR); $mysqltime = date ("Y-m-d H:i:s", $phptime); print(" <tr>\n"); print(" <td>" . $row['classTitle'] . "</td>\n"); print(" <td>" . $row['classStart'] . "</td>\n"); print(" <td>" . $row['classEnd'] . "</td>\n"); print(" <td>$daysSTR</td>\n"); print(" <td><a href='editEvents.php?action=edit&num=" . $row['classID'] . "'>Edit</a> "); print("<a href='editEvents.php?action=delete&num=" . $row['classID'] . "'>Delete</a></td>\n"); print(" </tr>\n"); $loopCount += 1; } //end while if ($_GET["msg"] == 1){print("<tr>\n<td colspan=5><font color=red>Event Edited</td>\n</tr>\n");} if ($_GET["msg"] == 2){print("<tr>\n<td colspan=5><font color=red>Event Deleted</td>\n</tr>\n");} print("</table>\n</td>\n</tr>\n</table>"); mysql_close($link); } // end if ($rs) else { // No Events found print("No Events found"); mysql_close($link); } // end else ($rs) Thanks in advance for your help!!
  16. Hi All, Does anyone know of any PHP Scripts that would allow me to post a "Comment" or Private Message my friends on MySpace? I know that there are "Mass Comment" utilities out there, but I was curious if anyone knew of any that I could tie in with PHP somehow? Thanks!
  17. Okay, so here's what I did and it worked!! Form: <select multiple name="players[]"> //loop out players from database </select> Script: $players = $_POST['players']; foreach ( $players as $p ) { $mail->AddAddress ($p); }
  18. Thanks for the reply. How would I write a script for something like that? Also, even when I select multiple emails, it still sends to one email address, so it must not be coming out as something like: email1@email.comemail2@email.com Hmm....hopefully we can get to the bottom of this.
  19. OK, so I figured out why it wasn't sending. In emailscript.php the AddAddress command was not correct. So, I changed it to: $mail->AddAddress($_POST["players"]); as opposed to the incorrect: $mail->AddAddress = ($_POST["players"]); Now, however, it will only work when I select one of the email addresses in the list. However, if I try to hold CTRL, and select multiple email addresses, it will only send to one. Is there a way I can get it to send to several selected emails? ???
  20. Hi revraz and andy: Thanks for the reply. I tried to fix the '1' portion, but that didn't work. The specific issue is: the emails are not sending. I am trying to select one email address (or multiple) and it is not sending to those addresses. I am able to send to the whole database when I run a $row, however, I want to be able to send to selected email addresses. Any other ideas? Thanks again!
  21. Hi, I'm pretty new at PHP, and I've been searching the net for a while, but haven't been able to find anything conclusively to help me out. I'm trying to create an email form where the user can select multiple email addresses, pulled from the database, (see screenshot below) and send all selected users an email using PHPMailer. I've been trying to make it work, but just can't do it. If anyone can help out with the script, that'd be greatly appreciated!! Thank you. If you can help me out with both the PHP and HTML, that'd be VERY HELPFUL! Thank you. Here's the form code: <form name="filterplayer" method="post" action="emailscript.php"> <select multiple name="players" id="players" size="5"> <?php $sql = "SELECT usrID, usrEmail"; $sql .= " FROM tblUsers"; $sql .= " WHERE usrActive = 1"; $sql .= " ORDER BY usrEmail"; require("../connection.php"); $rs=mysql_db_query($DBname,$sql,$link); if ($rs) { while ($row=mysql_fetch_array($rs)){ print("<option value='" . $row["usrID"] . "'>"); print("" . $row["usrEmail"] . "</option>\n"); } // end while } else { // No Events found print("No Active players"); mysql_close($link); } // end else ($rs) ?> </select> <br><br> <span class="style3">Subject</span><br /> <input name="subjectpost" type="text" size="50" id="subjectpost"><br /><br /> <span class="style3">Message</span><br /> <textarea name="bodypost" cols="50" rows="10" id="bodypost"></textarea> <br /><br /> <input type="submit" name="submit" value="Email!"> </form> And here's the PHP: <?php #include PHPMailer class and database connection include("../phpmailer/class.phpmailer.php"); include("../connection.php"); #remove slashes from content $html = stripslashes($_POST["bodypost"]); $plain = stripslashes($_POST["bodypost"]); #initiate PHPMailer class $mail = new PHPMailer(); #set the from e-mail address $mail->From = "myemail@gmail.com"; #set the from name $mail->FromName = "Scheduler"; #set the e-mail type to HTML $mail->IsHTML(true); #the subject of the email $mail->Subject = stripslashes($_POST["subjectpost"]); #the HTML content of the email $mail->Body = $html; #the plain text version $mail->AltBody = $plain; #add subscribers address as the recipient $mail->AddAddress = ($_POST["players"]); #sends the newsletter $mail->Send(); #clears the recipient address #$mail->ClearAddresses(); ?>
  22. Never mind! I figured it out. I just used: $filename = date('H.i.s\.\p\d\f'); And it worked great. Thanks for the recommendation.
×
×
  • 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.