Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. how did those rows in `sup` get to be null in the first place? do you have it set as the default and when you insert a new row, leave that column blank? when you insert a new row, are you doing null or 'null' if you are putting something? point I'm trying to make is, maybe it's not really NULL but is storing a string of value "NULL" or an empty string "" (which is not the same as null), due to however you have your db or code setup.
  2. no. well, you can echo out a regular html meta redirect if you want... but you could rethink how you've got it setup in the first place to reduce those conditions. You can - make the form values for $_POST['question'] the same as the page names you want to redirect to. Like, make the values page1, page2,page3 (or just 1,2,3) and do: header("Location: " . $_POST['question'] . ".php"); or header("Location: page" . $_POST['question'] . ".php"); depending on the value. You can - make an array like so: $pages = array('house' => page1.php, 'foreclosure' => page2.php, 'bankruptcy' => page3.php); header($pages[$_POST['question']); Point being is that you don't need to make a condition for every option.
  3. right. ajax is one method that was mentioned, and it it does have its own advantages. He just asked about doing it with an image, so I explained it. The main advantage to doing it with an image is that it will work even if the user disables javascript.
  4. read the big capitalized sticky about header errors. http://www.phpfreaks.com/forums/index.php/topic,37442.0.html
  5. The 1x1 image is done as a request to a php page, passing an id via get method. For example: <img src='somepage.php?id=12345' /> somepage.php would then grab the id from $_GET['id'] to see that the user associated with the id is still there. You could use various info from the $_SERVER array that gets populated from the request, to track other stuff about the user, or you could add more vars to the query string. For instance, maybe a report-friendly page name: <img src='somepage.php?id=12345&p=pagename' /> So your image source would point to a script, vars passed, it processes the vars, and you would use the gd library to just load up or create on the fly just a simple little 1x1 transparent image and output it. Have that in an iframe with a meta refresh of every x seconds, and you've got yourself a non-javascript pinger.
  6. okay well you're still being kind of ambiguous...but here's what the onclick should look like for what you posted... <input name="change" type="button" id="change" onclick="document.getElementById('apDiv1').style.backgroundImage = 'url(/websites/sbsolution/systemfiles/images/accesspanelred.png)';" value="changeimages" />
  7. well everything else in your query string is hardcoded, so that leaves your variable. Echo out your variable before the query. Does it echo what it's supposed to?
  8. Most people like to shove their mistakes under the rug and try to erase the fact that it happened. I wear my pin my stupid mistakes on my shirt for all to see, like a boyscout's sash full of badges. See that way, I can prove I'm not talking out my ass when I say I know something. I have the mistake to prove that I fucked up and learned, so you don't have to just take my word for it.
  9. no...the 2nd argument for preg_replace is what you want to replace the pattern matched in the 3rd argument with.
  10. are you assigning the results of preg_replace to anything? It's not the same as preg_match where the results are put in the var specified in the argument. You have to assign the results to a var with normal assignment: // assuming you want to overwrite the same var... $getPoints = preg_replace("/CLp/", $clP, $getPoints);
  11. I understood your OP perfectly fine. If you call that function in your button's onclick, the background images for your two layers will swapped. That's what you asked for, that's what you got. If you wanted something else then you should have asked for something else. Be more specific. Give an example. Draw a picture if you have to.
  12. <script language="Javascript"> function swapBgImages() { var div1 = document.getElementById('apDiv1'); var div2 = document.getElementById('apDiv2'); // true: IE false: FF var temp = (div1.currentStyle)? div2.currentStyle.backgroundImage : getComputedStyle(div2,'').getPropertyValue('background-image'); div2.style.backgroundImage = (div1.currentStyle)? div1.currentStyle.backgroundImage : getComputedStyle(div1,'').getPropertyValue('background-image'); div1.style.backgroundImage = temp; } </script>
  13. nope. you can make it blank and it will just reload the page. I don't know if that would ruin your "strict" html though..you should probably specify the page name to comply with that, if applicable.
  14. You would just combine the two...this would be your showPictures.php. the form would call the same page its on. <?php $selectedImage = $_GET['dropdown']; // Performing SQL query $query = 'SELECT Image FROM tableImages where imageID = "'.$_GET['dropdown'].'"' ; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); // Printing results in HTML while($row = mysql_fetch_array($result)) { $img = $row['Image']; $image = "<img src='$img' />"; } // Free resultset mysql_free_result($result); // Closing connection mysql_close($link); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <?php echo $image; // put this wherever ?> <form action="showPictures.php" method="get"> <fieldset> <select size="1" name="dropdown"> <option value="nothing" selected="selected"> </option> <option value="1">Image1</option> <option value="2">Image2</option> <option value="3">Image3</option> </select> <input type="submit" value="Show" name="Submit" /> </fieldset> </form> </body> </html>
  15. you know..most email service providers would reject emails with stuff like that. particularly the email field.
  16. you want specific help, you need to give specific info. You said that your form gets pics, using a php file. How? You say that your php file uses a database. how? How are these pictures stored. How are they sent back to the client? if you want specific help, you need to give specific info.
  17. so that form at the top points to handle_form.php. And that ^ right there is handle_form.php. put echo "<pre>";print_r($_POST); in your handle_form.php
  18. so post your form.
  19. does showPictures.php dynamically generate the picture?
  20. and you have other scripts on your server that sends mail just fine? try using a different email address. maybe your email service is blocking it for some reason.
  21. change $HTTP_POST_VARS to $_POST also stupid question, but $mailto = "my-email.net"; is that what you really have in there or did you change it for posting purposes? because if that's what you really have in there, that's also why you're not getting an email.
  22. This is what it's supposed to be: mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] ) This is what you have: mail($mailto, $name, $email, $contact, $comments); I color coded them so you can compare. Judging by the names of yours vs. theirs, does it really look like to you that you have the right vars being used as the right arguments?
  23. so then I guess you must not really have a problem then, huh.
  24. or hey, how about this: $x = explode('.',$x); echo $x[0]; or preg_match('~^[^\.]*\.~',$x,$match); echo $match[0]; or $x = preg_replace('~\..*~','',$x); or this is always fun at parties: $x = strstr($x,'.',true); // php5.3+
  25. would be more effective to use ajax to just like, ping the server every 10-30 seconds, depending on how much error of margin you're willing to live with. Less margin == more resources being uses. But that still falls under category of users being able to disable js. Can't get around that. I suppose you could get creative and have a dynamically created transparent 1x1px image called from image.php with an id attached to it (image.php?id=xxx) in an iframe that's meta refreshed every x seconds.
×
×
  • 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.