Jump to content

WebStyles

Members
  • Posts

    1,216
  • Joined

  • Last visited

Everything posted by WebStyles

  1. seems fine to be, except you closed the function braces BEFORE you closed the echo quotes... instead of: } " at the end of the function, try: "; } then just call the function with: require_once("functions.php"); item("the name you want", "the number you want");
  2. instead of $file != "*.swf" you can use something like !strpos($file,".swf") check you strpos hope this helps
  3. if it was disabled by the host, you probably can't do much about it except beg him to enable it for you... have you tried exec ?
  4. read the rest of my fist post. I gave you a link to a list of ctype functions that will sort that out for you.
  5. read the manual (I gave you the link) the very first example sorts out that problem.
  6. Multidemensional arrays are THE SAME as normal arrays except each element can be another array... remove cabbage: unset($array['ASDA']['Veg']['Cabbage']);
  7. (you should read a bit about arrays) $array['ASDA']['Meat']['Pork'] = 45;
  8. You could use substr to grab the last character and then check it's type... also check out ctype functions here: http://pt.php.net/manual/en/ref.ctype.php
  9. echo implode(" + ",array_keys($list['ASDA']['Meat'])).' = ' . array_sum($list['ASDA']['Meat']); (assuming main array is called $list)
  10. in that case just check if it exists first: if(!isset($_SESSION['var2'])){ $_SESSION['var2'] = 1; }else{ $_SESSION['var2']++; }
  11. why are you using $var ?? you said "What I want it to do is increment the value of the session index everytime a user clicks 'submit'."... If you're storing this in a SESSION, each user will have his own value... (each user has his own session). If your goal is to have a global count of how many times the form was submitted, you need to store it somewhere else (database of .txt file or whatever)... it's basically the same as a page counter, but only activated on form submission...
  12. since that value is in seconds, just calculate how many seconds you want to subtract.
  13. I would change the script and send in two parameters: Website and timeout... so instead of: <body onload="TheNewWin($website);"> you would have something like: <body onload="TheNewWin($website,$timeout);"> That way you don't actually call your random websites for 10 seconds, you call them for 8, and then call your 'separator' page for 2 seconds, which in turn will call another random website when the time is up... Hope this helps.
  14. (what happened to the other post? I just answered this same question twice, and it seems to have disappeared from the forum.)
  15. in that case, you need something like this: // this grabs each title and creates a string with each one wrapped in single quotes $titles = "'".implode("','",$_POST['course'])."'"; // use the mysql IN command to check all the titles at once. Change course_title to your REAL field name mysql_query ("SELECT * FROM tbl_course WHERE course_title IN ($titles)");
  16. Try something like this: preg_match_all('/\<title\>(.*?)\<\/code\>/is', $str, $matches); echo '<pre>'; print_r($matches); echo '</pre>';
  17. not really... since you're searching for a specific course_id in your database, I'm assuming $_POST['course'] is just a number (or a reference) and therefor, does not need to be converted into an array. if(isset($_POST['course']){ $course = trim($_POST['course']); mysql_query ("SELECT * FROM tbl_course WHERE course_Id = '$course'") or die (mysql_error()); //... rest of database request }else{ echo 'No course selected.'; }
  18. most emails will detect that anything starting with http:// is actually a link, and they should do this automatically for you. You can however sent html emails where you would add the html code to link it: $body .= "\nPath: <a href=\"http://xxx/xxx/xxx/xxx/$target\">http://xxx/xxx/xxx/xxx/$target</a>"; hop this helps
  19. just put it in an <option> tag instead of an <optgroup>
  20. Yeah, I totally agree with mjdamato. But since your question was not "how should I organize the array", I didn't mention it.
  21. try changing while ($query = mysql_fecth_assoc($result)) { // grabs whatever value is in field 'Name' (of your database table) and stores it in a variable called '$field01' $field01 = $result['Name']; // same as above, but for field 'Username' $field02 = $result['Username']; ... } to while ($res = mysql_fecth_assoc($result)) { // grabs whatever value is in field 'Name' (of your database table) and stores it in a variable called '$field01' $field01 = $res['Name']; // same as above, but for field 'Username' $field02 = $res['Username']; ... } so that the results will be returned in an array called $res (i.e. that isn't being used for anything else)
  22. it reads ONE line at a time from your table (as long as they match the initial criteria) and returns them in an array... you have the variable names all messed up... $query is your query, then you're also trying to store the results in the same variable, and then trying to grab them from $result.... oh dear.
×
×
  • 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.