Jump to content

phillips321

Members
  • Posts

    44
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

phillips321's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi guys, Many people are now buying mobile phone data plans. I've got one myself but have noticed that there are a fair amount of locked outbound ports. (And that i've also not got a WAN IP). I know there are lots of sites that try to connect back to your ip to see which ports are open(inbound) but are there any sites that check outbound ports? For example i know that some network operators block outbound ports to services like skype and msn. It would be nice to have a quick app that checked to see what outbound ports are blocked and list them. Anyone know of such a tool? If there isn't one available what way would you look into coding it?
  2. sorted, cheers teng84, that was enough to allow me to hack something that works. The JS --> function textchange(newtext){ document.getElementById('textarea').innerHTML=newtext } and the HTML --> <span class="pictext" id="textarea">BEFORE</span> <img src="image.jpg" onmouseover="textchange('AFTER)"> many thanks (p.s. sorry to admin, didn't realise there was a JS forum, my bad)
  3. Hi guys, I know this is a php forum, my site is built using php but i need to do a part of it using JavaScript. I currently have a picture system where there is a main image and lots of thumbs, when one of the thumbs has the mouse cursor hover over it the main image change to the large version of the thumb, all works fine. What i need to do now is create text for each image, when the image is hovered on the main image changes to replicate the thumb as well as text that relates to the photo. Here is the Javascript part: <script type="text/javascript" language="JavaScript"> <!-- function swapImage() { //v3.0 var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } function preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.p) d.p=new Array(); var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}} } function findObj(n, d) { //v4.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document); if(!x && document.getElementById) x=document.getElementById(n); return x; } function swapImage() { //v3.0 var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } function swapImgRestore() { //v3.0 var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } preloadImages('pics/normal/I_made_smart_paving_2.jpg','pics/normal/I_instal_automatic_gate_2.jpg','pics/normal/pics/normal/pics/normal/I_made_painting_and_decorating2.jpg','pics/normal/I_made_smart_paving_3.jpg','pics/normal/I_install_automatic_gate.jpg','pics/normal/I_made_painting_and_decorating3.jpg','pics/normal/I_made_smart_paving_4.jpg','pics/normal/I_install_gate.jpg','pics/normal/I_made_painting_and_decorating.jpg','pics/normal/I_made_smart_paving.jpg','pics/normal/I_install_railings.jpg','pics/normal/I_made_paving_and_lighting_1.jpg','pics/normal/I_made_timber_faced_vegetable_beds_and_gravel_paths.jpg','pics/normal/I_instal_railings.jpg','pics/normal/I_made_paving_and_lighting_2.jpg','pics/normal/I_repair_brick_walls_2.jpg','pics/normal/I_made_natural_stone_walling_1.jpg','pics/normal/I_made_paving_and_lighting_3.jpg','pics/normal/I_repair_brick_walls.jpg','pics/normal/I_made_natural_stone_walling_2.jpg','pics/normal/I_made_paving_and_lighting_4.jpg','pics/normal/I_repair_steps_2.jpg','pics/normal/I_made_natural_stone_walling_3.jpg','pics/normal/I_made_paving_and_lighting.jpg','pics/normal/I_repair_steps.jpg','pics/normal/I_made_natural_stone_walling_4.jpg','pics/normal/I_made_Paving_natural_stone_gravel.jpg','pics/normal/I_made_natural_stone_walling_5.jpg','pics/normal/I_made_Paving_natural_stones_2.jpg','pics/normal/house_before.jpg'); //--> </script> And here is the HTML that uses it: <img src="default.jpg" name="large_pic"> <img src="A_small.jpg" onmouseover="swapImage('large_pic','','A.jpg',1)"> <img src="B_small.jpg" onmouseover="swapImage('large_pic','','B.jpg',1)"> <img src="C_small.jpg" onmouseover="swapImage('large_pic','','C.jpg',1)"> <img src="D_small.jpg" onmouseover="swapImage('large_pic','','D.jpg',1)"> Any one with any ideas? I was thinking of createing a form with a lable and that text in that just changes. Would that work? Sorry for not being a php question but this code is based inside a php script Cheers in advance
  4. Hi guys, I'm looking for a php script that i can use to read the contents of an apache access log file and then display this to the user. The sort of thing im looking for needs to be like http://www.mrunix.net/webalizer/ or http://www.hping.org/visitors/. Any ideas guys?
  5. Hi guys, I have made some modifications to my picture hosting site. Please will you guys test it and advise things that you (dis)like, and also any more ideas or things you think i should consider changing/adding. http://www.forumpix.co.uk Many thanks
  6. the preg_match("/\d{10}/",$_POST['I']) line doesn't work at all (it wont execute the true if block of code) if i remove it from the if variables i can produce the following issue: by using the address line "www.domain.tld/image.php?I=../test.jpg" i can browse up a directory from the uploads folder any ideas on howto secure it? <?php $image = $_GET['I']; if (isset($image)){ echo '<IMG src="/uploads/'.$image.'.jpg">'; } else{ echo '<IMG src="error.jpg">'; } ?>
  7. just checked and it should be "_GET" not "_POST", working fine now, Cheers for your help
  8. For some reason the following block of code doesn't work(extra crap stripped out) <html> <head> <title>ForumPix.co.uk - Upload your pictures for free and host them anywhere!</title> </head> <body> <?php $filename = $_POST['I']; echo $filename; echo '<IMG src="/uploads/'.$filename.'.jpg">'; ?> </center> </body> </html> the output is a blank page with an image box that points to "http://www.forumpix.co.uk/uploads/.jpg" even the echo $filename; line doesnt output anything so i guess there is a fault with getting from address line? P.s. address line tested was "http://www.forumpix.co.uk/image_test.php?I=00000003", i have confirmed that the image /uploads/00000003.jpg exists
  9. i need to make sure that a user doesn't enter "image.php?I=../../../../" or I=[user code here] the image name will only ever be in a unix time format, no letters or special characters
  10. what do these commands do? ob_start(); ob_clean(); there doesn't seem to be any verification/validation on the $_POST['I']
  11. Hi guys, I have images stored in the directory "/uploads/*********.jpg" Rather than link directly to the image i would much rather be able to display the image on a webpage with some other html, i.e. www.example.com/image.php?i=****** I'm pretty sure i could easily write this code but how do i go about securing the image variable passed to the server in the address field? i wouldn't want the user to change the 'i' value to something like "../../../home/user/" All of the names of the images are stored using a unix time stamp, e.g. 1195208745.jpg, 1195202879.jpg Any idea on what im trying to achieve guys? Many thanks Sorry for any typos etc.. it's too early in the morning and i'm shattered
  12. i place this script in my image directory, it simply displays a random image: <?php $files = array(); $i = -1; // Initialize some variables $handle = opendir('./'); while (false !== ($file = readdir($handle))) { if (preg_match('/\.'.'jpg'.'$/i', $file, $test)) { // faster than ereg, case insensitive $files[] = $file; // it's good ++$i; } } closedir($handle); // We're not using it anymore mt_srand((double)microtime()*1000000); // seed for PHP < 4.2 $rand = mt_rand(0, $i); // $i was incremented as we went along header('Location: '.$folder.$files[$rand]); // Voila! ?>
  13. i thort about the use of time() and did realise the 1sec problem, i'm going to implement the naming a little better to improve. im still unsure how to validate the cookie value of 'lastimage' the value last image should only be "", "noimage" or a number any ideas?
  14. Thanks for the help on this. $lastimage is simply the output of time() so is only a number setcookie('lastimage',$image_number,time()+(60*60*24*365)); how do i make sure that when the lastimage cookie is read in that only valid numbers are allowed? and things like "../../directory/directory/img.jpg" are not allowed? cheers
×
×
  • 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.