Jump to content

benji87

Members
  • Posts

    136
  • Joined

  • Last visited

    Never

About benji87

  • Birthday 07/19/1987

Contact Methods

  • MSN
    benjigordon@hotmail.com
  • Website URL
    http://www.get-xbox-kinect.co.uk/

Profile Information

  • Gender
    Male
  • Location
    Portsmouth, UK

benji87's Achievements

Member

Member (2/5)

0

Reputation

  1. I fixed it guys. I needed to upgrade to the latest version of jquery. I was using an older version in order for a certain plugin to work.
  2. Thanks for all the articles. It's a real problem as I can't influence my users choice of browser etc and I need to fix the problem! As many users especially my target market may become concerned if an error like that pops up and are likely to close down the window and go elsewhere. Does anyone know of any fix I can try my end to stop this happening?
  3. I've looked at the link pornophobic but I can't see how that would be connected as it's not opening up an additional program it's simply opening a link. rwwd I've updated my script with what you posted. The semi colon is to close the else statement? I'm still having the same issue though
  4. Hi Guys, Been a while since I've been on the forums but I have a really bugging problem that I've never seen before. I have two websites one of which is http://www.get-xbox-kinect.co.uk which I have used the same php script for. The script fetches a link from the database when executed by the user clicking a external link. I have had reports from users saying that when they hit a link the external page loads up but at the same time an alert window appears saying 'not enough memory at line xx'. For some reason it seems to be a different line number for different users too. I can only confirm this happens in IE8 but I guess it will probably do the same thing in IE6 and 7 too. It is not an issue however in Firefox or Safari. Here is my exit link script <?php include('./globals.php'); $affiliate = $_GET['affil']; $user_ip = $_SESSION['user_ip']; date_default_timezone_set('Europe/London'); $date = date('D, d M Y H:i:s'); $entry_url = $_SESSION['referer']; $result = mysql_query("SELECT url FROM affiliate WHERE affiliate = '". $affiliate ."'") or die(mysql_error()); $row = mysql_fetch_array($result); $exitlink = $row[0]; if($user_ip == '00.00.000.00') { header("Location: " . $row["url"] . ""); } else { $result = mysql_query("UPDATE affiliate SET clicks = clicks +1 WHERE affiliate ='$affiliate'") or die(mysql_error()); mysql_query("INSERT INTO affiliate_clicks (affiliate, user_ip, date, entry_url) VALUES('$affiliate', '$user_ip', '$date', '$entry_url') ")or die(mysql_error()); header("Location: " . $row["url"] . ""); }; ?> Not sure if it actually has anything to do with this script or it's something else at play. I'm sure someone must have come across this problem before. Any help would be much appreciated! Thanks.
  5. Brilliant! I finally got it working! Thanks for all your help! I still got a blank page after using the final code u gave me. So i put all error reporting on and found that the code had the min and max font size missing! After that it worked fine.
  6. I just get a blank page? Here is my current code: <?php function get_tag_cloud() { include "db.php"; $minimum_count = 0; $maximum_count = 0; $result = mysql_query("SELECT tag, link, count FROM tags ORDER BY tag"); while($row = mysql_fetch_array($result)) { if ($row['count'] > $maximum_count) { $maximum_count = $row['count']; } if (!$minimum_count || $row['count'] < $minimum_count) { $minimum_count = $row['count']; } $tags[$row['tag']]['count'] = $row['count']; $tags[$row['tag']]['link'] = $row['link']; } $spread = $maximum_count - $minimum_count; if($spread == 0) { $spread = 1; } $cloud_html = ''; $cloud_tags = array(); // create an array to hold tag code foreach ($tags as $tag => $info) { $size = $min_font_size + ($info['count'] - $minimum_count) * ($max_font_size - $min_font_size) / $spread; $cloud_tags[] = '<a style="font-size: '. floor($size) . 'px' . '" class="tag_cloud" href="tagprocess.php?tag=' . $info['link'] . '" title="\'' . $tag . '\' returned a count of ' . $info['count ']. '">' . htmlspecialchars(stripslashes($tag)) . '</a>'; } $cloud_html = join("\n", $cloud_tags) . "\n"; return $cloud_html; }; ?> <h3>Sample Tag Cloud results</h3> <div id="wrapper" <!-- BEGIN Tag Cloud --> <?php print get_tag_cloud(); ?> <!-- END Tag Cloud --> </div>
  7. Were getting there! I now have this error: Warning: Invalid argument supplied for foreach() in /home/alns/public_html/contactfrm/tag.php on line 28
  8. I think were finally getting there but ur going to hate me because i forgot to include this bot of code in the quote <h3>Sample Tag Cloud results</h3> <div id="wrapper" <!-- BEGIN Tag Cloud --> <?php print get_tag_cloud(); ?> <!-- END Tag Cloud --> </div> which does include get_tag_cloud(); This is what displays all the tags obviously. How do i display the tags with ur code without that function?
  9. Yer this is the whole script i posted
  10. I already have the link id saved in the database, that is what im trying to fetch. But it doesnt work inside the $cloud_tags[] although it does work if i try and echo it just after the sql query. Therefore something is preventing it from working inside the $cloud_tags[] or before but i dont know what. How would i put the link into the array and would that make it work?
  11. But im not trying to sort anything im trying to get it to register the $link variable inside $cloud_tags = array()
  12. Just create how you want the email to look with tables and logos etc in html, then echo it out inside the email sript.
  13. I cant for the life of me how to register the row link from a table as a variable in my script! This sounds really stupid but i can register it obviously be doing $link = $row['link'] but this will only work if i put it just under the sql query. but if i try and echo it where i want it which is in the clouds tag array as a variable being passed through the url it wont register!! Here is my code <?php function get_tag_data() { include "db.php"; $result = mysql_query("SELECT tag, link, count FROM tags"); while($row = mysql_fetch_array($result)) { $arr[$row['tag']] = $row['count']; $link = $row['link']; // // this is where i can echo links echo =$link // // } ksort($arr); return $arr; } function get_tag_cloud() { // Default font sizes $min_font_size = 12; $max_font_size = 30; // Pull in tag data $tags = get_tag_data(); $minimum_count = min(array_values($tags)); $maximum_count = max(array_values($tags)); $spread = $maximum_count - $minimum_count; if($spread == 0) { $spread = 1; } $cloud_html = ''; $cloud_tags = array(); // create an array to hold tag code foreach ($tags as $tag => $count) { $size = $min_font_size + ($count - $minimum_count) * ($max_font_size - $min_font_size) / $spread; $cloud_tags[] = '<a style="font-size: '. floor($size) . 'px' // this is where it wont register! . '" class="tag_cloud" href="tagprocess.php?tag=' . $link . '" title="\'' . $tag . '\' returned a count of ' . $count . '">' . htmlspecialchars(stripslashes($tag)) . '</a>'; } $cloud_html = join("\n", $cloud_tags) . "\n"; return $cloud_html; }; ?> <h3>Sample Tag Cloud results</h3> <div id="wrapper" <!-- BEGIN Tag Cloud --> <?php print get_tag_cloud(); ?> <!-- END Tag Cloud --> </div> I know there must be a simple solution i just dont know how to solve it! Ive spent hours playing around with this. Cheers
  14. Ok i figured out how to increment the count by parsing the url to a php file like you explained. But in the url i need to parse the link variable but i cant get the link to variable to register from $link = $row['link'] inside the cloud tag array. If i try and echo it before ksort() then it works no problem but i need it inside the cloud tag array! here is my code, i just to sort this and its done! <?php function get_tag_data() { include "db.php"; $result = mysql_query("SELECT tag, link, count FROM tags"); while($row = mysql_fetch_array($result)) { $arr[$row['tag']] = $row['count']; $link = $row['link']; // // this is where i can echo links echo =$link // // } ksort($arr); return $arr; } function get_tag_cloud() { // Default font sizes $min_font_size = 12; $max_font_size = 30; // Pull in tag data $tags = get_tag_data(); $minimum_count = min(array_values($tags)); $maximum_count = max(array_values($tags)); $spread = $maximum_count - $minimum_count; if($spread == 0) { $spread = 1; } $cloud_html = ''; $cloud_tags = array(); // create an array to hold tag code foreach ($tags as $tag => $count) { $size = $min_font_size + ($count - $minimum_count) * ($max_font_size - $min_font_size) / $spread; $cloud_tags[] = '<a style="font-size: '. floor($size) . 'px' . '" class="tag_cloud" href="tagprocess.php?tag=' . $link . '" title="\'' . $tag . '\' returned a count of ' . $count . '">' . htmlspecialchars(stripslashes($tag)) . '</a>'; } $cloud_html = join("\n", $cloud_tags) . "\n"; return $cloud_html; }; ?> <h3>Sample Tag Cloud results</h3> <div id="wrapper" <!-- BEGIN Tag Cloud --> <?php print get_tag_cloud(); ?> <!-- END Tag Cloud --> </div> Please help!
  15. Ok ive got that sorted there is only one entry per tag and the count is incremented. Now how do i get the link variable to work and increment of +1 in that tags row everytime a tagis clicked?
×
×
  • 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.