Jump to content

Albatross

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Everything posted by Albatross

  1. Can you give me an example of what you mean?
  2. I have the date being pulled in an echo statement but I'm trying to use the date_add() function somewhat unsuccessfully... Declaring the current time... <?php $time = date("h:i A"); ?> and then echoing it.. <?php echo $time date_add(INTERVAL 2 HOUR)"; ?> And as guess, it isn't working and even after searching on google, I can't seem to get this one. Any ideas would be appreciated.
  3. One I used looked like this... <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>WHSE Management System</title> <link type="text/css" rel="stylesheet" href="bio.css"> </head> <body> <div class="content"> <h1>Item added with the following credentials :</h1> <h1>Name : </h1><? echo "$_POST[name]"; ?> <h1>Position : </h1><? echo "$_POST[position]"; ?> <h1>Ref ID : </h1><? echo "$_POST[refid]"; ?> <h1>Password : </h1><? echo "$_POST[password]"; ?> </body> </html> Just change the names of the items to match your field names and it will return a confirmation.
  4. Caught it when my date showed 2627 when I used 'ds' and then Thuth when I used DS. Deductive logic kicked in at this point! Thank you all!
  5. Heya once again! This time is's an easy one and I read it on this site just last week but shucks if I can't find it when I need it... I'm trying to get the suffix to the day of the month... <?php echo date("D"); ?> This give me the number of the day, but not the suffix, 'th'. Today reads 26 and I'm trying to get it to read 26th without using code like this: <?php echo date("D"); ?><sup>th</sup>
  6. just checked mine n you're right, I used 1000000000-9999999999 and didn't start from zero. Was on the right track but wrong train.
  7. I know the sign says solved, but here's the one I just used yesterday and it seems to play nicely. <?php echo rand(0, 999999); ?>
  8. Just wondering if anyone had any ideas on this. I don't know what other code would be needed but if there's something I can add to this to make it easier, please let me know.
  9. Heya once again....this time i think it's fairly straigtforward but I have the redirect based on date code but it's not redirecting. Can I get an opinion on what I'm doing wrong here please (and the sunday code wouldn't work at all for some reason): <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>FatMan™Inc</title> <style type="text/css"> <!-- body { background-color: #CCCCCC; background-image: url(cvgbg.gif); background-repeat: repeat-x; } --> </style> <style type="text/css"> a:link, a:visited{color: #CC9966;text-decoration: none; } .style24 {color: #3A5C9F; font-style: italic; } .style26 { font-size: xx-large; color: #3A5C9F; } .style27 {font-size: 14px} </style> </head> <body> <?php $hour = date('G'); $minute = date('i'); $day = date('w'); $m = $hour * 60 + $minute; if( $day == 4 && $m >= 480 && $m <= 1380 ) header("Location: www.phpfreaks.com/forums/index.php"); else if( $day == 5 && $m >= 480 && $m <= 720 ) header("Location: www.phpfreaks.com/forums/index.php"); else if( $day == 6 && $m >= 1 && $m <= 1439 ) header("Location: www.phpfreaks.com"); else if( $day == 1 && $m >= 1 && $m <= 1439 ) header("Location: www.phpfreaks.com"); else if( $day == 2 && $m >= 1 && $m <= 1439 ) header("Location: www.phpfreaks.com"); else if( $day == 3 && $m >= 1 && $m <= 1439 ) header("Location: www.phpfreaks.com"); ?> </body> </html>
  10. With no email, no ID field is generated and that's half of what I needed anyway so if the code is skippinng blanks in it's total count, that would be in my favor....unless I needed to total records regardless of content. (I think I understood what I just said...) But thank you for the heads up. I changed it back to the * and added the not null attribute to the field so it MUST be populated in order to process.
  11. Probably good that I used yours then, $res = mysql_query("SELECT COUNT(email) FROM $table_name"); is grabbing every email up to the 3000th if I understood your code correctly. Thank you
  12. Worked beautifully once I played with it a bit. Thank you both! (I tried them both n they both worked afer a jig!)
  13. Once again I've hit a roadblock... I've been trying to write a page that checks the database and counts the number of records and if the number is less than 3000, it loads page X, but if the number is equal to 3000, it loads page Y. I know this should be a simple if/else statement but it's the checking and counting that I cannot get to work. Any help would be appreciated.
  14. In my last post, I had the right idea but had made an error.....in the generate script, I had it labeled as '$_POST[$epassid]' and the $ was what was blocking it. Thank you for the help
  15. On my main form, I'm trying this to get the 'epassid' portion. Still not working though... <input name="epassid" type="hidden" value="<?php echo rand(1000000000, 9999999999); ?>">
  16. Sorry, had snipped it off, fixed.
  17. Sorry for the delay, had a couple errors I needed to squish first. The epassid field is in the db and it's shown here, I have the code to generate the id, but not to stick it into the field and this is where I'm running into trouble. <?php include ("db.php"); $sql = "INSERT INTO $table_name (q1, q2, q3, q4, q5, epassid) VALUES ('$_POST[q1]', '$_POST[q2]', '$_POST[q3]', '$_POST[q4]', '$_POST[q5]', '$_POST[epassid]')"; $result = @mysql_query($sql, $connection) or die(mysql_error()); $inputfield07=@($_POST['q1']); $inputfield08=@($_POST['q2']); $inputfield09=@($_POST['q3']); $inputfield10=@($_POST['q4']); $inputfield11=@($_POST['q5']); $inputfield12=@($_POST['epassid']); echo(mysql_error()); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>FatMan™ Inc</title> <style type="text/css"> <!-- body { background-image: url(cvgbg.gif); } body,td,th { color: #0000CC; font-size: 18px; } .style5 {font-size: 14px; font-weight: bold; } --> </style></head> <body> <table width="33%" border="0" align="left"> <tr> <td width="50%"><span class="style5">Name </span></td> <td width="50%"><? echo "$_POST[fname]"; ?> <? echo "$_POST[lname]"; ?></td> </tr> <tr> <td><span class="style5">Email Address </span></td> <td><? echo "$_POST[email]"; ?></td> </tr> <tr> <td><span class="style5">E-Pass ID</span></td> <td><? echo "$_POST[epassid]"; ?></td> </tr> </table> </body> </html>
  18. I think the problem here is I don't know which question to ask to get the naswer i need.... the random number that I generate I don't know how to get it to write to the db is my problem.
  19. The number I can get, it's that I don't want the user to see it until they submit the form to the db. It's placing that number in the db at the same time that the confirmation is echo'd back to the user that I can't get to work. Everything else uses a form element but the random number is a function. ex. <input type="text" name="fname"> This is for the first name and the 'fname' title I'm able to grab but this: <?php echo rand(1000000000, 9999999999); ?> Is what I'm having the issue with. I can get it to spit something out but not write itself to the record on the db.
  20. I was able to get all of mine to show in a single box using this type of code: $result = @mysql_query($sql, $connection) or die(mysql_error()); $contact_list = "<ul>"; while ($row = mysql_fetch_array($result)) { $id = $row['id']; // Change to whatever criteria you need $lname = $row['lname']; // Change to whatever criteria you need $fname = $row['fname']; // Change to whatever criteria you need $contact_list .= "<li><a href=\"show_contact.php?id=$id\">$lname, $fname</a>"; // This row will populate your list based on the same criteria you specified above. } $contact_list .= "</ul>"; ?>
  21. Mornin everyone....perhaps it's because it's 730 and perhaps it's because my mindset isn't aligned yet due to lack of caffiene.... I'm trying to add a couple features to a site but having little to no luck here... On 2 dates, I need a certain area of my site open at specific times, but at any other time, I need the user directed to a 'sorry we're closed' page. But also, I have a form that when the user fills it out and hits submit, a 10 digit number is generated and both fed to the form and sent to the db as well as returned to the user. Right now, I have the form going to the db and a confirmation of everything they enetered but I also need this number, which will not exist until they hit submit, to be added. Any ideas?
  22. Evening everyone What i'm trying to accomplish is to have my html form have an element that includes a dropdown menu that's fed from a list of names from an existing mysql db table. i.e. <select name="ban"> <option selected>None</option> <option value="30 Day">30 Day</option> <option value="60 Day">60 Day</option> <option value="90 Day">90 Day</option> <option value="180 Day">180 Day</option> <option value="1 Year">1 Year</option> <option value="Lifetime">Lifetime</option> </select><br><br> Where this code is actially coming from xtable on y database. I know how to connect to the db table in my connection code, but dont know how to get the drop down to show. The purpose for this is because I want to be able to add names to the dropdown without editing the code for the forms, backend for processing pages, and output pages. By updating a single table that reflects dynamically, I hope to save time and effort here.
  23. To be honest, it's what I started with way back when and it worked......so I kept using it. If you know of a better, cleaner way, I am truly all ears. (Copy/pasting the same code across sheets is a pain in the backside....believe me)
  24. Mornin all! I have a html form application that gets processed by some php code, returns a result page to the applicant, stores the info in a db, and emails myself and another person. The problem I have is that when I get the email, I see the domain server email addy, not the registered domain. (ex : [email protected] instead of [email protected]) (both are techincally correct but I want my paid domain used....not the default webhost domain. Based on the code below, is there a way I can change it so that I get the domain that I want? $inputfield00=@($_POST['name']); $inputfield01=@($_POST['history']); $inputfield02=@($_POST['recruiting']); $inputfield03=@($_POST['email']); $inputfield04=@($_POST['im']); $inputfield05=@($_POST['charname']); $inputfield06=@($_POST['charage']); $inputfield07=@($_POST['bio']); $inputfield08=@($_POST['strengths']); $inputfield09=@($_POST['whatship']); $inputfield10=@($_POST['responsibilities']); $inputfield11=@($_POST['sample']); $mailto="[email protected]"; $mysubject="Application for '$_POST[name]'."; $mail = 'An application requires your review.: Message: '.$message.' Field 1: '.$inputfield00.' Field 2: '.$inputfield01.' Field 3'.$inputfield02.' Field 4 '.$inputfield03.' Field 5 '.$inputfield04.' Field 6'.$inputfield05.' Field 7'.$inputfield06.' Field 8'.$inputfield07.' Field 9'.$inputfield08.' Field 10'.$inputfield09.' Field 11'.$inputfield010.' Field 12'.$inputfield11; $header .= "Application"; mail($mailto, $mysubject, $mail, $header); ?> (This is all of the mailer code.)
×
×
  • 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.