Hello everyone.
We have:
$path = "/home/httpd/html/index.php";
$file = basename($path); // $file is set to "index.php"
$file = basename($path, ".php"); // $file is set to "index"
$file = 'index'; // the result
How can we query a multiple file extensions? Instead of
$file = basename($path, ".php");
something...
We have a development server which we use while developing LAMP applications.
We also have a production server where our websites are deployed.
Occasionally, when deploying websites on the production server, we forgot to update certain paths. Occasionally we find that a production website is still referencing images, scripts and styles...
Same script is working fine in localhost but it is not working in server. It is throwing some error-
Warning: copy(album/6349416.jpg) [function.copy]: failed to open stream: Permission denied in D:\Hosting\6448289\html\upload.php on line 112
corresponding 112 line is-
$image_name=$unq.'.'.$extension;
//the new name will be containing...
Hi
Iam very new to drupal.
And i have drupal site. I am adding images through admin side(crate content->image).
Where can i see this image on client side ?
I dont know the url of the image displaying section.
Can any one please help?
...
I am getting following error while uploading image on server-
Warning: copy() [function.copy]: URL file-access is disabled in the server configuration in D:\Hosting\6448289\html\upload.php on line 112
corresponding 122 line is-
$copied = copy($_FILES['image']['tmp_name'], $newname);
...
Possible Duplicate:
What PHP MVC framework can you recommend?
I've decided to start my next project using MVC structure.. Until now , i haven't used any framework or php editors , project designer tools for any of my previous projects...
And all of them are working charm...
But i decided to use MVC because the project may ex...
I've set up a WordPress navigation for my single.php template that gets the previous and next post's thumbnails like this:
<?php
// Newer posts
$nails_next_post = get_next_post('%link', '', FALSE, 3 ); // Get the previous post
$nails_next_post_thumbnail = get_the_post_thumbnail($nails_next_post->ID); // Get thumbnail
?>
<?php if (...
Hello,
I'm getting this odd error in the preg_match() function:
Warning: preg_match(): Compilation failed: range out of order in character class at offset 54
The line which is causing this is:
preg_match("/<!--GSM\sPER\sNUMBER\s-\s$gsmNumber\s-\sSTART-->(.*)<!--GSM\sPER\sNUMBER\s-\s$gsmNumber\s-\sEND-->/s", $fileData, $matches);
Wh...
Sorry if this is basic, but I have been dealing with figuring this out all day and have gotten to where I can do everything I need with Jquery and cakephp (not sure if cakephp matters in this or if its same as any PHP), I want to return a variable from a cakephp function to jquery, I had read about how to do it, like here:
the cakephp:
...
I have a node with the following content (input mode: php code):
this is a <?php echo "test" ?>
If I output node->body, the output is
this is a <?php echo "test" ?>
What I want is:
this is a test
What is the easiest way to do this?
(I don't want all the default divs and other structural stuff coming with it when I call node_vie...
I've been trying the heredoc method like this:
<?php echo $form = <<<HTML ?>
here follows the html...
<form method="post" >
<table border="0" cellpadding="0" cellspacing="0" id="reserv_table">
<tr>
<td><span id="message"><b>for you : 9€</b> </span></td>
<td><input type="text" name="_membre" id="_membre" style="width: 40px;" c...
$values = array(...);
foreach($values as $value) {
// do something
}
How to run each $value after finishing the previous?
Thanks.
...
I have written a rule for redirecting in .htaccess file
its redirecting for some pages , if we give that link manually..
but what i want is ,it should redirect automatically....
My requirement is :
Instead of this link,
links.php?page=1&ipp=All&exchange=adddata
It should be redirected automatically
http://example.com/folder1/links/...
Hi..
I want to fetch blob datatype of images from MYSQL database using PHP and these images displayed in Iphone Uiimageview. can anybody post some PHP code to retrieve images from mysql.
Thanks
...
So, I know that the general idea in PHP is that the whole application is loaded and executed every time the page loads. But for optimization of a sizable object-oriented PHP app that needs to be portable…is it possible to load an object into memory that can be used for every request, not recreated for each one?
I've seen people using th...
Im looking to sort a list of product names being output by Smarty. Here is the current code:
{foreach from=$products key=i item=product}
<li>
<a href="discuss.php?product={$product.uri}
{if $filter_style}&style={$filter_style}{/if}">{$product.name|capitalize}
</a>
</li>
{/foreach}
The HTML output:
<li>zzzzz<...
Hello,
I have a form where the primary-key must be filled by the user. But if he enters a value existing, I have the page with doctrine error 'Integrity constraint violation: 1062 Duplicate entry'.
I want to make an error message as the other key with
$form['myKey']->renderError()
I have tried to use sfValidatorDoctrineChoice :
$t...
There are several methods on country codes.
I have a list of codes with 3-characters, like on this page:
http://www.fina.org/H2O/index.php?option=com_content&view=category&id=93:asia&Itemid=638&layout=default
Is there a simple way to convert them to 2-characters? Like "PT" from "POR" for Portugal.
Standard for 2-chara...
Hey i want to check a whether a user likes a certain page and if they do i want to display a message or div? I have searched through the facebook forums for possible solutions but i never came upon anything concrete so i would really appreciate the help.
...
on a given page there are bunch of elements:
<div class="some class"> <-- here is anything, other divs, even other divs with
the same class, but I need to match right on closing tag for this particular
opening tag --></div>
...