Jump to content

mwjansen

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mwjansen's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. holy moly - this forum rocks!!! thank you very much!
  2. i'm pulling just one field out of my table, removing dupes, but the way i have it, each entry just sits next to the previous one. (eg "vendor1 vendor2 vendor3 etc.") i'm trying to get it so that it at least appears as though it is a 3 or 4 column table. $sql = "SELECT DISTINCT vendor FROM reviews ORDER BY vendor"; $result = @mysql_query($sql) or die("Unable to retrieve from database"); while ($row = mysql_fetch_array($result)) { $vendor = stripslashes ($row['vendor']); $display_block1 .= "<a href='indextest.php?vendor=$vendor'>$vendor</a> &nbsp "; }
  3. got it, had to switch Days and Months in the mktime statement. thanks again catfish, now on to other php problems ...
  4. hmmm, the date math must be off. if i input jan 1 2010 i get 36 days if i input jan 2 2010 i get 5 days if i input jan 3 2010 i get -23 days guess i'll have to do some reading on date math ...
  5. 1. yes, copy n paste error 2. and yes, it looks like its working. that's bizarre, cause i haven't changed anything since my last post ... a gift horse perhaps thanks again catfish!! now i have to work on placing in an image and producing the bbcode. if i had to do this for a living i'd be dead ...
  6. thanks again catfish. i've tried the print line, still get a blank page. my log file is empty (cept for stuff from 6 months ago). also contacted my host(godaddy), who confirmed - no php errors logged. do you (or anyone else) see any errors that would cause this? <?phpif ($_GET['submit1'] == 'Generate') { print('We are inside the if block.<br/>'."\n"); $dateQuit = mktime(0,0,0,$_GET['Day'],$_GET['Month'],$_GET['Year']); $dateNow = time(); // find number of days since quit $numDaysSinceQuit = floor(($dateNow - $dateQuit) / 60 / 60 / 24); print('Days since quiting: '.$numDaysSinceQuit.'<br/>'."\n"); // find number of cigs not smoked $numCigsNotSmoked = round($numDaysSinceQuit * $_GET['perday']); print('Number of cigs not smoked: '.$numCigsNotSmoked.'<br/>'."\n"); // find money saved on cigs (assuming 20 cigs per pack) $moneySaved = (ceil($numCigsNotSmoked / 20) * $_GET['perpack']); print('Money saved from not smoking: $'.$moneySaved.'<br/>'."\n"); } ?>
  7. thank you so much catfish. i did look at the script in action and its exactly what i'm looking for. however, when i try it on my server it doesn't work, the resulting page (phpFreaktest.php) with variables just shows a blank page. i don't understand that because i copied both your html and php verbatim, including naming conventions ... any ideas? seehttp://joker63.com/ecfsig/phpfreaksTest.html
  8. my only experience with php is from a book i bought about a year ago, and while it gave me a basic understanding, i'm still a complete novice with it. i don't program for a living, and i rarely do it for fun anymore. i have searched both in this and other forums, as well as general internet searches, but haven't been able to locate an answer and so here i post ... i'm a member of a forum for people who have quit smoking, and have been trying to help out by creating a signature creator for the members. what i'm trying to do is have a page (ie create.php), where the user enters the date they quit smoking, the number of cigarettes they used to smoke per day, and their cost/pack of smokes. then take that info and create a dynamic sig for them, which would display the number of days since they quit, the money they have saved (# of cigs * 20 * cost/pack), and the number of cigarettes they haven't smoked (# of cigs * # of days). not only create the sig (over a graphic which i've made), but also output the html and bbcode so they can copy/paste into their profiles. i've written the first page (create.php), and i think its right, but now i'm completely lost and don't know which direction to go. any help to get to the final result would be greatly appreciated. <div id="info"><img src="images/bg.png" /><br><br> <form style="margin: 0px;" method="get" onsubmit="return checkDomain(this);" action="create.php" id="form1" name="form1"> <nobr>Cigarettes smoked per day:<input name="perday" type="text"></nobr><br><nobr>Cost Per Pack:<input name="perpack" type="text"></nobr><br>Quit Date: <select name='Month'> <option value='1' >Jan</option> <option value='2' >Feb</option> <option value='3' >Mar</option> <option value='4' >Apr</option> </select> <select name='Day'> <option value='1' >1</option> <option value='2' >2</option> <option value='3' >3</option> </select> <select name='Year'> <option value='2010' >2010</option> <option value='2009' >2009</option> <option value='2008' >2008</option> <option value='2007' >2007</option> </select> <br><input value="Generate" id="submit1" name="submit1" src="create.php" type="submit"></form>
×
×
  • 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.