Jump to content

tibberous

Members
  • Posts

    1,187
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by tibberous

  1. <?php $test1 = "=)"; $test2 = ""; $test3 = ""; $test4 = ":|"; $test5 = ":/"; if( ($face = intval($face)) >= 1 && ($face = intval($face)) <= 5){ $myvar = "test$face"; $myvalue = $$myvar; echo "<div><b>$myvalue</b></div>"; } ?><form action="<?php echo $PHP_SELF; ?>" method="get"> <div>Enter 1-5 <input type="text" name="face"></div> <div><input type="submit" value="Get my Face!"></div> </form>
  2. Yes you can, one sec, I'll write it for you...
  3. I don't think the max size of post is your problem. I posted about 30 pages worth of junk in a single line in a textarea to test, worked fine.
  4. Who told you there was a limit?
  5. For the second part, try this: $money = explode(".", $money); $money[1] = substr($money[1], 0, 2); $money = $money[0] . "." . (strlen($money[1]) < 1 ? "0" : "") . (strlen($money[1]) < 2 ? "0" : "");
  6. Whats the code for the £ that isn't working, because it works fine for me, even with the form enctype set. Are you sure your not using a weird font? You could try adding style="font-family: verdana" to the textarea and see if that fixes it.
  7. Hehe, yeah it has to be dynamic. I am making a web app that the user should be able to put there url into and it will load up a screen shot of it.
  8. I'm pretty sure I've seen this done, no idea how to do it. Is there some way I can take a webpage and convert it into an image? I imagine the only way to do it would be to render the html, load external files, and convert the output to an image. Anyone know how to do this? It almost seems like it would have to be an addon library. Thanks I found a site that does it but they only sell it as a service, and are really slow otherwise, and it still doesn't work that great =/ It's kinda neat neat: http://html2pdf.biz/api?url=http://www.gangsters.cc&ret=png I'm making a demo for a company, maybe they'll pay $110/year for the service?
  9. I have a script that uses RewriteRule to take a fake path and convert it to a script path with parameters. The rule: RewriteRule ^game/([0-9]*)/(.*)\.html$ game.php?gId=$1&fname=$2 [L,NC] Expects a name like this: http://www.mysite.com/game/21479/LOTR-Battle.html It is supposed to use the first part as the gId parameter in the script, and the second part as the fname parameter. It looks right and runs on Apache 1.3, but on Apache 2.0 it doesn't send the parameters - it only converts it to the script name. Does anyone know what might be causing this? Thanks
  10. That is because $text_line[2] only has a single value. It's like saying max(7) and expecting to get the largest number. What you want to do is keep storing $text_line[2] into $arr[count($arr)], then at the end of the for each do a max $arr.
  11. $sql = "SELECT user_name, user_pass FROM users WHERE user_name='$userid', user_pass='$password'";
  12. I have a script that is using fopen to see if a file exists or not. It works unless the file it is opening is on the same domain as it, then it gives these errors: Warning: fopen() [function.fopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/narutof2/public_html/download.php on line 77 Warning: fopen(http://pubserver.narutofob.com/010.zip) [function.fopen]: failed to open stream: Permission denied in /home/narutof2/public_html/download.php on line 77 It looks like maybe fopen doesn't have the permissions to access the file, but I'm not sure what to do about it. Does anyone have any ideas what would cause this?
  13. Fixed it. Problem was that ServerName was set wrong in the apache config file. You guys might want to remember the solution to this one, took me a solid hour to fix =)
  14. <?php if(fopen("http://www.trenttompkins.com/face/project.html", "r")) echo "Exists"; else echo "Doesn't Exist"; ?> More info: The server this isn't working on is running Apache 1.3.37 / PHP 4.4.7 Configure command is: './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--prefix=/usr/local' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-exif' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-imap=/usr/local/imap-2004g' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt' '--with-mhash' '--enable-magic-quotes' '--with-mysqli' '--with-mysql=/usr' '--with-openssl' '--enable-discard-path' '--with-pear' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--enable-wddx' '--with-xmlrpc' '--with-zip' '--with-zlib'
  15. Whenever I try to read a remote file I get the following two warnings: Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/narutof2/public_html/download.php on line 55 Warning: fsockopen() [function.fsockopen]: unable to connect to www.example.com:80 in /home/narutof2/public_html/download.php on line 55 There the same for both fsockopen and fopen. I tried using real files, same errors occur. I found a post about this online but it doesn't look like they were able to resolve it. Thanks for any help. Btw, this a problem with the server. The code works fine on my local apache server.
  16. I need to block .inc files from being served. Is there a way I can do that with apache?
  17. Thanks! I actually looked through the doc's for a long time too!
  18. I have a bunch of code that is designed to run out a certain directory. I am integrating it with a bunch of code that is designed to run out of another directory. Now, I can change the include paths, but the includes include more includes, and it would be a mess to change everything. Is there some way I can set the base include directory, run the first bit of code, change the base include directory again, and run the second bit? Thanks
  19. I have an input, <input name="x">. I need to refer to the value on x. In Internet Explorer, it is x.value. How do I do it in Firefox?
  20. I have several sites I work on, all with different versions of PHP, Apache and mySQL. What I would like to do is edit my hosts file so the different url's would go to different addresses. For example, bobs.com (or maybe a name like _bobs.com, just so it wouldn't conflict with the real [external] domain name) could go to 127.0.0.8 in the hosts file, which would connect to apache 1.3, which would be running PHP 4.2, and know to connect to a certain mySQL service. Other domain names would do the same thing, but with different configurations. Is anything like this possible, because right now it seems all I do is screw around with my server. I happen to be using windows XP - if I have to, I could set up different user accounts for each project, but I am not sure how good that would work either. This is all just for local development, of coarse.
  21. ROFL! Yes... yes you do... Wow. Thats the best error I ever had - never even crossed my mind. Thanks
  22. Sure. Lets say I want to search an html file for all instances of <h. preg_match_all("/<h/", "<html><head><title>", $matches); This doesn't work, I think because php treats < as a special character, even though it normally isn't. I have tried \<, <<, \\<, '<, [<] and anything else I could think of, but no matter what it doesn't return any results.
  23. Just a literal <. I can search for it, but if I search for anything after the <, such as <html, it breaks the search. I read that it was only special in PHP, which I think is why I can't find it anywhere. Thanks
×
×
  • 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.