Jump to content

Branden Wagner

Members
  • Posts

    111
  • Joined

  • Last visited

    Never

Everything posted by Branden Wagner

  1. Well, on the webpage, there is a drop down box How Many School are you going to put information for: [Dropdown] {Javascript shows multiline text boxes for each school based on the above dropdown} so then how would i process that using php in an array?
  2. Sorry, i guess i should have put that in the first post.. when the loop is done it should have variables like $school_1_tmp $school_1 $school_2_tmp $school_2 ... based on the variable $school_num they sey earlier on in the form(usually ranges between 1 and 5). Basically i was trying to create a loop to iterate through the users input, to collect information on the schools they input. i didnt know how to put the 2 lines on into 1 thus why i used school_1_tmp and school_1... so if its a better idea to combine them, that works for me too. right now i get syntax errors... Unexpected T-variable.
  3. for($i = 1; $i == $school_num; $i++) { ${school_$i_tmp} = strip_tags(strip_mq_gpc($_POST['school_${i}'])); ${"school_$i} = preg_replace('/\r?\n/', '<br>', ${school_$i_tmp}); } whats wrong with this? how can i fix it? thanks
  4. what error did you get? it should be... $name = mysql_result($result,'1','chatroomname'); you have to have a number... as the row.. so whether its result 1,2,3 you have to use 1,2,3
  5. Im pretty sure there isnt one.. but you can do one pretty quick check http://us2.php.net/strings to see if you got it. function repeat($string,$number) { $output= ''; for($i=0;$i==$number; $i++) { $output .= $string; } return $output }
  6. oooh ok. ^ is not a wildcard character. (sorry i mis understood what you wanted) what you want is regex(Regular Expressions) to fix this. dont quote my regex cuz it sucks... http://us2.php.net/manual/en/function.preg-match.php if(preg_match('English[a-zA-Z0-9]+', $Education1) && .....
  7. that code works for me... try making some very basic pages... (no login script). page1 <? session_start(); $_SESSION['username'] = "MyName"; echo "Hello! ". $_SESSION['username']."<br />"; ?> <a href="page2.php">Click here to continue</a> page2 <? session_start(); echo "Hello ". $_SESSION['username']. echo "You made it to page 2"; ?> that code SHOULD work. if it doesnt... then there is a problem with your server/php/apache...something. if it does work.. then we know its one of the other pages.. something typed wrong. try on studenthome.php putting in at the bottom print_r($_SESSION); see what happens
  8. What do you mean as far as Wildcar? basically you have $Education1 $Education2 $Education3 $Education4 and you want to check to see if any ALL of them not-equal??? English^ or do you want to see if ANY of them not-equal English^ if you want to check to see if ANY of them do..then use || instead of && is that what you were trying to do? or did i misunderstand
  9. how do you plan on doing it without scrolling? if there is too much information for the box/frame/iframe/page/browser... it will scroll. what kind of information.. or rather is it 10 quick little facts or is it sentences of description? the only way to prevent it from scrolling would be CSS... but i dont know exactly what that would be. just google CSS no scroll
  10. obviously you didnt read: http://us.php.net/manual/en/function.setcookie.php 3600 is 1 hour in seconds... so your answer is time()+ {1 week in seconds}
  11. theres the problem... session_start() has to be put at the top.. or BEFORE anything gets output to the browser meaning... there can NOT be ANY html or blank lines before the session_start. also its supposed to be $_SESSION not $SESSION.. see the difference? soo..... <? session_start(); ?> <html> <head> <title>Gibson Partners -- Student Center</title> <link rel="stylesheet" type="text/css" href="css.css" /> </head> <body> <div id="top"> <?php include("leftnav.php"); ?> <div id="main"> <table width="90%"><tr><td> Hello <?php if(!isset($_SESSION["sessionname"])){ echo "You must be ogged in to do this!"; }else{ echo "Welcome ".$_SESSION["sessionname"]; echo "YAY IT WORKED!!!"; echo "<a href="logout.php">Logout</a>"; } ?> </td></tr></table> <div id="right"> <?php include("right_border.php"); ?> </div> </div> </div> </body> </html> try that and see if that works for you
  12. this link has some examples that might help you http://us.php.net/manual/en/function.mail.php Who are you hosting with? Because i ahve found some hosts, will prevent you from using the mail() function. i would also do it like this (for easier reading) $to = "someone@example.com"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "someonelse@example.com"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; but all you really need are just the first 3 parameters mail(to,subject,message). to my knowledge there arent any additional features to validate if it was sent
  13. can you put the code to BOTH pages?
  14. it should be just example.com not http://www.example.com
  15. is the selected area, a picture? is it always the same picture? is the selected area a color pallete? you want to look into both of these imagemagick GD Library One of those will be able to do it. If you have code, I can help you write it, but i wont write it for you.
  16. first.. read a little on http://us.php.net/manual/en/function.setcookie.php second change setcookie("try", "Me Try", time()+3600); TO setcookie("try", "Me Try", time()+3600, "/", YOURDOMAIN); [code] [/code]
  17. Can you give me an example of what you are looking for? example.... go to google and search for: "pure intellect" Pureintellect.Com: 2nd result go to yahoo and search for: "pure intellect" Pureintellect.Com: 9th result go to msn and search for: "pure intellect" Pureintellect.Com: 1st result Is that what you want it to do?? because the only way to do that would be to actually do the search and then parse the page, it would be a very long and complicated process.
  18. I would take off the session you are passing to the url, and to the page that you are going to 'studenthome.php' ALSO needs to have session_start(); at the top of it... every page that uses session needs to ahve session_start();
  19. I would think you would do this using Javascript, i dont know how you would do that via php, with the exception of... making every pixel in the image an image map-> sending it to GD2 and then getting the RGB values for it. Whats the purpose? do you have one image? or a color pallete? that the user selects a color from.. to do what with?
  20. What did it do? did you get an error?
  21. You cant login to a .htaccess file... nor can you bypass it... is the site that uses the .htaccess on YOUR server? if its your server, then just remove/rename the .htaccess file to temp.htaccess do what you need, then change it back or someone elses? if its on someone elses the only way to bypass it is to "brute force" it.. but no one here is going to teach you how to do that.
  22. I think whure looking for is how to force download... just google "php force download" there are a bunch of different ways.. but basic concept is using headers making the its content-type an application so that the browser doesnt try to parse or read the file, whether its html, or php or whatever it may be.
  23. change $sql = "SELECT * FROM checkout WHERE bidnum=$di"; $query = mysql_query($sql); to $sql1 = "SELECT * FROM checkout WHERE bidnum=$di"; $query1 = mysql_query($sql1) or die(mysql_error()); AND change $sql = "SELECT * FROM checkout WHERE bidnum=$di"; $query = mysql_query($sql); to $sql2 = "SELECT * FROM checkout WHERE bidnum=$di"; $query2 = mysql_query($sql2) or die(mysql_error());
  24. All of that is compatible... if you are using Ubuntu.. then you can open a terminal and type sudo apt-get apache2 php5 but the problem is telling you that you have a syntac error.. meaning there is something mistyped on line 66.. what does line 65-67 have on it? or you can just install apache2 and php5 through apt and your php will work just fine.
  25. make sure you are putting session_start(); at the beginning of every page you want to use the session.. that should be all you need
×
×
  • 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.