Jump to content

tibberous

Members
  • Posts

    1,187
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by tibberous

  1. 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.

  2. 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?

  3. 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

  4. 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.

  5. 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?

  6. <?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'

  7. 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.

  8. 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

  9. 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.
  10. 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.
×
×
  • 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.