I am new to php programming..
I have validated the form elements(input box,checkbox).. I am facing problems with form submission could you please help me out on this?
I'm looking for a way to use the php number_format function or something similar that will add the thousand seperator but will leave any decimal part of the number intatct without and formatting of this. For example:
39845.25843 = 39,845.25843
347346.8 = 347,346.8
1000000 = 1,000,000
Thanks
Hi.
I need the remote client name (aka computer name) to save it into a database, I was looking into $_SERVER variables but it doesn't exist. How can I get this just using another PHP's function or even javascript if it is necessary.
hi ,
i am getting file content from file_get_content funtion in php.
and want to store that file in particular folder.
how could i store that file in particular folder.
$image = file_get_contents('http://www.affiliatewindow.com/logos/1961/logo.gif');
i want to save this image in particular folder.
any idea abt it?
What's the best way to store language data?
Keep it as variables in some kind of lang.php file...
$l_ipsum = 'smth';
$l_rand = 'string';
Or select them from a database? I'm in search of your advice.
I want to use PHP to get the URL of the page to which the following address redirects:
http://peacecorpsjournals.com/journal/6731
The script should return the following URL to which the URL above redirects:
http://ghanakimsuri.blogspot.com/
Ok I have a string...
$a_string = "Product";
and I want to use this string in a call to a object like this:
$this->$a_string->some_function();
How the dickens do I dynamically call that object?
(don't think Im on php 5 mind)
Hey,
Currently i try to create some of my database export work more automated and i decided to go with exporting data from MySql database to .doc file in php.
So im doing some database work and store complete html to a $str variable and then write/make new file:
$fp = fopen($file, 'w+');
fwrite($fp,$str);
fclose($fp);
The problem here is not creating .doc file, but when i download and view that .doc file it's not in UTF-8 it's in unicode.
How to rotate an image with PHP, any degree, without having the filled space? For instance, if I rotate an image 10 degrees, the image rotates fine but the container around (square) gets filled with black. Is it possible to get rid of this, when for example merging 2 images?
By default when system() and exec() functions are used in PHP the default user is SYSTEM so I can never see the result. Is there a way to change the user it runs on?
I need to insert same data to my MySQL table without having PHP loop. The reason why I'm doing this is that because I have a column with Auto_Increment feature and that column associates with other table.
So, I just need to insert some exactly same data and it's multiple rows (dynamic) but by using single INSERT syntax below :
INSERT INTO outbox_multipart (TextDecoded) VALUES ('$SMSMessage')
how to have this single INSERT syntax, but produce n number of rows?
Hello, is it good, that every PHP class implements a Singleton pattern? I think, it will be less memory usage because of it. Is it right opinion? Thanks!
I got script what read from database and manipulate it so on the end I got $result array...
on one server
is it possible to serialize this object and pass it to other script so this $result array could be available for other script on second server...
I got on first server:
return serialize ( $results );
and on second:
$data = unserialize ( file_get_contents ( 'http://www.......com/reader.php' ) );
...but there is no communication between ....
What I am doing wrong ?
Bensiu
I've found out the hard way that my website can be hacked by passing a query string parameter that has many ../s to access files outside of the website directory, and then screw with the website.
Is there a way, perhaps through the php.ini, to not allow file includes outside of a certain root directory?
Hi ,
i have a time zone in 2010-05-04T05:27:00.000Z format which indicates the GMT time and i want to add GMT 10+ in to it using php.
i can do that thing using following code but how would i directly add 2010-05-04T05:27:00.000Z and GMT 10+ so that i can get a valid date and time.
$offset=10*60*60;
$dateFormat="d-m-Y H:i::m:s";
echo $timeNdate=gmdate($dateFormat, time()+$offset);
i have a php page which auto refreshes itself after 10 seconds. Some time the page takes too long to load as its fetching data from external urls . How can i stop execution of the script after 10 seconds and then reload the page.
I have a list of phone numbers that start with the below numbers and in different formats...i need to grab the numbers that start only with the below numbers/format using php......
020 8
07974
+44 (0) 20
+44 0
440203
any help will be appreciated..
I want to use PHP (possibly with Curl/XPath?) to extract data from Wikipedia pages. What would be the best way to go about this? I'll be using CakePHP for this project, although just need to figure out how to get this working first.
Stupid question, this code:
<?php
$variable = system("cat /home/maxor/test.txt");
echo $variable;
?>
with file test.txt:
blah
prints:
blah
blah
What can I do with system() function to not print nothing so I get 1 "blah"???
I have scheduled a CRON job to run every 4 hours which needs to gather user accounts information.
Now I want to speed things up and to split the work between several processes and to use one process to update the MySQL DB with the retrieved data from other processes.
In JAVA I know that there is a thread pool which I can dedicate some threads to accomplish some work.
how do I do it in PHP?
Any advice is welcome.
Thank
$var = "Hi there"."<br/>"."Welcome to my website"."<br/>;"
echo $var;
Is there an elegant way to handle line-breaks in PHP? I'm not sure about other languages, but C++ has eol so something thats more readable and elegant to use?
Thanks
When I am grabbing data from my table that require permissions, should all the permission be done there? Such as checking for an admin or if they can view the data (in MySQL)?
Or should I grab it if they have a record at all, then check the specific actions (such as view, add, edit, delete) on the PHP side?
I am trying to learn how to create tags in PHP/MySQL. Does anyone know some good sites that help explain how to go about creating tags?
Tags as in the tags you see when you ask a question in stackoverflow.
hey guys
im wondering if i can delete all my website's cookies when user click on logout
because i used this as function to delete cookie but its not functioning properly
setcookie("user",false);
is there a way to delete one domain's cookies in php ?!