Jump to content

wcsoft

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Everything posted by wcsoft

  1. You could do something like this: <? $yes_sel = ""; $no_sel = ""; if ($formVars['Paid'] == "No") { $no_sel = "selected='selected'"; } else { $yes_sel = "selected='selected'"; } // end if echo <<<HTMLHERE <select name="Paid"> <option value="No" $no_sel>No</option> <option value="Yes" $yes_sel>Yes</option> </select> HTMLHERE; ?>
  2. Yeah, the problem is your create table is in single quotes, so that entire query is going to be run as a literal, meaning it's going to try and create a table named $school_name. bbaker's suggestion should work fine, or you can change to using double quotes, so it will actually parse the variable into a real table name.
  3. Basically, that's just a notice that the index doesn't exist in the array. You could check using the isset() function, and then check if it's blank if it does exist: if (!isset($_COOKIE['uid']) || !$_COOKIE['uid'])
  4. What does the URL look like when you click the next button? Is it the same as the url you posted only with the value of c being altered? What happens if you manually change c from 0 to 10 in the address bar itself and load that page?
  5. Yes, in that case, it wouldn't really reflect new categories. There are several ways to get around that. The easiest would be to modify your header code to set a cookie on each page load that is permanent, with the current timestamp, and use that for the comparison. With this, it doesn't matter if they are logged in or logged out, and it will store the true last visit time, since it updates on each page.
  6. That sounds like some type of shopping cart possibly? If so, then normally you'd be able to manage everything via some type of control panel. Do you know anything of the software that is being used? Homegrown, or some commericial application?
  7. Do you track the number of times the file has been downloaded in the db as well? If so, then you could easily just multiple the number of downloads by the file size.
  8. As typical, I really need to pay attention to the code I post. The $date portions, should just be date: $month = date("m"); $year = date("Y"); for($i=1;$i<=9;$i++) { calendar($month,$year,NULL); $month++; if ($month > 12) { $month = 1; $year++; } // end if } // end for
  9. Nope, the session handler will deal with the cookies, so no code changes necessary. I can't guarantee this change will fix the problem, but it sounds like it may be the culprit.
  10. You'd just need to put that into your root html directory and you should be good. It shouldn't affect your site at all as it just tells php how to track session ids, basically making sure to track them via cookie and not in the URL.
  11. You'd basically need some way to track 2 things: 1) The last time they visited your site. 2) The time that a category was created. You could do #1 with either a permanent cookie that you set when they visit. #2 would need to be done with a database. If you're using a db already for your categories, then you'd just add a timestamp that the category was created. Then basically, when the user visits your site you just do a comparison to see what categories have a timestamp greater than their last visit time. If any of them do, you'd display the "JUST ADDED" message.
  12. Normally this is controlled by a couple php settings: use_trans_sid and user_only_cookies. If you have access to your php.ini file you can change the first to 0, and the second to 1. If you don't have access to the php.ini but your host allows you to use htaccess, you could create an .htaccess file with the following: php_value session.use_trans_sid 0 php_value session.use_only_cookies 1
  13. wcsoft

    id

    Either of those would be done in your mysql manager. phpmyadmin, direct command line on the mysql shell. Basically whatever you use to execute sql commands on your sql server.
  14. Something like this would work: $month = $date("m"); $year = $date("Y"); for($i=1;$i<=9;$i++) { calendar($month,$year,NULL); $month++; if ($month > 12) { $month = 1; $year++; } // end if } // end for
  15. wcsoft

    id

    Two way. If you're deleting all of the data in the table, you can use the TRUNCATE command: truncate tablename That deletes everything, and resets the auto_increment field to 0 Or: ALTER TABLE tablename AUTO_INCREMENT=0;
×
×
  • 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.