I've coded a function that crops an image to a given aspect ratio and finally then resizes it and outputs it as JPG:
<?php
function Image($image, $crop = null, $size = null)
{
$image = ImageCreateFromString(file_get_contents($image));
if (is_resource($image) === true)
{
$x = 0;
$y = 0;
$width = imagesx($imag...
What is the best way to crop or mask an image into a circular shape, using either ImageMagick or GD libraries? (Note, solution exists on "other" Q&A sites, but not StackOverflow)
...
<?PHP
print "hello";
?>
I write this code and save as "1.php";
Then I upload this PHP script to my
server.
I have 8 diffrent free hosting server's accounts.
And I noticed that there are 2 types of
server settings.
(1)
"type A"
for exapmle, sqweebs.
We need to set the PHP file permission as 640.
This means that sqweebs server req...
What does $this-> mean in CakePHP?
Please answer this in two parts...
What does $this refer to?
What does -> refer to?
Can someone explain each part explicitly in terms of the statement $this->Post->find('all'); in the Post controller. Why do you need the ->Post part if it is in the Posts controller?
...
As stated in the documentation on sqlite_popen php tries to make use of a persistent resource mechanism. Where is this mechanism described in detail? Is it possible to view all resources currently stored/used? Is it possible to access this mechanism and store/read other values?
...
I've written and played around with alot of PHP function and variables where the original author has written the original code and I've had to continue on developing the product ie. Joomla Components/Modules/Plugins and I've always come up with this question:
How does the '&' symbol attached to a function or a variable affect the outcom...
how can I code in the following code into a wordpress site without the code causing an error with the php coding thanks.
<?xml version="1.0" encoding="utf-8" ?>
...
Im working on a php script to take an existing csv file (we'll call this one the template) and open it in a page and populate editable text fields with it's data between 1 and 50 times(user decides how many), which once edited to the users wishes, can then all be saved into a single combined csv file, separate from the template.
I inclu...
Hello,
When I run the code below when $entry = miami.com, I get the following error message:
SELECT COUNT(*) FROM # check the manual that
corresponds to your MySQL server
version for the right syntax to use
near '' at line 1
It looks like I'm not correctly defining $table. Any ideas how I could do that?
Thanks in advance,
John
...
Hi I have a PHP website i want to integrate it with silverlight for some rich experience ,how can i do it ,.. is it necessary to host the website on IIS if we want silverlight integration.Please suggest ways ?
...
In my project (based on php/mysql/jquery ) i need the user to enter time.
But it seems very annoying to enter the time in strict formats like
06:00 PM
or
14:00
So i want to give the user freedom to enter time in a very friendly way like
6 pm, 11am etc
or
14
which will then be converted internally into a strict time format for further ...
did somebody use this Extension in php or have an example of code,
edit :
i want to hear an opinion on this Extension if somebody deal with it.
a tutorial with code , large examples ..
...
$file = ".$dirN/$filename.";
$count_my_page = (".$dirname1/$filename.$extens");
if(fopen(".$file.","r"))
{
$hits = file($count_my_page);
$nHits = ((int) $hits[0]) + 1;
$fp = fopen($count_my_page , "w");
fputs($fp , $nHits . "");
fclose($fp);
echo $nHits;
...
I'm using GD to generate images on the fly for title images on the page. There are over 100 images generated at the moment, the vast majority of which work great.
Recently we found certain titles were breaking the image creation where a large horizontal space was inserted between 2 characters.
The font being used for image generation i...
Using PHP's DOM functions, how do you convert a DOM Node's contents into a string?
<foo>
Blah blah <bar baz="1">bah</bar> blah blah
</foo>
Given foo as the current context node, how do you get 'Blah blah <bar baz="1">bah</bar> blah blah' as a string? Using $node->textContent or $node->nodeValue just returns the text nodes, not the...
I have a form to upload a file.The <html> is as follows:
<div id="divModalPopup" class="ui-dialog-content" style="height: 139px; width: 268px;">
<form method="post" action="upload.php" target="uploadframe" enctype="multipart/form-data">
Please choose a file to upload [only zip with shape files and no folders]:
<input type="fi...
I would like to interface a php page to the linux command line program ping.
I realize that there are sanitation issues. Is there a builtin library or function that can take care of everything, or will I have to rely on regex parsers?
...
Does someone know a good web service to resize images ? Either an open source (PHP/Python/Ruby) application, or a company providing a web service api.
...
I know that I can output an image using GD by using
<img src='draw.php'>
Where draw.php is a file containing the code to create an image. How can I instead output the image via a function call (I am using the Zend Framework so will be using a View Helper) rather than simply pointing to a .php file in an img tag as above?
Any help g...
hi friends,
I just want to validate url,for both folowing formats
http://www.XYZ.com
and
www.XYZ.com
i want this validation script in Javascript and PHP also.
Thanks in advance.
...