Jump to content

sKunKbad

Members
  • Posts

    1,832
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by sKunKbad

  1. If you are getting all this info from a database, wouldn't it be easier to just add a item # and quantity to the cart? When a user views the shopping cart or goes to check out, you could query your database for the details. A properly designed database of items would not have the same part number with options like: part 1, blue part 1, green part 1, pink instead you would have: part 1 part 2 part 3
  2. use the in_array() function, and have php check that the value of the checkbox or radio button is an acceptable value. Here is an example from a form on my website. $approx_pagesArray = array("1","2","3","4","5","6-10","11-15","16+","dont_know"); if(in_array("{$_POST['approx_pages']}", $approx_pagesArray)){ $approx_pages = urlencode($_POST['approx_pages']); }
  3. one the final page with the results, use: <?php echo "<pre>"; print_r($_SESSION); echo "</pre>"; ?> and share that output with me.
  4. nope... variable variables don't exist in php
  5. You can't create a variable or use it's value in the manner in which you have tried to do. I recommend using an array: <?php $josh1[] = "it worked"; for($i=0;$i<=3;$i++){ if(isset($jost1["$i"])){ echo $josh1["$i"]; } } ?>
  6. This is fine for showing what is in the array, but you aren't showing what code made the array. This is where your mistake is. Show the code.
  7. If you want the thumbnails generated from the full size images by php, you might take a look at the book "object-oriented php". If you go to the publisher's website (nostarch.com), and find the files associated with the book, chapter 6 has code that you can use with some minor modifications. The down-side to doing this is that with many pictures, or pictures that are very large, processing time can be quite long. (much of this depending on how large you set the thumbnails in size).
  8. It is obvious that phpfreaks has great forums for more than just php. Javascript, HTML, CSS, and a wide range of web development topics have their own forum. I'd like to see an SEO forum and a Web Standards forum.
  9. Thanks for checking it out. I was just confused (and still am) by the Apache vs. CGI. I made the switch, and so far so good.
  10. Sorry if this is the wrong board, but I figured this is probably the best place to get an answer to my specific question. I'm on a shared hosting server, and I have a choice to move to a new server if I want (where sendmail is enabled). There are probably also other differences, but I'd like to know if the new server is worth moving to. New server: http://biz30.inmotionhosting.com/phpinfo.php Current server: http://biz29.inmotionhosting.com/phpinfo.php
  11. I have a client that needs a directory script for a website/database that will categorize all USA preschools, baby-sitters, and day care facilities by zip, state, city, and area code. This client also a social network for the mothers/users of this same site, and we were hoping to find a complete "all-in-one" solution. Is there any type of all-in-one solution for this? I've seen many directory scripts online, and also many social network scripts. The client needs to be able to control everything from an admin panel, including banner ads, RSS feeds, YouTube feeds, etc. etc. Thanks for your help.
  12. declare one field to be a primary key, mysql won't let you insert the same primary key again
  13. Unless I'm wrong, I'm pretty certain that you won't be able to do this. If you find a solution, I am very curious to see what it is.
  14. Design the page with a background image that repeats in the y direction, giving the appearance of a sidebar (left column) that goes 100%.
  15. If you are talking about the functionality of the links, you will need to learn a little AJAX.
  16. You might need to close your option: <option value="Name">Name</option>
  17. I'd like to check a bunch of post variables, all of which will either be yes or null values, and then create variables for the ones that have yes values. For instance, if $_POST['apple'] has a value of yes, I want my script to create a variable named $apple, and give it a yes value. The script needs to create the variable by using the name of the $fruits array member or post var, but I just can't figure it out. Here is what I have so far: <?php $fruits = array("apple","orange"); foreach( $fruits as $fruit ){ if(isset($_POST["$fruit"])){ if($_POST["$fruit"] == 'yes'){ echo "$fruit"; //so here is where I would want the variable to be created from the post var or $fruits array member. } } ?>
  18. I guess you would need to know that whatever is posting to this page is responsible for setting the value of $_POST['diet_coke']. Whether it is a form or a cURL script or an AJAX script, the code that posts to this page decides the value of $_POST['diet_coke]. <input type="text" name="diet_coke" value='diet coke' />
  19. $_POST['diet_coke']='diet coke'; Here, the value of $_POST['diet_coke'] will be 'diet coke', so if you want to echo 'diet coke' you could just echo $_POST['diet_coke']; Make sense?
  20. why this line: $mailit = mail($to,$subject,$message,$headers); $message has no value. For $body, change $body to equal 'test body' and see if it goes through. $body = 'test body';
  21. Look at the action of your form. It shows "theking.php.htm", which is probably wrong. If it isn't, please supply your theking.php.htm script.
  22. Hey GmB, I just replied to your email. I sent you some files. Call me if you have questions. Phone number is in the email.
  23. This isn't a fix for your problem, but I made a script for a customer that used an xml file for the questions/answers. Since the server was running php5, I was able to use simpleXML to parse the questions/answers. Doing so was very simple: $quiz = new SimpleXMLElement($quizxml); foreach ($quiz->questions->question as $question) { ++$count; echo "<div class='question'>\n <div class='listnumber'>$count ) </div>\n <div class='listquestion'>" .$question->q. "</div>\n"; foreach ($question->option as $thisOption) { foreach ($thisOption->choice as $thisChoice){ echo "<div class=\"choice\">\n <input type=\"radio\" name=\"Q$count\" value=\"$thisChoice\" /> $thisChoice\n </div>\n"; } } echo '</div>'; }
  24. I didn't mean to buy the book. You can download the code from the book for free! I found that book. Its 20 bucks :'( I lose 10 hairs on my head for everyday I eat Ramen. Everyday I don't eat I lose 30 hairs. I'll go bald if I buy the book!!! LOL
  25. you will probably need to show the show_image.php script. i've been reading a book called "object-oriented php", details on nostarch.com. Find the downloads for this book and look at chapter 6. The scripts for this chapter generate thumbnails from a directory, exactly what you are trying to do.
×
×
  • 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.