Guys I need ur help,
I have a text file which contains a text like "c:/images/myimage.jpg"
Now using PHP I want to move this local image file to somewhere on server. Is it possible?
Please suggest!
Thanks,
Jaswant
...
Hi guys, im wondering what the declaration of the data type in the bind parameter (or value) is used for...
I mean, i thougth that if i define a param like int, PDO::PARAM_INT, the param must be converted in int, something like
$delete->bindParam(1, $kill, PDO::PARAM_INT);
//should works like
$delete->bindParam(1, (int)$kill);
or at ...
What is the best way to store a file structure, along with files, say from a Zip file? Currently each file is a row in the MySQL database, but obviously no structure can be read from that. I want to avoid storing a binary file. All files should be plain text. Each zip/file structure is private to the user whom submitted it.
...
I just did a fresh install of lamp stack on ubuntu and enabled the mod_rewrite module for my default website. What I want is something similar to the drupal's queries, when the whole query string is kept in one variable. For this purposes the following mod_rewrite code may be used:
RewriteRule ^(.*)$ home.php?q=$1 [L,QSA]
The problem ...
I have this code. It's from the Zend Reading Mail example.
$message = $mail->getMessage(1);
// output first text/plain part
$foundPart = null;
foreach (new RecursiveIteratorIterator($mail->getMessage(1)) as $part) {
try {
if (strtok($part->contentType, ';') == 'text/plain') {
$foundPart = $part;
brea...
I want to add some new functions to the core string helper which is found in system/helpers folder. I think there was a 'right' way to do this using MY_String_helper or something of that sort but I can't remember exactly how it was done. Any thoughts?
...
I need two functions that would take a string and return if it starts with the specified character/string or ends with it.
For example:
$str='|apples}';
echo startsWith($str,'|'); //Returns true
echo endsWith($str,'}'); //Returns true
...
I need 2 functions that take a string and the number of chars to trim from the right and left side and return it. E.g:
$str = "[test]";
$str = ltrim($str,1); //becomes test]
$str = rtrim($str,1); //becomes test
Thoughts?
...
Duplicate:
website screenshots using php
Is it possible to take a screenshot of the current page using PHP?
...
I have two dynamic tables (tabx and taby) which are created and maintained through a php interface where columns can be added, deleted, renamed etc.
I want to read all columns simulataneously from the two tables like so;-
select * from tabx,taby where ... ;
I want to be able to tell from the result of the query whether each column came...
Hello,
is there a way to create my own custom superglobal variables like $_POST and $_GET?
...
recently i worked in a project. the project has one root directory named "Project".the "Project" directory has also two sub-directory named "project_a" and "project_b". the "project_b" directory has two more sub-directory named "project_b_1" and "project_b_2". when i am on a page which is contains "project_b_2" directory then how can i a...
If I use a configuration file to store for example the sitename, database host, etc.. what is the best practice to handle this?
$sitename="stackoverflow.com"; and then setting global $sitename in functions
DEFINE(_SITENAME,"stackoverflow.com")
function vars(){return array(sitename=>"stackoverflow");}
?
I would love a technical expla...
I need to recursively cast a PHP SimpleXMLObject to an array. The problem is that each sub element is also a PHP SimpleXMLElement.
Is this possible?
...
Hi guys, we have a problem [cit.]
I need to assign a callback dynamically within a class, in base of a variable param: my goal is to have just one class (and not a main class and many extender sub-class), and inside this class if a value is X, then the funcitonX must be used, if is Y, the functionY.
I know i cant explain well, i hope m...
I'm working on a project where I am verifying information from a user with a SOAP web service. I currently am taking care of errors assuming that I'm receiving responses from the web service, but also need to handle the edge cases of a service timeout or unavailability.
In the case of a timeout or service unavailability, I need to prete...
Hello, I am trying to show and hide a few form fields dependent on the value of one of my select fields, I am looking to use arrays to to hold what should be show and what should not be show for each select value, to save me from a massive switch statement, but cannot figure out to do it.
I am using PHP and jQuery. Any help would be g...
Can someone convert below code to ASP format?
<?php
$data = '
[
{
"A": "test",
"B": "test",
"C": "test"
},
{
"A": "test",
"B": "test",
"C": "test"
}
]
';
print($_GET['callback'] .'('. $data .')');
while I was testing cross domain restriction workaround, this code works fine with PHP server (of course)...
Can anyone tell me how to execute a .bat file from a PHP script?
I have tried -
exec("C:[path to file]");
system("C:[path to file]");
nothing is working. Ive checked the PHP manuals and googled around but cant find a good answer. Anyone know where im going wrong?
I'm running windows 2003 server and have successfully manually ran the ...
Heres my problem. I have a mysql table called quotes. In one of the rows, a quote contains the folloqing characters
‘ and ’
Now the row collation is utf8__unicode__ci
When using MySQL Query Browser and PHPMyAdmin to retrive the rows the quotes come out as intended. How ever when i retrive them from the database using PHP and display ...