Jump to content

dooper3

Members
  • Posts

    161
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.fantasticode.com

Profile Information

  • Gender
    Male
  • Location
    London, UK

dooper3's Achievements

Member

Member (2/5)

0

Reputation

  1. The problem with doing this with the PHP script that you're making this ajax request to is that it's redirecting the ajax request, not the browser itself. You either need to perform the redirect with javascript after the ajax request by putting the following in the ajax callback: location.href = 'index.php'; Providing they've logged in correctly and you could do a different one if the login failed. Hope that helps
  2. Personally I would do as zeodragonzord suggests, however, if you want to leave your session intact as you've set it before, you could do as follows. You run a query like so: $result = mysql_query('SELECT * FROM users WHERE username = '.addslashes($_SESSION['username']).' LIMIT 1'); Then check if the result returned one row: if (mysql_num_rows($result) == 1) If so you get the data: $user_data = mysql_fetch_assoc($result); Then you do your if / else links: if ($user_data['usertypeid'] == 1) //do something else //do something else Overall it should look something like this: $result = mysql_query('SELECT * FROM users WHERE username = '.addslashes($_SESSION['username']).' LIMIT 1'); if (mysql_num_rows($result) == 1) $user_data = mysql_fetch_assoc($result); if (is_array($user_data) && $user_data['usertypeid'] == 1) //do something elseif (is_array($user_data) && $user_data['usertypeid'] == 2) //do something else else //do something for non-logged in users
  3. Well you could use a database table to store their last online date and time, then every time a webpage is loaded, check if that user is authorised, if they are then update the time they were last on to the current time. At the same time it checks whether they're registered it should also check whether the other people in the list have a time last online older than say, 5 minutes ago, and should remove those people, thus Only those around in the last 5 minutes will be in the table, and you can extract their usernames for your list of people online.
  4. Well assuming you're just wanting the one level of dynamic-ness (e.g. domain.com/page1, domain.com/page2 etc. not domain.com/page1/page2) you could use a .htaccess file and some simple PHP with a directory for the included files like so: .htaccess Options +FollowSymlinks RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . index.php [L] index.php //header goes here include('/pages/'.str_replace('/', '', $_SERVER['REQUEST_URI']).'.php'); //footer goes here Then you have a director called pages which has a file for each page (page1.php, page2.php etc). Easy. The htaccess sends all requests to the index.php file, which has the header and footer, and in between it includes the file from the pages directory that matches the bit of the url after the domain (minus the slash). Also, if you wanted it to do a 404 message for pages that weren't in the pages directory, you could adapt index.php to look like this: //header goes here $page = '/pages/'.str_replace('/', '', $_SERVER['REQUEST_URI']).'.php'; if (file_exists($page)) include($page); else print '<h1>Page not found</h1><p>The page you were looking for could not be found</p>'; //footer goes here
  5. Things to try: 1) How are you setting it? You should be using: set_time_limit(3000); or set_time_limit(0); 2) Is PHP running in safe mode? If so disable safe mode first otherwise there will be no effect. 3) I believe - though I may be wrong! - that you can only set this variable inside your php.ini file. Doing it in the script may not work. 4) Did you restart your web server (apache?!) after you modified php.ini (if you did)? If you didn't then the new settings may not be loaded.
  6. Are you actually displaying your table data to the public in an un-edited way like that? If so that is quite bad practice; especially if you have an incrementing unique index on the table (i.e. and ID field). Anyway. You can display the field contents as real hyperlinks if they are stored as real hyperlinks in the database. So that field would contain for example: <a href="/page/some-template" title="See Template">templates here</a> That way when you show the table contents, the data will be interpreted as HTML and a hyperlink will be shown.
  7. Thanks for the responses guys but no, I've no intention of putting the captcha code on each domain name (considering there's in excess of 150 of them, that would prove quite time consuming!), and I am aware of reCAPTCHA, but I do not want a third party CAPTCHA in this case, it has to be the php-based one I made. is there no other way of storing the hashed string generated by a CAPTCHA image other than using sessions?
  8. Hi, I am trying to set up a CAPTCHA Service to run across multiple domains, however with the traditional method of storing the hashed captcha string is by using HTTP sessions as I'm sure many of you know, but also, sessions do not work between domains, so I have no way of verifying the CAPTCHA (or indeed passing the information) from the CAPTCHA if I run it on another website. I must point out that it does work perfectly well on the website it's hosted on. Any ideas greatly appreciated. (Would cURL be an option?! I don't really understand cURL/never used it). Thanks.
  9. I'm not sure what that is, so I can't imagine I've done anything to affect how it works - as I say, it was working absolutely fine up until earlier today.
  10. For some reason my site has suddenly stopped working with the www in the url, it just doesn't communicate allegedly looking at the status bar in my browser. It was working fine until earlier today, and I'm stumped as to what's happened. The URL I prefer (which seems to have stopped working) is: http://www.fantasticode.com but the site is still working with: http://fantasticode.com Anyone got any ideas what's going on?! I'm truly stumped, I haven't changed the mod_rewrites or anything.
  11. Now it isn't really a class, just a function, but what would work and leave it much as before is taking the variables outside the quotes for the exec function, so just changing the exec line to the following: exec("ffmpeg -i -f {".$this->source."} {".$this->destination."}"); Oh, and leave off the () after "new convert" as we mentioned before.
  12. If you echo an array, it will just give you the word array, try using print_r() instead. You need to extract each row of data from the array using extract() If you show us a bit more code then we might understand the problem better.
  13. Forgive my ignorance, but surely "ORDER BY movieName" is an alphabetical sort...?
  14. 1 day, 8 hours and 58 minutes....
×
×
  • 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.