Jump to content

guttyguppy

Members
  • Posts

    39
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

guttyguppy's Achievements

Member

Member (2/5)

0

Reputation

  1. That makes sense, but I don't know how to get the code querystring out of the url when they submit the form.
  2. I have two php files. The first has a field for a secret code the user gets from a package. They submit the code, and go to a second php file. If the code they entered is valid and unused, they see can fill out their address to receive a free sample of more product. If not, they are redirected back to the first php file and given an error message. If they try to access the 2nd php file directly, they are also redirected back to the first one. Everything is working fine, except when the user enters a valid code on the first page, enters their address on the second page, hits submit, gets a success message, and then hits the back button. If they do that, they see the address form again, and can potentially enter a different address, submit, and get the success message again. I thought I had it covered with if(empty($_GET['code'])||!isset($_GET['code'])){ header('Location: http://website.com/entercode.php?p=empty'); //they didn't enter a code, or they came directly to this page } else { //look up the code in the database, see if it's invalid or already used } in other words, doesn't the browser check for $_GET superglobals when the user hits the back button? Since the user stays on the second page, it seems as if the browser does check. Then why aren't they being sent back to the first page in that case?
  3. http://stevespets.com/wp/ Meet the puppies Those are posts of category meet-the-puppies with custom fields for breed, gender, color, and image Here's my code: <div id="puppyBig"> <div id="puppyBigPic"> <?php query_posts('category_name=meet-the-puppies&showposts=1'); while ( have_posts() ) : the_post(); $postid=$post->ID; $mugshot = get_post_meta($postid, 'mugshot', true); echo wp_get_attachment_image($mugshot, array('316x316')); endwhile; ?> </div><!-- end puppyBigPic --> <br/> <div id="puppyBigInfo"> Breed: <span id="petBreed"></span> Gender: <span id="petGender"></span> Color: <span id="petColor"></span> </div><!-- end puppyBigInfo --> </div><!-- end puppyBig --> <div id="puppyThumbs"> <?php query_posts('category_name=meet-the-puppies'); while ( have_posts() ) : the_post(); ?> <?php $postid=$post->ID; $mugshot = get_post_meta($postid, 'mugshot', true); ?> <div class="puppyThumb <?php if (get_post_meta($postid, 'gender', true)=='male'){echo 'blue';}?>"> <a href=""> <?php $scriptpath = get_bloginfo('template_directory'); $puppyThumb = wp_get_attachment_url($mugshot); echo '<img src="'.$scriptpath.'/scripts/timthumb.php?src='.$puppyThumb.'&w=83&h=83&zc=1" alt="" />'; //this method actually crops the image using timthumb //$puppyThumb = wp_get_attachment_image_src($mugshot); //echo wp_get_attachment_image($mugshot, array(83,83)); ?> </a> <br/> <span><?php echo get_post_meta($postid, 'breed', true);?></span> </div><!-- end puppyThumb --> <?php endwhile; ?> </div><!-- end puppyThumbs --> I want the thumbs to switch the large image and push the meta values in the right places, preferably on the fly w/ajax/jquery. Anyone who helps me gets 1 hour graphic design services of their choice-logo design, favicon/icon/badge design, etc and I'm the best if I do say so.
  4. Got it here: http://www.mt-soft.com.ar/2007/12/21/php-script-mysqldump/
  5. Hi, I need to back up a database, and I've tried numerous scripts but they all rely on either writing a backup file to the server or emailing the file. The server I'm working with seems to be extremely finicky and won't allow file writing or mailing, no matter what I've tried. And most importantly, it doesn't have cpanel so no PHPmyadmin. Is there a way to simply print/echo out the sump to a php page, so that I can just copy/paste the dump manually? Any help is greatly appreciated, thanks.
  6. OK, I'm guessing that would entail making a table just for that one question? How would I query that table to tally up the votes for submissions that list more than one answer?
  7. I'm building a survey, and most of the questions are multiple choice, i.e. radio buttons. I can easily find the total for each answer with queries like: select count(*) FROM survey where question3='answer5' However, one question is multiple answer, i.e. checkboxes. In this case, each submission may have more than one answer. In my processor script, I'm storing the data using the php serialize function, like: $multipleAnswer = serialize($_POST["multipleAnswer"]); so the data should be getting stored correctly, I hope. But I'm not sure how structure the query to fetch totals for each answer, if the user has chosen more than one. I hope I'm being clear enough, and thanks for your help.
  8. GG-here's how: $future = strtotime('4 July 2010'); $now = time(); $timeleft = $future-$now; $daysleft = round((($timeleft/24)/60)/60);
  9. Hi, how can I set a variable to contain the number of days left until a future date?
  10. Thanks Catfish, that helps. I'm still confused as to why they are different at the begginning; shouldn't they both be var or home?
  11. Here's my code: $curDir=getcwd(); $docRoot=$_SERVER['DOCUMENT_ROOT']; echo "current dir is:".$curDir; echo "<br/>"; echo "doc root is:".$docRoot; I'm getting : current dir is:/home/username/public_html doc root is:/var/www/ Why aren't those the same thing? I am having a really hard time understanding server environments, directory paths, so if you can forward any enlightening tutorials/explainations, it would be greatly appreciated. I've checked php.net, but I still don't get it. Thanks!
  12. I'm using the php script above to kill the firefix problem, but I'm still not sure if I'm forcing the reload of all the media on the page. Can someone confirm this either way?
  13. so it was the $. I guess I did it wrong, thanx
  14. Yeah, the $ is obvious-thanks for noting that, I fixed it-- but "hello world" still doesn't appear on the page. I don't get any errors, which is also a problem. I wish I did, but I can't find the right php code to paste at the top of my page so that I get error reporting (php.net is way confusing)
×
×
  • 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.