I need a script that will hide - or not show an image until the page is refreshed. When the refresh button on the browser is hit - the picture appears. I've seen it done, but the script was hidden. Does anyone know how to do this? Thanks.
I tried to find out if this was possible with javascript, but it doesn't seem to be. This should work if you have php and the user has cookies enabled: <? if($_COOKIE['reloadcheck292']==1) { ?> //PAGE CONTENT WITHOUT IMAGE <? } else { setcookie("reloadcheck292", "1", time()+3600*12); ?> //PAGE CONTENT WITH IMAGE <? } ?> Code (markup): I've been working on this for about 20 minutes, so rep would be nice. Hope this helps you.
I'm pretty much a scripting nube - can you show me that script with the page urls (w/ and w/out image) in it. I'm unsure where to put them. Thanks.
The page url is the same as what your original page was. (Here's a better solution): <?php //(PUT THIS AT THE TOP OF THE FILE) if($_COOKIE['reloadcheck292']==1) { $pageisbeingreloaded=1; } else { setcookie("reloadcheck292", "1", time()+3600*12); $pageisbeingreloaded=0; } ?> //PUT YOUR EXISTING PAGE CODE UP TO THE PART WITH THE IMAGE YOU WANT TO HIDE OR SHOW <?php if($pageisbeingreloaded=1) echo '<img src="(image url you want to hide or show)">'; ?> //PUT THE REST OF YOUR PAGE HERE ?> Code (markup):
If you want to pay me, my e-gold account is 3693814 (my paypal is limited right now ). Or you could add to my forum rep at least. Whatever you think is fair... *shrug* Glad to help.
Shoot - Just tried it out and doesn't seem to be working right. Maybe you can check it out for me and see if I'm doing something wrong http://skidmarknews.com/test.php
Here is my code: <?php //(PUT THIS AT THE TOP OF THE FILE) if($_COOKIE['reloadcheck292']==1) { $pageisbeingreloaded=1; } else { setcookie("reloadcheck292", "1", time()+3600*12); $pageisbeingreloaded=0; } ?> <head> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 4</title> </head> <body> Testing Testing 123 <?php if($pageisbeingreloaded=1) echo '<img src="http://criticolatino.files.wordpress.com/2007/06/vanessa-hudgens-picture-1.jpg">'; ?> test </body> </html>
try replacing if($_COOKIE['reloadcheck292']==1) { with if($_COOKIE['reloadcheck293']=="1") { and setcookie("reloadcheck292", "1", time()+3600*12); with setcookie("reloadcheck293", "1", time()+3600*12); (note: you can reduce the max amount of time between reloads by changing the number part of "time()+3600*12" (it's in seconds -- 3600*12=12 hours))
Oh, wait, here's the bug: it should be if($pageisbeingreloaded==1)... so: <?php //(PUT THIS AT THE TOP OF THE FILE) if($_COOKIE['reloadcheck294']==1) { $pageisbeingreloaded=1; } else { setcookie("reloadcheck294", "1", time()+3600*12); $pageisbeingreloaded=0; } ?> <head> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 4</title> </head> <body> Testing Testing 123 <?php if($pageisbeingreloaded==1) echo '<img src="http://criticolatino.files.wordpress.com/2007/06/vanessa-hudgens-picture-1.jpg">'; ?> test </body> </html> Code (markup):
That worked. That's exactly what I wanted. I don't have an egold account. Is there a way to send me a bill with egold that I can pay w/ credit card? Also I've added to your rep. Thanks.