Jump to content

WebStyles

Members
  • Posts

    1,216
  • Joined

  • Last visited

Everything posted by WebStyles

  1. Gender:</td> <td><select> <option>Female</option> <option>Male</option> </select> is missing the select name and values. Should be Gender:</td> <td><select name="sex"> <option value="Female">Female</option> <option value="Male">Male</option> </select>
  2. you say it's called menu.php but the one you're including is menu.inc.php
  3. maybe it should be: $sex = fixtext($_POST["sex"]); although that's very little info and code for us to figure it out. try something like this: if(isset($_POST['sex'])){ echo 'variable exists.'; }else{ echo 'Variable did not reach this page'; } p.s. I'm not even going to ask what the content of that variable is, or did you mean 'gender' ...
  4. try: echo $value = $_POST['Assign']; instead of just $value = $_POST['Assign']; (so you can see if the variable is reaching the page)
  5. Cool idea. Haven't heard anyone speak about the game of life in over 5 years. I might just do an example too (but later, cause I'm at work now) anyway, to answer your question: Does anyone know how to create Conway's Game of Life using php? Yes. Although it's not the best choice of language for such a thing, but it's possible.
  6. you need to do that for each select name you have.
  7. in this part: $ID = $row['id']; $year = $row['AssignedTo']; echo "<option value=$id>$year"; try: $id = $row['id']; $year = $row['AssignedTo']; echo "<option value='".$id."'>".$year."</option>"; $ID and $id are two different things (one uppercase, one lowercase). Do they both exist? do they have the correct values? what does your error_reporting say? (check your error logs) You're also not closing your <option> elements.
  8. are you redirecting to the same page based on a condition? (sounds like you page is looping). Please post all the relevant code. thanks
  9. I just tested and got the same result, but then I opened photoshop and created a second png (from your original) and saved as PNG-8 (instead of (PNG-24) and it worked.
  10. since the links are on their own line, and are php pages, you could just use something like: // search for .php matches so I know it's a page name: if(strpos($line,".php"){ // php page found: echo "this should be a link to this page: <a href='".$line."'>".$line."</a>"; }else{ // not a page name }
  11. try this one: <?php echo '<form method="post" action=""><input type="text" name="search" size="50" value="" /><input type="submit" value="test"></form>'; if(isset($_POST['search']) && trim($_POST['search']) != ''){ $file = file_get_contents("products/products.txt"); $searchstrings = trim($_POST['search']); $breakstrings = explode(',',$searchstrings); $shown = array(); foreach ($breakstrings as $values){ $lines = explode("|",$file); foreach($lines as $k=>$line){ if(stristr($line, $values) && !in_array($k,$shown)){ echo " string Found in '".str_replace($values,"<b>".$values."</b>",$line)."'<br>\n"; $shown[] = $k; } } } } ?>
  12. try something like this: (untested, may still have bugs) <?php echo '<form method="post" action=""><input type="text" name="search" size="50" value="" /></form>'; if(trim($_POST['search']) != ''){ $file = strtolower(file_get_contents("products/products.txt")); $searchstrings = trim($_POST['search']); $breakstrings = explode(',',$searchstrings); foreach ($breakstrings as $values){ $lines = explode("|",$file); foreach($lines as $line){ if(strpos($file, $values)){ echo $values." string Found in ".str_replace($values,"<b>".$values."</b>",$line)."<br>\n"; } } } ?>
  13. glad it's sorted out. Good luck
  14. no, you DO NOT use my code, it was just a loop I created to verify how it would deal with not having the closing tag on your form. try what I said in my first post: add </form> after your hidden field (inside the foreach loop) and test again.
  15. not sure I get what you're doing here... if, as you say, $practice_areas = "Commercial Litigation| Health Care Law & Consulting" why are you doing this if there is no [L] in $practice_areas ? $practice_areas = str_replace('[L]','',$practice_areas);
  16. man, I just did a little test here, and your problem is what I said the first time: you need to close the form. I used this to test: <?php if($_SERVER['REQUEST_METHOD']=='POST'){ echo '<pre>'; print_r($_POST); } for($i=1;$i<10;$i++){ echo '<form id="f1" method="post" name="f1"><input type="submit" name="submit" value="Delete Item"> <input type="hidden" name="h1" value='.$i.'></form>'; } ?> without </form> at the end, I always get the number 9, with </form> everything works.
  17. (I confess I only skimmed through half your code) but, since you're setting $captcha_passed to 1 after the first insert, you could set a $_SESSION variable at the same time so that you know the capture has been passed. You can even count the times it has been submitted and show the capture every 10 times (or whatever). // set the variable after $capture_passed to 1 if it doesn't exist yet or increment $_SESSION['captureCount'] = !isset($_SESSION['captureCount']) ? 1 : $_SESSION['captureCount']++; // use to decide if you should show capture again: only display capture if never used or every 10 times if( (!isset($_SESSION['captureCount'])) || ((isset($_SESSION['captureCount'])) && ($_SESSION['captureCount'] % 10 == 0)) ){ // show capture }
  18. since the only function you call before you try to send the headers is connect() I'm betting you have a mysql connection error. can we see what's in functions.php ?
  19. can you post the results of this: echo "<pre>" ; print_r ( $_SESSION ); echo "</pre>" ; So I can see the actual array please. thanks
  20. it seems you're only using a .csv because that was what you found online. Why not convert it to a database? Otherwise, every time you need to change something, you'll have to read the entire file into arrays, replace what you want, then convert the arrays back to a flat format and write the whole file back...
  21. you set smtp = localhost, so I assume you have an smtp server running on your machine?
  22. you don't seem to be closing the <form> element. add </form> to the end of this: <form id="f1" method="post" name="f1"><input type="submit" name="submit" value="Delete Item"> <input type="hidden" name="h1" value='.$key.'></form>
  23. the code above does work. check the following: 1. emails are in your spam folder 2. you typed the wrong email address 1. either you have a smtp problem
×
×
  • 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.