Jump to content

thecard

Members
  • Posts

    104
  • Joined

  • Last visited

    Never

Everything posted by thecard

  1. Is there not a way?
  2. I have 3 working scripts: The HTML file. The JavaScript File. And the PHP file. They all work well toghether: The html parses data to the JS and the JS parses data to the PHP fine. The weird thing is that when I move the HTML file to another one of my sites, it calls the JavaScript file and then the JavaScript file calls the PHP file. The PHP file is just set to echo "YAY!"; But when the html file is on another of my sites (other than the one where the PHP and the JavaSript are kept) nothing is echoed. I know that the JS at least tries to call the PHP and can find the file for if I change the file name to something which does not exist, the site says an error message saying that the file does not exist. Thanks for any help. Sorry if I have been unclear.
  3. I'm a newbie, but you could in someway use the <noscript> tag I suppose.
  4. Here's the query I have already: "UPDATE tb_sites SET nav1='$site' WHERE full<'20' AND yhits>'$average' LIMIT 0, '$var'" In my database I have a table called tb_sites. tb_sites has 25 fields in it. 20 of them are: nav1 nav2 nav3 ...to... nav20 There is also another field called 'howmany' - this is a field which contains how many of the 'navs' are filled in. I want to run the query above but I would like it to do something like this: if (!$nav1) { update it } else if (!$nav2) { update it } else if (!$nav3) { update it } ... Am I just going to have to do this the slow way like I have done above? I'm preety confused!
  5. //Parses Name of Domain function parseUri (str) { var o = parseUri.options, m = o.parser[o.strictMode ? "strict" : "loose"].exec(str), uri = {}, i = 14; while (i--) uri[o.key[i]] = m[i] || ""; uri[o.q.name] = {}; uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) { if ($1) uri[o.q.name][$1] = $2; }); return uri; }; parseUri.options = { strictMode: false, key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], q: { name: "queryKey", parser: /(?:^|&)([^&=]*)=?([^&]*)/g }, parser: { strict: /^(?[^:\/?#]+)?(?:\/\/((?([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?:\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, loose: /^(??![^:@]+:[^:@\/]*@)([^:\/?#.]+)?(?:\/\/)?((?([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?:\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ } }; parseUri.(window.location); document.write(host); I have found this function (parseUri.) on the internet. (It parses Urls). Whats wrong with what I do next: parseUri.(window.location); document.write(host); Thanks.
  6. One word: AWESOME. Really didn't expect it to be that easy. Nice one widox.
  7. If I've got a variable which is a string of a URL, how can I strip the string down to just the name: e.g. http://www.phpfreaks.com/forums/index.php?action=post;board=1.0 goes to: phpfreaks.com is there a way?
  8. If I can do AJAX, should I always use it instead of normal mysql queries and php form processing? Should I just always use it when I can because of the obvious advantages (speed mainly)?
  9. Sorry if I wasn't clear to start with. Thanks all. This works perfectly: $query3 = mysql_query("SELECT SUM(hits) as TotalHits FROM tb_sites WHERE user='$user'") or die(mysql_error()); $row3 = mysql_fetch_array($query3);
  10. Don't really understand that -> is it meant to add the hits from all the records and store the data in $row3['TotalHits']; ? Because that doesn't work.
  11. I have a simple SELECT query: $query3 = mysql_query("SELECT hits FROM tb_sites WHERE user='$user'") or die(mysql_error()); $row3 = mysql_fetch_array($query3); Then I echo the output. "Hits" is a number btw. But if there is more than one output (more than 1 occurence of a record with user='$user') I want to add the outputs together and store that number in a variable. How could I do this?
  12. Thank you. I'm sure I'll work out a way to do it. I think I'll be able to do it without making a web service.
  13. That really is preety genius! Just wondering if I could then echo text on to the user's page through that? I Googled Web services. Seems like just what I've been looking for. How does Google Adwords do it? Through Web Servicing? Thanks for all you help.
  14. OK. I'll have a good study in the morning. Blimey -> just when I think I'm starting to get the hang of php and mysql I find out I gotta learn another one! Jokes. I love it really.
  15. How would I do this in JS? Bad question, I know. I know php and mysql preaty well -> is there away the "include" was in JS and that set off a script on my site collecting data from theirs? Oh sorry -> I don't just want to collect data, I kinda need to print some results of queries too! Ahh. I made a mess of this!
  16. If someone signs up for my site, then they get a piece of code to put at the bottom of their website: Something like this: <? Include(‘www…./…php’); ?> It includes a php file from my site into their site, it basically collects data from their site and stores it in my database and also echoes some output according to this data. My problem: I know that php doesn’t run on all websites, you have to buy special hosting. How can I make it so that the code would run on all websites? Will I have to use JavaScript? I know its possible using javascript because of google adwords and Bitvertiser ads... I'm really confused at the moment, I don't know how to think about solving this problem in the right way. If you can't give me an answer, please point me to a tutorial or something... Thanks for your time!
  17. I want to do this with a mysql query: Search for users who have the same ip address. Update these user's accounts.
  18. Yeah, great. I agree!
  19. I have 2 queries, I wrote one of them, and found the other on the internet as I find it preety confusing! I need to make them cause and effect: The first: $dothis = mysql_query("SELECT * FROM tb_users tb WHERE EXISTS(SELECT tb2.ip FROM tb_users tb2 WHERE tb.ip=tb2.ip AND tb.username<>tb2.username) order by ip") or die (mysql_error()); The second: $thisagain= mysql_query("UPDATE tb_users SET suspen='logged'") or die (mysql_error()); So basically if there is a duplicated ip of a users, I need all their account's "suspens" to be logged. Sorry, I'm a bit of a noob. I've tried changing select to UPDATE and loads of other stuff.
  20. Thanks but please can you explain or write the code on how I would do that. Sorry, I'm ok at php, but not very experienced by any means!
  21. Whats the best way to make a countdown timer in php to: Countdown from 10 seconds and then do a mysql query?
  22. Thanks. I didn't think it was THAT simple. (SOLVED)
  23. I have a simple if statement comparing a form input ($_POST) and a set variable. Basically this: if ($_POST['form'] == $var) ... I want to make it something like this: if ($_POST['form'] == I .$var) SO if the user types "I" then the variable it is true, but how do I make the space between I and .$var acceptable? I'm basically asking what the special character is for space when joining a string and variable I think because php doesn't recognise the space I put between the two. Thanks.
  24. You really are a genius lol. Nice one mate.
×
×
  • 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.