Hi, I've tried to upload a picture using the function
imagecreatefromgif, with a script as simple as possible to avoid miss
spellings and stuff like that. I've ran the following line of code to
see if my host had the right gd lib, and it was positive:
<?PHP print_r(gd_info()); ?>
so if it's not the server, what am i missing?
Here is my tiny script as it looks now:
<?php
function billede()
{
$bill = imageCreateFromGIF ("hindenburg.gif");
return $bill;
}
billede();
?>
Thanks for your help :) 16 6415
What's the error message ?
"moxmormor" <mo*******@gmail.coma écrit dans le message de news: 11**********************@i3g2000cwc.googlegroups.c om...
Hi, I've tried to upload a picture using the function
imagecreatefromgif, with a script as simple as possible to avoid miss
spellings and stuff like that. I've ran the following line of code to
see if my host had the right gd lib, and it was positive:
<?PHP print_r(gd_info()); ?>
so if it's not the server, what am i missing?
Here is my tiny script as it looks now:
<?php
function billede()
{
$bill = imageCreateFromGIF ("hindenburg.gif");
return $bill;
}
billede();
?>
Thanks for your help :)
Are you sure about the file path ? try to add the complete path of the file,
maybe with a if file_exists() to be sure...and print an error message if it
doesn't exists.
Now I'm confused. When it executed the following script, the output was
'nonexistant'.
<?php
function billede()
{
if (!file_exists('hindenburg.gif'))
{
$bill = imageCreateFromGIF ('hindenburg.gif');
return $bill;
}
else
echo "nonexistant";
}
billede();
?>
However, when I changed 'hindenburg.gif' to
'moxmormor_org/htdocs/hindenburg.gif' it went blank again.
Are you sure about the file path ? try to add the complete path of the file,
maybe with a if file_exists() to be sure...and print an error message if it
doesn't exists.
Now I'm confused. When it executed the following script, the output was
'nonexistant'.
<?php
function billede()
{
if (!file_exists('hindenburg.gif'))
{
$bill = imageCreateFromGIF ('hindenburg.gif');
return $bill;
}
else
echo "nonexistant";
}
billede();
?>
However, when I changed 'hindenburg.gif' to
'moxmormor_org/htdocs/hindenburg.gif' it went blank again.
"moxmormor" <mo*******@gmail.coma écrit dans le message de news: 11**********************@i42g2000cwa.googlegroups. com...
>Are you sure about the file path ? try to add the complete path of the file, maybe with a if file_exists() to be sure...and print an error message if it doesn't exists.
Now I'm confused. When it executed the following script, the output was
'nonexistant'.
<?php
function billede()
{
if (!file_exists('hindenburg.gif'))
{
$bill = imageCreateFromGIF ('hindenburg.gif');
return $bill;
}
else
echo "nonexistant";
}
billede();
?>
However, when I changed 'hindenburg.gif' to
'moxmormor_org/htdocs/hindenburg.gif' it went blank again.
You shouldn't user a path like this, instead use server variables in order
to be sure:
change moxmormor_org/htdocs/hindenburg.gif
to $_SERVER['DOCUMENT_ROOT'].'/hindenburg.gif';
also be very carefull, on Linux the filesystem is case sensitive, so
hindenburg.gif <hindenburg.GIF
Bob
You shouldn't user a path like this, instead use server variables in order
to be sure:
change moxmormor_org/htdocs/hindenburg.gif
to $_SERVER['DOCUMENT_ROOT'].'/hindenburg.gif';
also be very carefull, on Linux the filesystem is case sensitive, so
hindenburg.gif <hindenburg.GIF
Bob
Thank you, but it's still nonexistant. :(
"moxmormor" <mo*******@gmail.coma écrit dans le message de news: 11**********************@b28g2000cwb.googlegroups. com...
>You shouldn't user a path like this, instead use server variables in order to be sure: change moxmormor_org/htdocs/hindenburg.gif to $_SERVER['DOCUMENT_ROOT'].'/hindenburg.gif';
also be very carefull, on Linux the filesystem is case sensitive, so hindenburg.gif <hindenburg.GIF Bob
Thank you, but it's still nonexistant. :(
try a echo $_SERVER['DOCUMENT_ROOT'].'/hindenburg.gif' to be sure, maybe
your config root is wrong (pointing to the wrong file). Also to be sure, put
everything in a var:
$filename = $_SERVER['DOCUMENT_ROOT'].'/hindenburg.gif';
echo $filename;
if(file_exists($filename))
echo 'file exists';
else
echo 'file doesnt exist';
Bob
Are you on linux or XP ?
try a echo $_SERVER['DOCUMENT_ROOT'].'/hindenburg.gif' to be sure, maybe
your config root is wrong (pointing to the wrong file). Also to be sure, put
everything in a var:
$filename = $_SERVER['DOCUMENT_ROOT'].'/hindenburg.gif';
echo $filename;
if(file_exists($filename))
echo 'file exists';
else
echo 'file doesnt exist';
Bob
Pretty strange. Now the output is that the file is nonexistant, then
the full path, then that the file DOES exist.
>
Are you on linux or XP ?
I'm on a Linux server I'm pretty sure. Since they are operating with
php. My PC is XP.
"moxmormor" <mo*******@gmail.coma écrit dans le message de news: 11**********************@m79g2000cwm.googlegroups. com...
>try a echo $_SERVER['DOCUMENT_ROOT'].'/hindenburg.gif' to be sure, maybe your config root is wrong (pointing to the wrong file). Also to be sure, put everything in a var:
$filename = $_SERVER['DOCUMENT_ROOT'].'/hindenburg.gif'; echo $filename; if(file_exists($filename)) echo 'file exists'; else echo 'file doesnt exist';
Bob
Pretty strange. Now the output is that the file is nonexistant, then
the full path, then that the file DOES exist.
Sorry I don't understand what you mean. What do you mean for output file ?
the full path is OK, are you sure on case (Linux is case sensitive,
remember), where the file DOES exists ?
>Are you on linux or XP ?
I'm on a Linux server I'm pretty sure. Since they are operating with
php. My PC is XP.
PHP can run on XP too, but if it's a professional web hosting, probably it's
on Linux.
On your page I've this result:
nonexistant/var/www/virtual/moxmormor.byethost11.com/moxmormor_org/htdocs/hindenburg.gifexistant
why there is a nonexistant and then an existant ? Your code is called twice
?
Could you send the entire code ? I'll check it for you.
I found the moxmormor.byethost11.com in your address quite strange altrough.
Bob
Bob Bedford wrote:
"moxmormor" <mo*******@gmail.coma écrit dans le message de news: 11**********************@m79g2000cwm.googlegroups. com...
try a echo $_SERVER['DOCUMENT_ROOT'].'/hindenburg.gif' to be sure, maybe
your config root is wrong (pointing to the wrong file). Also to be sure,
put
everything in a var:
$filename = $_SERVER['DOCUMENT_ROOT'].'/hindenburg.gif';
echo $filename;
if(file_exists($filename))
echo 'file exists';
else
echo 'file doesnt exist';
Bob
Pretty strange. Now the output is that the file is nonexistant, then
the full path, then that the file DOES exist.
Sorry I don't understand what you mean. What do you mean for output file ?
The output of my commands. The output, as you can see in the code,
tells me that the two paths are alike, but the one exists and the other
doesn't.
the full path is OK, are you sure on case (Linux is case sensitive,
remember), where the file DOES exists ?
yes, I've got everything in the same folder. And I have gained access
to textfiles in that folder before.
Are you on linux or XP ?
I'm on a Linux server I'm pretty sure. Since they are operating with
php. My PC is XP.
PHP can run on XP too, but if it's a professional web hosting, probably it's
on Linux.
On your page I've this result:
nonexistant/var/www/virtual/moxmormor.byethost11.com/moxmormor_org/htdocs/hindenburg.gifexistant
why there is a nonexistant and then an existant ? Your code is called twice
?
Could you send the entire code ? I'll check it for you.
Here it is:
<?php
function billede()
{
if
(!file_exists('/var/www/virtual/moxmormor.byethost11.com/moxmormor_org/htdocs/hindenburg.gif'))
{
$bill = imageCreateFromGIF
('/var/www/virtual/moxmormor.byethost11.com/moxmormor_org/htdocs/hindenburg..gif');
return $bill;
}
else
echo "nonexistant";
}
billede();
$filename = $_SERVER['DOCUMENT_ROOT'].'/hindenburg.gif';
echo $filename;
if(file_exists($filename))
echo 'existant';
else
echo 'nonexistant';
?>
Thank you for your effort :)
I found the moxmormor.byethost11.com in your address quite strange altrough.
I started with a free account at byethost to check it out. then I
changed to a paid solution, and got my public DNS changed or something.
There is a reasonable explanation, although I don't understand it ;)
Bob
moxmormor wrote:
Hi, I've tried to upload a picture using the function
imagecreatefromgif, with a script as simple as possible to avoid miss
spellings and stuff like that. I've ran the following line of code to
see if my host had the right gd lib, and it was positive:
<?PHP print_r(gd_info()); ?>
so if it's not the server, what am i missing?
Here is my tiny script as it looks now:
<?php
function billede()
{
$bill = imageCreateFromGIF ("hindenburg.gif");
return $bill;
}
billede();
?>
What are you expecting the script to do? It doesn't actually do
anything. It just open the gif file and doesn't produce any output.
What are you expecting the script to do? It doesn't actually do
anything. It just open the gif file and doesn't produce any output.
OK then that's why. I just expected the return statement did the job.
How should i then show the image once I've opened it?
Try this:
<?php
function billede($filename){
if(!file_exists($filename)){
$bill = imageCreateFromGIF($filename);
return $bill;
}else
echo "file already existent, cannot create new file<br>";
}
$filename = $_SERVER['DOCUMENT_ROOT'].'/hindenburg.gif'; //this avoid a lot
of problem. Typing manually the file will get you into trouble later...
echo $filename.'<br>';
$img = billede($filename);
/*if(file_exists($filename))
echo 'existant'; //should always be called has it would be created if it
wasn't existent before or already exists.
else
echo 'nonexistant';*/
?>
>Thank you for your effort :)
np.
try this code and let me know.
Bob
Bob Bedford wrote:
Try this:
<?php
function billede($filename){
if(!file_exists($filename)){
$bill = imageCreateFromGIF($filename);
return $bill;
}else
echo "file already existent, cannot create new file<br>";
}
$filename = $_SERVER['DOCUMENT_ROOT'].'/hindenburg.gif'; //this avoid a lot
of problem. Typing manually the file will get you into trouble later...
echo $filename.'<br>';
$img = billede($filename);
/*if(file_exists($filename))
echo 'existant'; //should always be called has it would be created if it
wasn't existent before or already exists.
else
echo 'nonexistant';*/
?>
Thank you for your effort :)
np.
try this code and let me know.
Bob
what i wanted to was to show the current gif image on my site, using
php. I think I might have misunderstood the consequences of the
imageCreateFromGIF function.
But thanks anyway:)
moxmormor wrote:
>What are you expecting the script to do? It doesn't actually do anything. It just open the gif file and doesn't produce any output.
OK then that's why. I just expected the return statement did the job.
How should i then show the image once I've opened it?
imagegif(), imagejpeg(), imagepng() etc..
imagecreatfrom..() creates an image identifier, not an image.
But why create an image in memory, and then return the same image? Unless
you do something in between, a link to the file er even readfile() is more
efficiënt.
Grtz,
--
Rik Wasmus This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Gary |
last post by:
I am trying to use the "System.Windows.Forms.SendKeys" class for triggering
the Ctrl+P key.
Syntax:
System.Windows.Forms.SendKeys.Send("^(P)");
This is not working ..what could be the...
|
by: Mullin Yu |
last post by:
hi,
i have a web service that has file operations on Windows OS, and there may
be a file concurrency issue if only one working directory e.g. c:\working
therefore, i want to have a unique sub...
|
by: |
last post by:
Hello,
I am hoping someone else has thought about a date time calculation i need to
perform.
I would like to be able to calculate the number of "working minutes" between
2 dates, given my...
|
by: Martin Heuckeroth |
last post by:
Hi
We are working on a webservice application and are having some
problems with the cookies and/or sessions.
We have them working on our intranet but then its not working on the
internet. We...
|
by: tshad |
last post by:
I have been working with setting my drop boxes to allow double clicking to
select an item.
It worked fine until I made some changes. I then stripped the page down to
the bare essentials to find...
|
by: jojobar |
last post by:
Okay, I am trying to do is to test the webresource in 2.0
1. I created a new project with assembly name (and default assembly name)
"Office".
2. I added the following to the AssemblyInfo.cs...
|
by: Don |
last post by:
I'm having problems with intellisense, autocomplete, etc. suddenly not
working in certain classes of a project I'm working on. All the options are
set, and it all works fine for most classes, but...
|
by: MSDNAndi |
last post by:
Hi,
I have a set of simple webservices calls that worked fine using .NET
Framework 1.0.
I am calling a Java/Apache based webservices, the calling side is not able
to supply a proper WSDL.
...
|
by: comp.lang.php |
last post by:
re:
http://www.google.com/search?hl=en&q=swedish+flag&btnG=Google+Search
I am trying only this:
$image = @imagecreatefromgif('/path/to/this/image.gif');
This line alone causes a...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
| |