Jump to content

NoPHPPhD

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Everything posted by NoPHPPhD

  1. install smtp locally, bounce it off of that. you are trying to relay off of smtp server on internet, good luck.
  2. Yes, I did hear the B1->RC1->Release rumor. I bet it is true if not close to the truth. I mean, the capped the limit at 2.5 MILLION in beta, thats a HUGE beta. Much like the one that jumped up out of his fishbowl and ate my dog, but thats a different story. Never feed your beta steroids btw. Anyway, Win7 is rock solid so far.
  3. This maybe? <?php $i=0; $handle = fopen("test.csv", "r"); do { if ($data = fgetcsv($handle, 1000, ",")) { } else { echo 'Last Line Is :'. $i;; break; } $i++; } while ($data != NULL); fclose($handle); ?>
  4. I've been using it for a few weeks now, and lovin' it. Never did load Vista, kinda looked like the new Windows ME (for those that remember). Anyone else?
  5. Do you mean that if you click the logout link it's blank?
  6. OMG. Glad someone spoke up before i formatted. thanks!!!
  7. echo ($_SESSION['message'] . '<a href="logout.php">Log out</a>');
  8. Very very basic. Trying to get this to where I can enter amounts in text boxes, click Enter, and the amounts are still there. Want to do totals and checking if numeric later, but cant get basic stuff to work. <?php session_start(); ?> <form method="post" action="<?php echo $PHP_SELF; ?>"> <?php if (isset($_POST['submit'])) { $_SESSION['3_c1_bx1'] = $_POST['3_c1_bx1']; $_SESSION['3_c1_bx2'] = $_POST['3_c1_bx2']; $_SESSION['4_c1_bx1'] = $_POST['4_c1_bx1']; $_SESSION['4_c1_bx2'] = $_POST['4_c1_bx2']; $_SESSION['5_c1_bx1'] = $_POST['5_c1_bx1']; $_SESSION['5_c1_bx2'] = $_POST['5_c1_bx2']; $_SESSION['total_bx1'] = $_POST['total_bx1']; $_SESSION['total_bx2'] = $_POST['total_bx2']; } ?> <input type="submit" name = "submit" value="Enter" /> <table class="means" cellpadding="1"> <tr> <td>Gross wages:</td> <td><input type="text" size="5" maxlength="9" name="3_c1_bx1" value="<?php $_SESSION['3_c1_bx1']; ?>"/></td> <td><input type="text" size="5" maxlength="9" name="3_c1_bx2"/></td> </tr> <tr> <td>Gross salary:</td> <td><input type="text" size="5" maxlength="9" name="4_c1_bx1"/></td> <td><input type="text" size="5" maxlength="9" name="4_c1_bx2"/></td> </tr> <tr> <td>Gross tips:</td> <td><input type="text" size="5" maxlength="9" name="5_c1_bx1"/></td> <td><input type="text" size="5" maxlength="9" name="5_c1_bx2"/></td> </tr> <tr> <td>Total:</td> <td><input type="text" size="5" maxlength="9" name="total_bx1"/></td> <td><input type="text" size="5" maxlength="9" name="total_bx2"/></td> </tr> </table> </form>
  9. You guys really got me going in the right direction a while ago. I have a huge html file and I wanted to be able to output the contents of the file using echo. Suggestion from forum was to use file_get_contents(). Worked like a champ! So, in this huge html file I have a string (used like a delimiter) for each section, each section is a row, or rowspan. I wanted to just get that piece between the delimeters. Here is the setup to do just this. It finds 1st string, 2nd string, then returns a string of all the text inbetween... TextBetween function courtesy of 'mvp at mvpprograms dot com'. <?php $linenum=''; $content=''; $linenum = file_get_contents("myhtmlfile.html"); echo "<table>"; echo (TextBetween('<!-- Line# 23 -->','<!-- Line# 24 -->',$linenum )); echo "<table/>"; function TextBetween($s1,$s2,$s){ $s1 = strtolower($s1); $s2 = strtolower($s2); $L1 = strlen($s1); $scheck = strtolower($s); if($L1>0){$pos1 = strpos($scheck,$s1);} else {$pos1=0;} if($pos1 !== false){ if($s2 == '') return substr($s,$pos1+$L1); $pos2 = strpos(substr($scheck,$pos1+$L1),$s2); if($pos2!==false) return substr($s,$pos1+$L1,$pos2); } } ?>
  10. Hi, Is there a way to echo the contents,not a link, of an html file? echo ('http://localhost/line1A.htm'); I have ALOT of html files that are pieces of a very long table in a form thanks!
  11. crap, i was hoping that was not the answer.
  12. Hi, I get an error on this line. Space in column name is issue. fat mono is a decimal 5,3. mgrams is decimal 5,3. Thanks, [code] $fatm += ($row->fat mono * $row->mgrams / 100); [/code]
  13. I would say your best bet from here is to load up WAMP and put the page up there to test and make sure it does exactly what you want.
  14. Like this? [code] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <?PHP $name = "Submitted name"; $message = "Submitted message"; $link = "Click Me"; $addr = "http://www.nabaztag.com/vl/FR/api.jsp?sn=00039D4028F9&token=1162428034&tts=a message from"; $html = '<a href="'.$addr.$name.$message.'">'.$link.'</a>'; print $html; ?> </body> </html> [/code]
  15. I would like to make sure that "Quantity" is > zero when this is submitted. If it is not, I would like to just redisplay the same form. What do I have to do? Probably very simple, just not searching for the right term.... :-\ [code] print("<FORM>\n"); print("<FORM ACTION=\"AddRecord.php\" METHOD=\"GET\">\n"); print("<INPUT TYPE=\"TEXT\" NAME=\"Quantity\">\n"); print("<INPUT TYPE=\"HIDDEN\" NAME=\"NBDno\" VALUE = '$pickedNBDno' >\n"); print("<SELECT NAME=\"Measure\">\n"); while($row = mysql_fetch_object($dbResult)) { print("<OPTION VALUE=\"{$row->WeightID}\""); print(">{$row->Description}\n"); } print("</SELECT>\n"); print("<INPUT TYPE=\"submit\">\n"); print("</FORM>\n"); [/code]
  16. I went thru the "PHP Calendar Turorial" on this site (Thanks!). Installed Apache, MySQL, etc, works fine. Got the calendar up and going, played around with it to understand what it is doing etc. I also have a database of information that is almost ready to go, it will be MySQL (bunch of rows, several columns) Now, I would like to get it to do something. The calendar has hyperlinks on each of the days. I would like to be able to click on the hyperlink and have a query run (unless better way) that pulls information for that day out of my database. Right now it shows for example: $day_link = "<a href=\"".$_SERVER['PHP_SELF']."?date=".mktime(0,0,0,$month -1,$d,$year)."\">$d</a>"; What exactly does this line do? Building a link (the <a href) part. Then adding its own path. Then adding the numerical date? Am I going about this wrong? Thought it would be apretty good way to learn... thanks, Snippet of the Calendar from phpfreak.. [code]$i = 0; foreach($weeks AS $week){       echo "<tr>\n";       foreach($week as $d){         if($i < $offset_count){             $day_link = "<a href=\"".$_SERVER['PHP_SELF']."?date=".mktime(0,0,0,$month -1,$d,$year)."\">$d</a>";             echo "<td>$day_link</td>\n";         }         if(($i >= $offset_count) && ($i < ($num_weeks * 7) - $outset)){             $day_link = "<a href=\"".$_SERVER['PHP_SELF']."?date=".mktime(0,0,0,$month,$d,$year)."\">$d</a>";           if($date == mktime(0,0,0,$month,$d,$year)){               echo "<td>$d</td>\n";           } else {               echo "<td>$day_link</td>\n";           }         } elseif(($outset > 0)) {             if(($i >= ($num_weeks * 7) - $outset)){               $day_link = "<a href=\"".$_SERVER['PHP_SELF']."?date=".mktime(0,0,0,$month +1,$d,$year)."\">$d</a>";               echo "<td>$day_link</td>\n";           }         }         $i++;       }       echo "</tr>\n";    } [/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.