Jump to content

HAMM3R

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

HAMM3R's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey one more question.  Some of the users are in clans so have clan tags in their names.  Right now it wont display anything other than letters and number (as the regex allows).  Could you please show me how to make it accept [] = - | () etc? Thanks!
  2. Great!  That works just as I needed. Thanks bqallover  ;D
  3. Hey Ive got a text file.  It has many lines of data. I need a script that will loop through and if the line matches this: String1.level=Int1 (and example would be: HAMM3R.level=4) If Int1 >= 3, i need it to echo something like String1 = Int1 So, if a line is HAMM3R.level=4 then it will echo "HAMM3R = 4" If its HAMM3R.level=2 it will go to the next line And if the line doesnt match the String.level=Int format that it will also go to the next line I know im not giving you anything to start with but im new at this.  I hope someone can help me out with this. Thanks in advance! HAMM3R
  4. Yeah it says PNG support is enabled and i changed that line.  It made no difference :( Maybe i can convert the png to jpg since i know the jpg invert works?  How do I do that?
  5. Yes i tired that and it made no difference :(
  6. Hey.  I got this script from http://www.phparadise.de/php-code/image-editing/invert-image/ It works with jpegs but I cant get it to work with PNGs.  Everytime i try it i see a "The image “http://domain.com/graphs.php” cannot be displayed, because it contains errors." in firefox and IE just tells me action canceled.  Im sure ive just got something wrong in the code.  Can someone please tell me what ive done wrong?  Here is what im using: [code] <?php function invert_image($input,$output,$color=false,$type='jpeg') { if($type == 'jpeg') $bild = imagecreatefromjpeg($input); else $bild = imagecreatefrompng($input); $x = imagesx($bild); $y = imagesy($bild); for($i=0; $i<$y; $i++) { for($j=0; $j<$x; $j++) { $pos = imagecolorat($bild, $j, $i); $f = imagecolorsforindex($bild, $pos); if($color == true) { $col = imagecolorresolve($bild, 255-$f['red'], 255-$f['green'], 255-$f['blue']); }else{ $gst = $f['red']*0.15 + $f['green']*0.5 + $f['blue']*0.35; $col = imagecolorclosesthwb($bild, 255-$gst, 255-$gst, 255-$gst); } imagesetpixel($bild, $j, $i, $col); } } if(empty($output)) header('Content-type: image/'.$type); if($type == 'jpeg') imagejpeg($bild,$output,90); else imagepng($bild,$output); } $input = 'http://www.game-monitor.com/server-players.php?ip=70.86.246.26:7777&type=day&key=f9f8b008dfd594f80f8f81468f5836e5&timezone=-4.png'; // for a color negative image, set the optional flag // invert_image($input,'',true,'png'); // for a black and withe negative image use like this // // invert_image($input,''); // if you want to save the output instead of just showing it, // set the output to the path where you want to save the inverted image // // invert_image('path/to/original/image.jpg','path/to/save/inverted-image.jpg'); // if you want to use png you have to set the color flag as // true or false and define the imagetype in the function call // invert_image($input,'',true,'png'); ?> [/code] Thanks in advance!
  7. Awesome! Thanks SemiApocalyptic!
  8. I have a php page that displays "Online" and "Offline" statuses for different hosts. It works by attempting to open a socket to those hosts. Because this can be a time intensive task to for 3 hosts every time the page loads, the page often is very slow to fully load. So how can I make the php script run with cron? That is, every 10 minutes run the status checks on the hosts and save the results in a flat text file or something. That way the website can just read the text file. This should dramatically reduce the loading time of the pages. I know about cron and how to add to it. So do I just put in cron the php script? I dont think the server can run the php script if it's not initiated in apache. So im lost. How do I make cron be able to run a php script much like apache would? Ive seen this done before with news sites and such. Thanks in advance! Austin
  9. Right now I have 2 files: form.htm and form.php. There is an input form in form.htm, and it sends the data via POST to form.php where it is processed. However, im behind a packet filter which is messing up the POST process. So my question is, how can i have the form, and process it in the same file? ... thus eliminating the POST action? This way I would have 1 file (form.php). Thanks in advance!
  10. It worked like a charm, thanks!
  11. Ok here is what I have so far... link.html: [code]<html> <body> <form action="link.php" method="post"> URL <input type="text" name="url"><br/> <input type="submit" value="send"><br/> </form> </body> </html>[/code] link.php: [code]<?php function website($website) {     $website = str_replace("http://www.","",$website); //if user enters http://www.LINK.com     $website = str_replace("http://","",$website); //if user enters http://LINK.com     $website = str_replace("www.","",$website); //if user enters www.LINK.com     return $website; } $website = "$url"; $mainsite = "http://domain.com/010110A/http/"; $newsite = $mainsite.'/'.website($website); echo $newsite; //echos http://domain.com/blah/LINK.com ?>[/code] No luck though. I does to go link.php but it echos $newsite as 'http://domain.com/010110A/http//'. Any ideas?
  12. I have a form. A user inputs a URL into that form. I need a php script to process that URL in the following ways... 1. If the URL has a http:// in front of it, remove it. 2. Add the URL (without http://) to [a href=\"http://domain.com/blah/LINK.com\" target=\"_blank\"]http://domain.com/blah/LINK.com[/a] And i should be able to get it from there. So all I need is the removal of http:// and the joining to the base url. Im sure there is a simple php function to do this but I have no clue where to start. Can someone possibly provide me with a small snippet to get me started? Thanks!
  13. I dont know how to 'simply plug in the variable'. This is the newbie forum remember? Can you give me some more details and/or a snippet of code to work with? Thanks!
  14. Hey. Id like to have a form. The user will type a url in the form. Id like for the submit button to send them to [a href=\"http://domain.com/scgi-bin/proxy.cgi/100100A/http/theirurl.com\" target=\"_blank\"]http://domain.com/scgi-bin/proxy.cgi/10010...tp/theirurl.com[/a]. (if the form condenses the URL, make sure to see the tooltip to see the full thing) Notice the URl replaces the 'http://' with 'http/'. Id also like it so that if they type the http:// in the url form, it removes that and uses just the domain for the refering url. Can anyone show me how this can be done? Thanks. Austin
×
×
  • 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.