Jump to content

ktstowell

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by ktstowell

  1. Hi Folks, I'm trying to display some C# in a text area on my website that will maintain it's space and color formatting. I've used FireBug to analyze website that use this feature (like this one) and it's obvious a script is used to generate the formatting b/c i can't imagine somone writing a new <span> for every color change. Any have any good remedies for this, I've been google-ing for the better part of 3 hours with not much luck. Any help appreciated, here's a link to the site, w/ the source files in case you want to mess with them. http://ms-webdev.linnbenton.edu/stowelk/projects.php ktstowell
  2. Thank you! I finally realized that with the: if (isset($_POST['number'])) { $findNumber = $_POST['number']; } else { $findNumber = "0"; } ...bit you gave me, I'm still creating $findNumber via this isset() control structure, so having $findNumber = $_POST['number'] written a second time was the error line. Thank you for all of your help, taking all criticism and advice, as I am a brand new student of PHP and programming/scripting in general. ktstowell
  3. Thank you Oni - Kun, I am still getting the undefined index error, however, here is how i implemented your response: <html> <head> <title>Array Finder</basic> </head> <body> <h2>Geuss all the numbers in the array!</h2> <br /> <form method="post"> <input name="number" type="text" </input> <input name="submit" type ="submit" </input> </form> <br /> <?php if (isset($_POST['Sumbit'])) { echo "Try another number!"; } else { echo "Please enter a number." . "<br />"; } if (isset($_POST['number'])) { $findNumber = $_POST['number']; } else { $findNumber = "0"; } $array1 = array(5,9,10,45,98,101); $maxArray = max($array1); $minArray = min($array1); $findNumber = $_POST['number']; echo "<br />"; if(in_array($findNumber, $array1) == true) { echo "Yes, that number is in the array." . "<br />"; } else { echo "No, that number is not in the array." . "<br />"; } if((max($array1) == $findNumber)) { echo "That is the largest number in the array." . "<br />"; } else { echo "No, that is not the largest number in the array" . "<br />"; } if((min($array1) == $findNumber)) { echo "Yes, that is the smallest number in the array." . "<br />"; } else { echo " No, that is not the smallest number in the array." . "<br />"; } ?> </body> </html> I must be doing something wrong here, again, all advice appreciated. ktstowell
  4. Hi All, I'm extremely new to developing but am taking an interest in it rapidly. I've written this simple app that has a user guess a number in the given array and then gives the user clues to get the rest of them. No real purpose except for learning and progression for me the author. I run into a problem however upon loading the page for the first time, my $findNumber var has not been defined yet, and prints a line of code to the browser: "Notice: Undefined index: number in C:\wamp\www\sandbox\array_finder.php on line 31" I've experimented with empty() and isset() and just can't seem to avoid this issue, any help would be appreciated. Here is the app in full: <html> <head> <title>Constants</basic> </head> <body> <br /> <form method="post"> <input name="number" type="text" </input> <input name="submit" type ="submit" </input> </form> <?php if (isset($_POST['Sumbit'])) { echo "Try another number!"; } else { echo "Please enter a number." . "<br />"; } if(empty($findNumber)) { $findNumber = 0; } ?> <br /> <?php $array1 = array(5,9,10,45,98,101); $maxArray = max($array1); $minArray = min($array1); $findNumber = $_POST['number']; if(in_array($findNumber, $array1) == true) { echo "Yes, that number is in the array." . "<br />"; } else { echo "No, that number is not in the array." . "<br />"; } if((max($array1) == $findNumber)) { echo "That is the largest number in the array." . "<br />"; } else { echo "No, that is not the largest number in the array" . "<br />"; } if((min($array1) == $findNumber)) { echo "Yes, that is the smallest number in the array." . "<br />"; } else { echo " No, that is not the smallest number in the array." . "<br />"; } ?> </body> </html> Thank you for any help received. ktstowell
  5. lmao, word...but is it necessary for the redirect? meh, in the mean time ill experiment, thanks for the reply.
  6. just to clarify (after reading some other topics on headers) i receive no errors when i run this script, it simply does not send any info to my email unless the header is removed.
  7. Hey there! Can anyone tell me why when i add the header redirect on the top of my script my form no longer send the form data via email? <?php header ('Location: http://www.blueleafss.com/contact/thanks.html'); exit (); if (isset($_POST['Sumbit'])) { echo '<h1>Thank you for contacting Blue Leaf Systems and Support!</h1>'; }else{ $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; $phone = $_POST['phone']; $slocation = $_POST['slocation']; $clocation = $_POST['clocation']; $comments = $_POST['comments']; $text = ''; foreach ($_POST as $name => $value) { if (is_array($value)) { $text .= sprintf("%s: %s\n", $name, join('', $value)); } else { $text .= sprintf("%s: %s\n", $name, $value); } } $headers = 'From: ' . $_GET['from'] . "\r\n" . mail('myemail@mysite.com', 'Form data', $text); } ?> any and all help would be uber appreciated! thank you!
×
×
  • 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.