i have following php code to get vistor ip
function VisitorIP()
{
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
$TheIp=$_SERVER['HTTP_X_FORWARDED_FOR'];
else $TheIp=$_SERVER['REMOTE_ADDR'];
return trim($TheIp);
}
$Users_IP_address = VisitorIP();
but every time i execute this script on my localhost i got ::1 as IP
how c...
Hello,
How can I check that username contains only english letters, punctuation symbols and digits?
Thank you.
...
Hi guys I'm testing out my application. Using firebugs I've found out my application is abominably slow and needs to speed up.
I have one huge clumped up javascript file thats over 700KB, that includes all my js libraries but the spooky part is the code itself takes anything between 20 to 40 seconds to run. Now the thing is that my code...
I'm making my own RSS feed in PHP for my website, which loads the blog my website has from a table called 'blog', it all works as it should except for one thing...no images are showing up at the articles. Here's the output piece of my code:
while($data = mysql_fetch_assoc($news))
{
echo "<item>" . chr(10);
echo "<title>[$data[ty...
I want to read a log file that is constantly being written to. It resides on the same server as the application. The catch is the file gets written to every few seconds, and I basically want to tail the file on the application in real-time.
Is this possible?
...
Hey, I've been reading StackOverflow.com for a long time but decided to sign up to ask a question. I'm writing my own lightweight MVC framework that routes page requests in index.php.
Page requests look like /controller/action/arg1/arg2/arg3, and they should be rewritten to index.php?route=[request]. So, a [request] like site.com/user/p...
What I am trying to do is check the age of an image, if its older than 60 minutes then run another php page to fetch images otherwise do nothing if less than 60 minutes old....
The script isn't opening the 2nd page (radartest.php) and running it to update the images, so need a command to tell it to run as a script please.
<?php
$imagen...
Hi
Given the following XML file:
<FlightHistoryGetRecordsResponse>
−
<FlightHistory
DepartureAirportTimeZoneOffset="2" ArrivalAirportTimeZoneOffset="1"
ActualAirTime="101" ActualAircraftType="319"
ActualBlockTime="124" ActualGateArrivalDate="2010-07-10T11:58:00.000"
ActualGateDepartur...
Hello, I have a website where the users can upload an image.
However, before they upload one, on registering I want a standard image to be put in the directory. Almost a placeholder image.
How do I get about writing PHP that would take a copy of a file and put it into a different directory when a user reigsters?
...
I have a script which takes in html from the user as in full page html either from the user or grabs it via curl or from an email. The thing is that I have the html in a string but on the same page I need to show the htmnl in a separate iframe. I don't want to reput any database, curl or imap code in the page referenced by teh iframe at ...
i need to get local IP of computer like 192.*....
with PHP, is this possible?
i need IP address of system running the script, but i dont need his internet IP, i need his local network card IP.
Thanks
...
any function to find my link files
example
i have host and i add images ,so i need image links to store it in database to reuse it
the function i need< will give my the link as this
www.mysite.com/folder/image.jpg
any one help plz
...
Is there a good way (PHP class/function) to access Gmail Contacts List? If not where I can start to build a class?
...
I have the following code which should be inserting into the database x amount of times depending on the value given $row['max'] however only 1 is being inserted. Can someone please show me the error of my ways! Thanks.
$query = "SELECT * FROM challenges WHERE rate='fixed'";
$query_result = mysql_query($query);
while ($row = mysql_fetc...
I have declared
$func = array(
'a' => array(
'b' => function() {
echo "hello";
}
)
);
I try to call in this way but it doesn't work
$call = $func['a']['b'];
$call();
I get a error
Fatal error: Function name must be a string
How can I call the anonymous function? I'm using PHP 5.3.
Update
It wor...
in some scripts I see that they omit writing a closing tag ?> for the script .. I don't know why .. Can someone tell me why and if I should do this as well.
(I'm sure they have not forgotten it ;) , lol )
edit: thank you guys :) , I got it now
...
We are running a PHP (zend framework) app that creates a database per user (for security/backup/and others reasons).
All these databases have exactly the same structure and that will always be the case. When we deploy new features we'll need to expand all databases with the new fields/tables.
I've read about using dbdeploy for that, but...
I'm researching how to do In App purchasing using the iPhone SDK. Is there any open source code out there regarding this? Both client-side and server side? Apples docs are great but nothing is better than already functioning code to help the learning curve.
I am not looking for http://urbanairship.com . I'm looking for server code I cou...
Hi this is my keyword
BC1024 , AB124 , CBC2548 ,
using preg match to separate the number and character ,
For that i tried this preg match expression , but its not working greatly ,
preg_match_all('/(?P\w+): (?P\d+)/', $flight_code_no, $matches,PREG_PATTERN_ORDER);
i want output as
Array
(
[0] => BC1024: 2008
[name] =>...
while reading about cookies i found difficulty to grasp the following statement
"setcookie() must be called before any output to the HTTP response. The main reason is that PHP is not buffering the HTTP response"
please help me to interpret it in easy way
...