Jump to content

RLJ

Members
  • Posts

    121
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

RLJ's Achievements

Member

Member (2/5)

0

Reputation

  1. just to clarify, code as in PHP code. I.e. what's the PHP script I need to give access to a file where direct access has been blocked. Cheers
  2. Hi all, This is probably a very basic question, but it's the first time I've had to deal with it and I can't find a direct answer anywhere online. I have blocked direct access to a file that a user has uploaded in the Apache configuration and in the .htaccess file, so that the file is only accessible through a viewing (PHP) script, which will determine whether the access is allowed or not depending on several factors. What is the actual code I need to give access? Thanks!
  3. Yeah passwords are encrypted, but I would rather not that the webhost can access any information stored in the database. Is there any way of preventing this? The webhost that I am using is iPage (www.ipage.com). Cheers.
  4. Hi all, This is probably a very basic question, but it has recently come to my attention that the support team of the webhost that is hosting my website+database (shared hosting) can create a new user with full privileges and access my database. Is this normal? Seems like a bit of a security gap... Can I prevent this? Thanks!
  5. also if I comment out the banner.load function so that it should just change banner.gif for loading.gif, it doesn't seem to work
  6. A thanks, but I had already tried that as well, it doesn't seem to be working. What I have is the following: <html> <head> <script type="text/javascript" language="javascript"> function bannerload(){ var banner = new Image(); var loading = new Image(); var bannerElement = document.getElementById("BANNER"); banner.src = "IMG/BANNER1-2.gif"; loading.src = "IMG/loading.gif"; banner.onload = function() { bannerElement.removeChild(bannerElement.lastChild); bannerElement.appendChild(banner); }; bannerElement.removeChild(banner); bannerElement.appendChild(loading); } </script> </head> <body onload="bannerload()"> <div id="BANNER"> <img src="IMG/BANNER1-2.gif" alt="Banner" /> </div> </body> </html>
  7. I have tried the following: <html> <head> <script type="text/javascript" language="javascript"> var banner = new Image(); var loading = new Image(); var bannerElement = document.getElementById("BANNER"); banner.src = "IMG/BANNER1-2.gif"; loading.src = "IMG/loading.gif"; banner.onload = function() { bannerElement.removeChild(bannerElement.lastChild); bannerElement.appendChild(banner); }; bannerElement.removeChild(banner); bannerElement.appendChild(loading); </script> </head> <body> <div id="BANNER"> <img src="IMG/BANNER1-2.gif" alt="Banner" /> </div> </body> </html> But it's not working, can someone see where I've gone wrong? Thanks.
  8. Hi all, I have an animated GIF banner on my website that is around 2MB. Currently, I use the following Javascript to preload the banner before the page is displayed: <!-- preload images banner = new Image(); banner.src = \"IMG/banner.gif\"; // End --> However, for people with slower internet connections, I want to write some Javascript that will achieve the following: - page loads up and displays with (small image size) loading.gif instead of banner.gif - banner.gif starts downloading "in the background" - when banner.gif has fully downloaded, loading.gif is replaced with banner.gif and banner.gif starts playing This seems easy, but I'm new to Javascript so I could use some help! Can somebody show me how to do this? Thanks! P.S. if you're thinking why do I need Javascript to do this, it's because if I just include banner.gif as an HTML image (and without the pre-loading Javascript above), it starts playing (and jittering) before it's fully loaded. But perhaps this also depends on the browser.
  9. A yes, thanks. Stupid mistake, I was running the code several times and adding more and more to $emails. Cheers.
  10. Hi all, I have the following code that queries a MySQL database and outputs results on-screen. $result= mysql_query (" SELECT email,firstname,lastname FROM tablename WHERE ID IN('".$IDs."') "); if (!$result) {die('Error: Could not search database. ' );} while($row = mysql_fetch_assoc($result)) { echo $row['firstname']," ",$row['lastname'],"<br />"; $emails[]=$row['email']; } var_dump($emails); var_dump($IDs); However, the two var_dump's output the following (in the case of 2 results for the query): array(6) { [0]=> string(14) "email1@email.com" [1]=> string(23) "email2@email.com" [2]=> string(14) "email1@email.com" [3]=> string(23) "email2@email.com" [4]=> string(14) "email1@email.com" [5]=> string(23) "email2@email.com" } string(67) "9543219aa68ffa1d434dc8530f23fe48','d4384b2b493867706b0bcedda012ed48" ($IDs is an imploded array) Even though the MySQL table only contains one email per ID, both emails are listed 3 times in $emails, instead of just once. Can anyone see why this is? I'm stuck. Thanks!
  11. never mind, just spotted at typo......
  12. Sorry, just noticed there are brackets missing from the if statements, adding extra brackets didnt help though. Just to clarify, script is actually as follows: <script type="text/javascript" language="JavaScript"> function SetPosition() { var HEADHeight = document.getElementById('HEAD').offsetHeight; if (document.getElementById('BANNER')) { document.getElementById('BANNER').style.top = HEADHeight + 10 +'px'; var BANNERHeight = document.getElementById('BANNER').offsetHeight + 5; } else { var BANNERHeight = 0; } document.getElementById('CORE').style.top = HEADHeight + BANNERHEIGHT + 10 +'px'; var COREHeight = document.getElementById('CORE').offsetHeight + 5; if (document.getElementById('ADS')) { document.getElementById('ADS').style.top = HEADHeight + BANNERHEIGHT + COREHeight + 10 +'px'; var ADSHeight = document.getElementById('ADS').offsetHeight + 5; } else { var ADSHeight = 0; } document.getElementById('TAIL').style.top = HEADHeight + BANNERHEIGHT + COREHeight + ADSHeight + 60 +'px'; } </script>
  13. Hi all, I have the following JavaScript function that I want to use to position div's on the page: <script type="text/javascript" language="JavaScript"> function SetPosition() { var HEADHeight = document.getElementById('HEAD').offsetHeight; if (document.getElementById('BANNER') { document.getElementById('BANNER').style.top = HEADHeight + 10 +'px'; var BANNERHeight = document.getElementById('BANNER').offsetHeight + 5; } else { var BANNERHeight = 0; } document.getElementById('CORE').style.top = HEADHeight + BANNERHEIGHT + 10 +'px'; var COREHeight = document.getElementById('CORE').offsetHeight + 5; if (document.getElementById('ADS') { document.getElementById('ADS').style.top = HEADHeight + BANNERHEIGHT + COREHeight + 10 +'px'; var ADSHeight = document.getElementById('ADS').offsetHeight + 5; } else { var ADSHeight = 0; } document.getElementById('TAIL').style.top = HEADHeight + BANNERHEIGHT + COREHeight + ADSHeight + 60 +'px'; } </script> I call this function on the body load as follows: <body onload="SetPosition()"> The above function is not working, it's not changing the position of the divs. Can someone see why? I'm not very knowledgeable on JavaScript, but it seems like it should work. The function was working before, until I changed the following: - body onload="SetPosition()" instead of: body onload="SetPosition('CORE', 'ADS', etc.)" - added the if statements to check whether the div exists. Thanks a lot!
×
×
  • 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.