Jump to content

chibineku

Members
  • Posts

    1,278
  • Joined

  • Last visited

Posts posted by chibineku

  1. The problem lies somewhere in the piece of code that tries to assign a value to the variable $region. When I add some echos, like so:

    if(isset($_COOKIE["userid"]) || isset($_SESSION["userid"])) { $get_region_sql = "SELECT region FROM aromaAddress WHERE userid = '$ident'"; $get_region_res = mysqli_query($mysqli, $get_region_sql) or error_log(mysqli_error($mysqli)."\r\n"); $get_region_info = mysqli_fetch_array($get_region_res); $region = $get_region_info["region"];} else  if(isset($_COOKIE["region"]) || isset($_SESSION["region"])) {  echo "1";  $region = isset($_COOKIE["region"])?$_COOKIE["region"]:$_SESSION["region"]; } else if(!isset($_COOKIE["region"]) && !isset($_SESSION["region"])) {   echo "2";   $region = "uk";}

    It always echos '2'. Je ne comprend pas.

  2. It's all on the same domain, no subdomains. The cookie setting code:

    $expire=time()+60*60*24*7;	  if(isset($_COOKIE["region"])) { setcookie("region", "", time()-3600); }	  setcookie("region", $_GET["region"], $expire);	     header("Location: $ref2/$orderid2$cat2$id2$search2");   exit();

  3. Nope, on the next page. I set the cookie in an intermediate script that redirects to the referring page (before the user visits the map to select a region).Here is the most pertinent code:

    if(isset($_COOKIE["userid"]) || isset($_SESSION["userid"])) { $get_region_sql = "SELECT region FROM aromaAddress WHERE userid = '$ident'"; $get_region_res = mysqli_query($mysqli, $get_region_sql) or error_log(mysqli_error($mysqli)."\r\n"); $get_region_info = mysqli_fetch_array($get_region_res); $region = $get_region_info["region"];} else if(!isset($_COOKIE["userid"]) && !isset($_SESSION["userid"])) { if(isset($_COOKIE["region"]) || isset($_SESSION["region"])) {  $region = isset($_COOKIE["region"])?$_COOKIE["region"]:$_SESSION["region"]; } else if(!isset($_COOKIE["region"]) && !isset($_SESSION["region"])) {   $region = "uk";}}

  4. I have been messing about with ways to assign a region to shoppers on my site to determine postal rates. At the moment, during registration there is a SELECT with the different regions, which will be UK and then the other continents. Most websites detect this automatically, though, and I figure there must be pre-made databases or drop downs available with such information stored in the value for each option. I already have a database associating each country with it's ISO, which had to be done from combining two different freeware SELECTs that I found online. I can't seem to find something that suits this purpose though. Short of assigning a region code to each of over 200 countries, how do I do it? How does Amazon decide, when I choose United Kingdom as my country, what my postage will be?

  5. I have a map which when you click on it sets a cookie called region. I can verify in FF that the cookie is set and has the appropriate value. But when I try to read the cookie, I get nothing - no recognition that the cookie is set. I tried

     foreach($_COOKIE as $k => $v) {  echo $k." ".$v."<br />"; }

    And it simply didn't show up, though my session cookies did. I'm at a loss. If you need more info I will provide, obviously, but I don't know where to start. Anyone had the same experience?

  6. You have to work through the element and any children and copy it, creating a new element the class of which you can change. That's using vanilla JavaScript. Using jQuery, it's a much simpler matter:$('#elementid').attr('class', 'newclassname');Same works for id, which I don't think is straightforward to change manually.

  7. Ha, yeah. Well we're breaking it into more regions actually now that the test of theory has been done. I discovered after doing it that I already have a drop down region selector in my registration form so the map will be used for people updating the p&p rate as they shop. Btw, I offer up my own image map generator for anyone to use:http://development.sinaesthesia.co.uk/imgM...ker7radius.htmlIt used to have a little flaw that meant the x axis was off by about 15px but it works now.

  8. I really appreciate the effort, dsonesuk, but first time I tried the images didn't load. I noticed that there are excess characters at the end of each image filename, so I took that out and the map appeared but tends to flicker and only the rest of world region highlighting works. It looks like way more complicated JavaScript than is necessary.

  9. By a mile the best website I've seen up for review on this forum in 2 years. The design is clean, welcoming and fresh, the colours nice, the fonts clear... Very professional. I wish I had such an eye for design.

  10. A few factors involved in SEO that I think are fairly concrete:

    1. Use markup semantically - proper structure with as few unnecessary elements as possible, elements used correctly, and a logical flow of headings, etc. will be better ranked
    2. Don't repeat content to a ridiculous degree - use your important keywords in complete sentences
    3. Validate your code
    4. Properly redirect using 301s to retain link equity
    5. Handle error pages in a custom fashion so that a server 404 or 500 never appears
    6. Try to get incoming links from relevant websites - not just affiliate schemes where you'll get links from irrelevant sites
    7. Not a SE ranking issue, but pretty, properly rewritten URLs that make sense are far more appealing to the average user. Compare domain.com/index.php?mode=product&id=3 with domain.com/products/psoriasis/psoriasis-cream/3. A user looking for psoriasis treatments will definitely think the latter is what they want

  11. dsonesuk: Thanks for doing a wide test for me. I probably have some areas of overlap on my map - I used a self made image map maker which works, but some of the areas are close together and my mouse clicks weren't ultra accurate. I'll examine it for overlaps, which should stop the flickering. Given that we're on FF 3.6.8 I'm not sure I mind about ver 2.*

  12. That isn't a parent-child selector, it's supposed to change the display of #map_uk when you hover over #map_region_uk. Perhaps I have forgotten the syntax for such things..Edit: I just read that in order for the pseudo class to work, the affected element must be a child of the first. Dang. Thoughts for a way to work around that?

  13. I have tried just that, wirehopper, and there seems to be a problem somewhere. Here is the code:CSS:

    #world_map { width: 702px; margin: 0 auto;}#map_uk { display: none;}#map_europe { display: none;}#map_row { display: none;}#map_region_uk:hover #map_blank { display: none;}#map_region_uk:hover #map_uk { display: block;}

    HTML map:

    			   <div id="world_map">					<img height="304px" id="map_blank" width="712px" usemap="#regions" title="Please click on UK, Europe or Rest of World to set your postal region" alt="region picker" src="images/world_map_blank.gif" />					<img height="304px" id="map_uk" width="712px" usemap="#regions" title="Please click on UK, Europe or Rest of World to set your postal region" alt="region picker" src="images/world_map_uk_highlight.gif" />					<img height="304px" id="map_europe" width="712px" usemap="#regions" title="Please click on UK, Europe or Rest of World to set your postal region" alt="region picker" src="images/world_map_europe_highlight.gif" />					<img height="304px" id="map_row" width="712px" usemap="#regions" title="Please click on UK, Europe or Rest of World to set your postal region" alt="region picker" src="images/world_map_row_highlight.gif" />										<map name="regions">						  <area id="map_region_uk" shape="circle" coords="315,50,15" href="http://www.amazon.com" alt="UK">						  <area id="map_region_row1" shape="poly" coords="11,61,26,52,19,55,17,43,22,35,28,31,153,28,182,24,211,39,226,73,172,115,259,184,251,214,192,293,172,288,183,207,175,205,168,178,178,162,119,128,91,92,94,75,61,55,14,64" href="http://sinaesthesia.co.uk/images/world_map_blank.gif" alt="Rest of World" />						  <area id="map_region_row2" shape="poly" coords="315,89,290,112,291,133,310,156,329,151,342,157,342,165,351,183,347,195,363,237,380,238,405,213,408,203,422,217,434,187,429,184,417,193,411,168,435,132,417,138,392,99,367,93,349,91,346,82,313,88" href="http://sinaesthesia.co.uk/images/world_map_blank.gif" alt="Rest of World" />						  <area id="map_region_row3" shape="poly" coords="464,15,464,109,481,145,495,149,509,122,521,135,521,152,540,175,574,183,560,202,571,237,609,236,642,259,653,215,671,261,702,226,678,217,653,225,634,186,646,172,602,157,577,112,615,85,621,74,617,60,639,61,652,48,691,40,689,24,600,12,586,14,512,2,465,16" href="http://sinaesthesia.co.uk/images/world_map_blank.gif" alt="Rest of World" />						  <area id="map_region_europe" shape="poly" coords="463,18,460,108,446,111,420,136,393,101,382,86,370,86,353,86,341,78,317,89,308,89,308,69,320,70,345,50,334,38,347,31,360,21,381,19,407,25,465,17" href="http://sinaesthesia.co.uk/images/world_map_blank.gif" alt="Europe" />					</map></div>

    The hrefs are just placeholders just now. I am not sure that the :hover pseudo class of the areas is working. I've divided the rest of world area into 3 bits because each one already is a sea of coordinates. I wonder if I can re-use the map for the images the way I have. Any ideas on why it isn't working?

  14. I want to have a region selector in the form of an image of a map. When the user hovers over the UK, Europe or Rest of World, the image should change to one with that region highlighted. I've got the 4 images made. Can this be done with CSS or must I use JavaScript? The image will be turned into an image map and the link will be to the next page in the registration process with a URL parameter allowing me to write the choice to a database.

  15. After seeing not only the Family Guy episode dealing with suicide bombers, but also the Jeff Dunham Achmed the Dead Terrorist sketch, my image of the thighs of a virgin has changed somewhat - I now picture hairy, unwashed 30 year old man thighs, buried in a tracksuit as the owner plays Magic: The Gathering.

  16. Have you tried alerting the value of testing, to see what it contains? It seems like it should work from looking at it. Is there a src attribute for the image in question, or have you missed it out completely? If there is no src, then testing will be FALSE or NULL and not ''.

×
×
  • Create New...