Jump to content

jamesm6162

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jamesm6162's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi all I need to retrieve a remote file and store it on my server. There are several methods to do this, but all of them fail when the URL contains special characters such as spaces. Consider the following URL: 'http://www.somedomain.com/Images/Products/MyProduct (Large).jpg' Assuming the allow_url_fopen directive is set to "on" in the php.ini, one can normally call: $url = ... $handle = fopen($url); to access the file. However, the space in the filename causes a Bad HTTP Request (Response 400). Using urlencode to encode the url doesn't solve the problem either, as all forward slashes and the colon after the protocol get escaped, and fopen doesn't recognize it as a URL. Besides manually replacing all the characters in the URL that are not colons or forward slashes (and are considered 'special'), can anyone give me any other solutions to make this work? Thanks
  2. Option 1) Use query string flags such as main.php?p=register So each link redirects back to main.php, but the flag "p" indicates what is to be included in the table. Option 2) Use Ajax to load the entire register.php and just replace the contents of the table. Option 3) Include a standard layout on each page e.g. include('header.php'); ...rest of content include('footer.php'); or using variables: include('standard.php'); echo $header; echo rest of content... echo $footer; Option 4) Use Frames
  3. In you have open single quotes. Should be Also, the period will be displayed literally (I'm not sure if that's what you're trying to accomplish) unless you also close and reopen the double quotes after the first </span>
  4. Yes is the access for the class member variable $result (not local). This statement makes this member variable an alias or reference to the content that the parameter ($result) refers to. Therefore, inside the method, both $this->result and $result (the parameter) points to the same thing. After the method exits the member variable $this->result will still point to the same location of whatever variable was passed in as a parameter to the method call.
  5. Hi set_magic_quotes_runtime() is a function that sets the magic_quotes_runtime ini value for a single session (or request I think). The magic_quotes_runtime value is deprecated and won't be in PHP6 or later, so you shouldn't use it. This is however, just a warning so your code will still execute regardless. Best practice is not to use any deprecated features ever. Check the PHP manual for these functions and settings, it's really quite helpful. As for the browser caching, yes you can clear the cache, or mostly just refreshing the page once or twice gets the new page version. Seems like your XSL was working after all. Glad I could help
  6. libxml2 and libxslt are embedded in your php installation by default, so they shouldn't be the cause. I don't have these files on my computer either. I am a bit stunned by this. I know it sounds silly, but are you sure your browser isn't caching the phpinfo page and redisplaying the same one that's in cache? I can think of no other option but reinstalling wamp (first uninstall), and then activating the extensions using the GUI menu in the taskbar. I really can't think of what else the problem can be without actually looking at it myself.
  7. By default any windows installation of PHP will look for php.ini in the c:\Windows directory, or in the directories specified by the PATH environment variable, or in Apache's working directory (/bin). However, if you specify PHPIniDir setting in your httpd.conf file (yes the one in the /conf directory of apache) then it will rather look there. It will still say the configuration path is C:\Windows, but the correct php.ini file is specified in "Loaded Configuration File", which in your case is "C:\wamp\bin\apache\Apache2.2.11\bin\php.ini " But I see you are using WAMP, which already configured httpd.conf, and you can easily activate extensions by left clicking on the wamp icon in the taskbar then selecting: and then using the arrow at the bottom scroll down and click on XSL (almost at the bottom) wamp will automatically restart your server and you should see XSL in phpinfo(). The php.ini file in your PHP directory should be ignored it isn't used. If ever you want to open the correct php.ini file click on wamp icon in taskbar then This will automatically open the one in C:\wamp\bin\apache\Apache2.2.11\bin\php.ini which is correct. Also you shouldn't alter the extension_dir setting there because WAMP also did that for you.
  8. @bridlodian Your above code needs to be requested by someone before it will actually work. The server either serves an index.html or an index.php, but not both. Any dynamic code must be placed in a php file, which means your index.html will never be reached anyway. Do what the previous post said, redirect by placing that code in your index.php. Alternatively just include the correct page in your index.php, depending on the date.
  9. BTW I just tested and the tailing backslash is indeed not necessary. Further, just a correction, the PHPIniDir should be just the directory as in: And again make sure the correct php.ini file is loaded under "Loaded Configuration File" in phpinfo().
  10. Are any other non-standard extensions available when you un-comment them? Are you running Windows? Another possibility is that your extension_dir directive might be wrong. If you have relative filenames for your extensions then you need to set the correct directory for the extensions such as: for example. A further note: I had problems with this myself. The comments in the php.ini file says not to include the trailing slash. However I did include it and for some reason that worked. Try it both ways, with and without the slash. Also if there are any syntax errors in the file, php uses default values Another thing I noticed was that when I use c:/windows/php.ini then merely restarting the server doesn't always make the changes effective. Let me know if it was solved.
  11. Well I installed PHP using the plain old Zip package. I am using the plain old mail() function. I have reverted back to placing the php.ini file in the c:\windows directory and removing any PHPIniDir settings in the httpd.conf files. I have replaced the php.ini file with one I got from a wamp installation on my other machine which seems to work fine. I am currently trying to figure out the difference between the two ini files that might cause the problem. However things are going difficult as a mere restart of the Apache server doesn't seem to always refresh the ini file for some reason.
  12. Are you sure you edited the correct php.ini file? run phpinfo() and check what file is shown next to "Loaded configuration file" That's the one you should change. If there is no configuration file found at that location, then the default settings are used. Either copy the php.ini file you edited to that location or add the value : to your httpd.conf file in Apache conf directory (assuming you are using Apache)
  13. The configuration file path says c:\windows as always, but the "loaded configuration file" just below it shows the correct file, the one I am using. And there isn't a php.ini file in the c:\windows directory. I have restarted my server and computer several times already.
  14. I changed my php.ini setting from SMTP = localhost to SMTP = some.smtp.server.net My code is actually dependent on the SMTP setting, because I am using the mail() function on Windows and I don't have an SMTP server on my machine, so I get the error: My port setting I left at 25 and sendmail_path is commented out. phpinfo() also shows my SMTP as localhost. And the value (and syntax) is exactly the same as on my other machine that is still running XP, where it works fine.
  15. Hi I have a local installation of Apache + PHP on my Windows 7 machine. When setting the SMTP directive in the php.ini file to some remote server, the php server ignores it and instead still tries to access localhost as an SMTP server. The remote server I am trying to use does exist, and it works on my other machine, but for some reason, even after several server and computer restarts it simply ignores the value I set. It definitely is the correct php.ini file as it show it in the phpinfo() as the loaded configuration file and further, any other settings that I change in there are effective. What could possibly cause this? Thanks in advance
×
×
  • 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.