Jump to content

DarkerAngel

Members
  • Posts

    330
  • Joined

  • Last visited

About DarkerAngel

  • Birthday 05/11/1985

Contact Methods

  • AIM
    DarkAngelGRM
  • MSN
    DarkAngelGRM@hotmail.com
  • Yahoo
    DarkAngelGRM@yahoo.com

Profile Information

  • Gender
    Male

DarkerAngel's Achievements

Newbie

Newbie (1/5)

7

Reputation

  1. It seems to be terminating the script at the cURL call, are you sure cURL is enabled on the server? That would be my only thought if it is failing at the gethtml(); call.
  2. Here you can have what I have named my gethtml(); function; does the entire curl command in one function. /** * cURL Run command processes cURL and returns data/headers * * @param string $url URL to download * @param string $cookie Filename of cookie file to store cookie data; false no cookie file used. * @param string $refer Header to include traffic origination. * @param mixed $postdata array of postdata or query string. * @param bool $nbd No Body Download; Returns only request headers. * @param bool $ssl Use Secure Socket Layer. * @return string The data returned from the cURL Call. */ function gethtml($url, $cookie = false, $refer = false, $postdata = false, $nbd = false, $ssl = false) { if (preg_match('%(.*/)%', $_SERVER['SCRIPT_FILENAME'], $regs)) $dir = $regs[0]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_AUTOREFERER, 1); if($postdata) { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$postdata); } curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17"); ($cookie)?curl_setopt($ch, CURLOPT_COOKIEFILE, $dir.$cookie):false; curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); ($nbd)?curl_setopt($ch, CURLOPT_NOBODY, true):false; ($nbd)?curl_setopt($ch, CURLOPT_HEADER, true):false; curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_REFERER, $refer); ($cookie)?curl_setopt($ch, CURLOPT_COOKIEJAR, $dir.$cookie):false; if($ssl) { curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); } $html = curl_exec ($ch); curl_close($ch); return $html; //string } Then simply call it like: $result = gethtml('http://www.example.com/mail/signup.php', false, false, $post_string);
  3. cURL isn't designed to render HTML, only mimic browser traffic and transfer data. http://php.net/manual/en/function.imagegrabscreen.php is probably the closest you are going to get with PHP (someone might have another method I might not know about) This is an example of how this could be used (although I was never able to successfully gain this functionality; got close once but never rendered the page): http://stackoverflow.com/questions/757675/website-screenshots-using-php
  4. Web server user uploads the image, but anyways... It looks like what you are trying to do is relying on system commands, couldn't you utilize any PHP based methods of image manipulation? I mean it is using getimagesize(); so that indicates to me that the GD library is installed, unless the function is declared in another PHP file. I never used ImageMagick so I might not be much help on that end. GD is pretty easy though and can be written out in a few lines, imagecreate() create new resized image getimagesize() but you already have that one imagecreatefromjpeg() open the uploaded jpeg file imagecopyresampled() there is a lot of arguments to assign to this one: (new image, source image, src_x, _y, dest_x, _y [so these would be 0 for this use], new_w, new_h, old_w, old_h) imagejpeg()
  5. You could always try your results against is_int. Then if you want to know if it's 4 digits after validating that it is an integer value you could always try: if ( $value >= 1000 && $value <= 9999 ) { //Code true } else { //Code false / error message }
  6. I remember learning like math in school like that, but they only did that to give an idea of numbers in a physical sense, I don't think they really expected me to literally draw out like that, especially just to get the sum of 3 numbers.
  7. min-width seems to help in the ul element of the navbar
  8. I have to go with what he said, I never once took on any educational system for this, I simply went for some basic tutorials, all resources found around the interwebs, I think I had a few taken from this very site, once you get the basics down, php.net manual is your best friend, along with any other API documentation you might be running under (Durpal, Codeignitor, Joomla...etc...) Can't say that I'm an expert or anything close, I'm just here to help AND learn. EDIT: Although I really can't say PHP was my FIRST programming language; I will give the the FIRST I have a solid understanding of where BASIC was my FIRST that i tinkered with (never really got much of it) (aside from) 10 PRINT "HELLO " 20 GOTO 10 LOL (cause I'm so sure I made my screen print "Hello" Inf. times
  9. Nothing at all, simply put it's only a regex delimiter ( #, %, /, &, ~, ! ), I just normally go with the one RegexBuddy gives me usually saves the "Opps, I'm using that in my expression" problem. '%On:</td>\s*<td><strong>(\d{1,2})/(\d{1,2})/(\d{1,2})%i' Few More Points I guess I missed when I posted previously: For some reason I left the " / " in the [ ] range delimiter even though " / " is not a range I had repetition modifiers outside the capture group resulting in a Last Case capture (in tester) Had a whitespace search after the <strong> tag though it didn't seem to affect the tester This one might work a little better, if not I might need to see more of what you're trying to match against since my tester is reporting it a valid match (as well as capture groups)
  10. I still just store the unix_timestamp (INT) and format it in PHP although I'm getting some legs in some of the date/time functions of MySQL so I might start working out some "proper" ways of storing date/time in MySQL.
  11. I'm pretty sure running PHP as a cron would probably be more in tune with running it as a CLI type script, this is kind of out of my area, but it would probably be best to run it as such. The command would be: php {script_file_name} arg1 arg2 etc... So maybe pass it as: php /path/to/index.php Tickets TicketMinute GeneralTasks vardump $argv: array(4) { [0]=> string(9) "index.php" [1]=> string(7) "Tickets" [2]=> string(12) "TicketMinute" [3]=> string(12) "GeneralTasks" } There may be other solutions, cURL perhaps? or other forum users may have better insight since I have yet to utilize cron jobs. That and I am not sure if you plan on making the variables dynamic maybe?
  12. You might need to do a little bit of homework, web fonts are starting to grow fast, and with some CSS tricks (and a compatible browser [iOS / Android included]) You can use whichever font you wish in your HTML. What you need to do is make a server copy of the font you intend to use across your platform (or a number of fonts depending on how you plan on having your site) Add this to your CSS: @font-face { font-family: 'NameofFont'; /* Can be any name you wish this is a backreference for other CSS rules */ src: url('font/file.ttf'); /* File name of the font file, IE apparently only accepts .EOT fonts; yet test passed on TTF */ } And add this to any of your supporting rules: body { font-family: NameofFont; /* Must match declaration in @font-face */ } I have a sample in http://darkangel.sytes.net/webfont/ It was some random TTF font I downloaded named GoodDog, I was after something artistic and randomly named; you can check it out. Font is NOT installed on my system (I cannot find or select it in a word processor; ect; not found in system font folder.) Tested: [Passed] = Displayed Downloaded font Android (Dolphin Mini) [Passed] IE9(x64) [Passed] Google Chrome [Passed] FireFox [Passed]
  13. Try this maybe? '%On:</td>\s*<td><strong>\s*(\d){1,2}[/](\d){1,2}[/](\d){1,2}%i' A couple things I noticed: Your range is only 1-9 missing 0's (Mine is \d matching numerals) (Also it wasn't placed in a range modifier so it would have tried literally matching "1-9") Your opening and closing <td> <strong> html elements are trying to match 2x (on both sides) as oppose to your initial test subject, in which the tags only appear once.
  14. Assuming $energy is an integer You would only need: $energy--; As oppose to: $energy=$energy--; So try as a full code: <?php $energy=$row_c['energy']; $energy--; echo $energy; ?>
×
×
  • 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.