Jump to content

laffin

Members
  • Posts

    1,200
  • Joined

  • Last visited

Everything posted by laffin

  1. Oh than its not a sessions. If the cart info is the same, than check if the user id is the same as well. if they are both the same, than the script is not getting the right user_id, which u wud look at the login script, to see how it is retrieving the user record and how it uses it (session or just grabs a cookie for user authentication) if the user_id is different and the cart info is the same, than its a cart issue. u will have to locate where the cart information is loaded & saved, and be shure its tied to a user_id
  2. If its the script, and its using PHP session management (Yep, session_ functions). than u will have to debug yer script, if php is generating the same session id for all clients. u may want to add some debug code into yer script, tracking session id and user id. if this still fails, ya may want to look at a 3rd part session management routines. I have never really had problems with sessions myself. As long as session_start was at the top of the script. U can also try building smaller scripts with sessions for testing.
  3. Yeah, but if yer ok with php, ya can make it generate different question/answer combination. I did like the math solving ones myself 2 + 2 =
  4. The code shud destroy the cookie and the session data. But no matter wut code is being used, he sez it remains. So Either he is using some 3rd party session management or something is really broke with his php. I wud test the script on a local server (XAMPP/WAMP). or another host (a freehost should work) to test the script and the session management, if it works on another server. sumfin is broker with yer main providers php. At this point ya have 2 options, Request an upgrade to php on the server, or go with a different provider. if the same result happens, than its a script issue. this could be because the session manager is different (script implemented) rather than using the standard php session manager. if this is the case, than its a lot more work, as u have to spot the differences between default and 3rd party, as it may not be compatible.
  5. This is taken from php.net <?php // Initialize the session. // If you are using session_name("something"), don't forget it now! session_start(); // Unset all of the session variables. $_SESSION = array(); // If it's desired to kill the session, also delete the session cookie. // Note: This will destroy the session, and not just the session data! if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time()-42000, '/'); } // Finally, destroy the session. session_destroy(); ?>
  6. session_destroy(); session_regenerate_id();
  7. That says Client API Version Not Server Version. The Client Version is not MySQL Version, its the interface PHP uses to connect to the server.
  8. And u plan to do this without any knowledge of PHP? Grab a tutotial/book
  9. Q: how do u propose to get information from the mysql server without making a connection? MySQL servers don't need to be hosted on the same computer (and in larger environments, they get to be the only service on a server). only way is to ask the command line util to display wut version it is, but this is limited to if the host allows you to access the commandline mysql tool (if they didnt remove it in the first place). Just make a connection to the server with bogus credentials, than check the error code. that will tell u if a mysql server is there, if it is ask for user credentials, and recheck the mysql server and get the version.
  10. I think u should work on some php/mysql tutorials first to get to understand some of the concepts. cuz the hints here provided, and seems like ya want how to build the database, what fields/types to use.
  11. or if u want u can already check out some sites that provide a workgroup environment. Google Docs and Glide OS, which is a virtual desktop with java apps, I believe u can share documents with friends, and work on it.
  12. Sessions are not permament. As they rely on a cookie PHPSESSID without the cookie, there is no session data Even tho sessions are stoed in a database, don't rely on them to hold valid info for more than the current session (if the user does have cookies enabled).
  13. The medical statement shudn be working either! ya have == yes which makes yes a constant, not a variable/string The other problem is that there is no die/exit statement after the header redirction. if u have a header redirection, u dun want to continue with the script. so place a die immediately afterwards thats why it SEEMS that medical is the only one working.
  14. nice catch, I think the extra parameter is $name remove that shud be ok email/to can look like, [email protected] or <'Real Name'> [email protected] I believe, been awhile since I used mail function
  15. a bunch of ways to do this strpos & substr find the colon, and grab everything before it preg_match, wud match the pattern of yer query, but it creates a new set of arrays I believe the pattern for preg match wud be '@(.*?)\:.*@' but the strpos method is faster Hope that helps
  16. Use a database. readup on mysql or sqlite (sqlite is part of php5) mysql ya can find a lot more tutorials for. It sounds like u dun have a clear idea of how it all works. start with data, how will the data be organized/stored/manipulated. than work on the interface
  17. U use both. BBcodes is there so that yer users dun enter any mailicous html/javascript and so forth. it gives the user a way to add decoration to their posts. so u would have to strip/replace html/javascripting character codes. this is a good site for bbcode help and some basics bbcode.org
  18. Either store the data into a hidden field, or pass the data thru sessions.
  19. As Ive said in previous posts, u should look at the data and how to organize first. jackPf does make a good point in multiple songs for a band. u can even add genres, and so forth. but first design yer data fields and tables songs table (id, band id, genre id, title, url) band table (id, genre, name,) genre table (id, name) and so forth, by keeping the tables seperate, u will give yerself a bit more fleibility in the future.
  20. $return=strpos($string,"\n"); is how u detect newlines within a textarea. u can also use explode to get the lines into an array $lines=explode("\n",$string);
  21. <?php $counter = 0; function addcounter() { global $counter; counter++; } for($i=0;$i<5;$i++) addcounter(); echo $counter; ?> nothing hard about it at all
  22. Looking at it it kinda give me a headache. I see a lot of repetition. I trhink ya shud scrap this, and decide how ya want the data layout to be. Write them down echo '<h1><span class="red_upcap">' . ucwords($row_rs_subcategories['category']) . ' > ' . ucwords($row_rs_subcategories['sub']) . '</h1>'; like this line I see a pattern here. I see that echo '<h1><span class="red_upcap">' is used after every if statement u have so it makes sense to put this before the ifs, reducing the replication of code also you are not validating your forms. if this is retrieved, u should validate the info. the code checks the existance of categories and sub, however if this is from a from, than most likely both are being sent (unless you are using a checkbox) so it will always pass, and never reach the. $category = isset($_GET['category) ? ($_GET['category'] > 0 ? $_GET['category '] : 0) : 0; This just sets the category, if it fails validation (<=0) than it is set to 0, if it dusn exist it also is set to 0. and u do same thing with the sub category. As stated most form inputs send the data, so its the scripts job to check if these are valid entries.
  23. gee and I thought that making yer own function was also good for as well... <?php funtion my_escape($string) { return mysql_real_escape_string(trim($string)); }
  24. Either Update yer sort function to include the other two arrays. keeping them all aligned. its not hard to make yer own sort function, <?php $arr=array(5,4,3,2,1); $arr2=array('a','b','c','d','e'); $c=count($arr); $k=array_keys($arr); print_r($arr); print_r($arr2); for($i=0;$i<($c-1);$i++) { for($j=$i+1;$j<$c;$j++) { if($arr[$k[$i]]>$arr[$k[$j]]) { $t=$arr[$k[$i]]; $arr[$k[$i]]=$arr[$k[$j]]; $arr[$k[$j]]=$t; $t=$arr2[$k[$i]]; $arr2[$k[$i]]=$arr2[$k[$j]]; $arr2[$k[$j]]=$t; } } } print_r($arr); print_r($arr2); ?> as a simple sorter, since we want to be shure the array element exists we pull the array keys, so it avoids errors if yer arrays use values instead. in the swap routine, is where u add yer other arrays for swapping as well.
  25. Its a subset of SQL, not like MySQL. But yea SQLite uses a local file no ports to go thru so depending on the read/write ratio it can be faster the MySQL.
×
×
  • 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.