I have two Apache servers running PHP. One accepts forward-slashes in the query string and passes it along to PHP in the expected way, for example:
http://server/index.php?url=http://foo.bar
works and in PHP this expression is true:
$_REQUEST['url'] == "http://foo.bar"
However, in the other Apache server, the same URL results in a ...
Hi friends,
I had a doubt in CURL (PHP) . I want to login directly into a site using CURL. Is it possible, if possible please guide me.
I tried with the following but its not working
http://username:password@myurl
Please solve this..
Thanks in advance
...
I have a very large Ruby on Rails application that I would like to port to PHP 5.2 or maybe PHP 5.3 (if 5.3 ever gets released).
I've been looking for a some way of automatically converting the simple stuff like simple classes and the ERB templates. I would expect that I'd have to do the more complicated stuff myself in cases where the ...
I'm in search of the web hosting space, and got to know the PHP version is 4.3 and MySQL Version 4.1
But i developed my application in MySQL version 5.x and PHP version 5.x
Can anyone give me the differences in versions ?
what all i cannot access now ?
Thanks...
...
How do i dynamically assign a name to a php object?
for example how would i assign a object to a var that is the id of the db row that i am using to create objects.
for example
$<idnum>= new object();
where idnum is the id from my database.
...
Is it possible to use the __call magic method when calling functions statically?
...
I am using PHP 5's scandir($dir) function to iterate through a directory and print out an xml list of files. Only, when the directory has a single quote in the name, scandir returns no items! It doesn't return false (as it would if it failed) or generate warnings or errors - just empty. Any ideas?
$items = scandir(stripslashes($dir)); /...
I'm writing a PHP5 extension, and while I could write it in C, it would be easier to use C++ and take advantage of the STL and Boost.
Trouble is, the tutorials I've seen only deal with C, and I'm looking for a basic example which uses C++
Here's what I've tried so far:
config.m4
[ --enable-hello Enable Hello World support])
if tes...
Hi all,
I installed PHP in windows server 2003. All the files are working fine except the mail issue. There is no problem in SMTP. Because I run the JSP project in the same server.In that mail function working fine. So where is the problem? And how can i manage? I set the SMTP server in PHP as
; For Win32 only.
SMTP = localhost
smtp_po...
Because ZF depends on mod rewrite for all it's URLs, it's not immediately apparent to me where I should store local scripts for use with a cron job.
Does anyone have any recommendations, or is there an "officially accepted" way?
...
Any recommendations or best practices for mapping a subdomain to a Wordpress page:
http://my-page.mydomain.com -> http://mydomain.com/my-page
I don't want to do a redirect either, just keep the original subdomain URL until a different link is click, and then the subdomain is removed.
I'm using Apache 2 with mod_rewrite, wordpress 2.7...
I am creating a multipage form in PHP, using a session. The $stage variable tracks the user's progress in filling out the form, (UPDATE) and is normally set in $_POST at each stage of the form.
On the second page (stage 2), the form's submit button gets its value like this:
echo '<input type="hidden" name="stage" value="';
echo $stage ...
(Sorry for the poorly-phrased title.)
I need to test my PHP applications with multiple versions of PHP 5.x, such as PHP 5.0.0 and PHP 5.2.8.
Is there a way that I can configure a development LAMP server so I can quickly test applications with multiple versions of PHP5?
...
Is there any particular reason I should declare a class or a method final in day-to-day programming (web or otherwise)? Please provide a real-world example where it should be used.
BTW, I'm asking because I'm trying to pick an 'obscure' keyword and master it.
...
Hi All
I'm looking into basic time functions (creating a UTC timestamp and converting into a local timezone). The first set of tutorials i encountered pointed toward PEAR as it's better at avoiding overspill errors in calculations. Now, mid-way through another, it appears that PEAR has issues with some of it's timezone functions running...
I have a function in my controller that has grown longer than I'd prefer and I'd like to refactor it to call a few discrete functions to make it easier to manage. How can I better organize a long function in a Codeigniter controller?
What I've tried:
I know you can create private functions in a controller by naming them with a leading ...
In PHP, if a static attribute is defined in the parent class, it cannot be overridden in a child class. But I'm wondering if there's any way around this.
I'm trying to write a wrapper for someone else's (somewhat clunky) function. The function in question can be applied to lots of different data types but requires different flags and o...
Is there an inbuilt PHP function to replace multiple values inside a string with an array that dictates exactly what is replaced with what?
For example:
$searchreplace_array = Array('blah' => 'bleh', 'blarh' => 'blerh');
$string = 'blah blarh bleh bleh blarh';
And the resulting would be: 'bleh blerh bleh bleh blerh'.
...
I tried the following code in codepad.org:
class test {
const TEST = 'testing 123';
function test () {
$testing = 'TEST';
echo self::$testing;
}
}
$class = new test;
And it returned with:
1
2 Fatal error: Access to undeclared static property: test::$testing on line 6
I want to know whether referencing a class const...
I am trying to print a part of a page with a single button click without opening a different page . The part of the page that i need to print has been called using ajax
so if anybody could help me i would be really thankful
...