Help a newbi, ;)
Moderator: General Moderators
-
Maluendaster
- Forum Contributor
- Posts: 124
- Joined: Fri Feb 25, 2005 1:14 pm
Help a newbi, ;)
hey all, I'm a newbi in this world of PHP and this is my first post, and hopefully not the last.
My question is that I wanna make a form that can upload an image, risize it to a given width and height, rename the file with 5 random numbers and give and ID (those 5 random numbers)... Why do I wanna do this? , i want to create a script that can upload images to a wap enabled server, then from the cell phone, put in a form the 5 numbers and download the image...
Thanks in avance and I hope you can understand me..
Saludos desde Chile!
PS : I forgot to say, i have tried for a long time now with no success, searching google, reading tutorials, but nothing that can help me.
My question is that I wanna make a form that can upload an image, risize it to a given width and height, rename the file with 5 random numbers and give and ID (those 5 random numbers)... Why do I wanna do this? , i want to create a script that can upload images to a wap enabled server, then from the cell phone, put in a form the 5 numbers and download the image...
Thanks in avance and I hope you can understand me..
Saludos desde Chile!
PS : I forgot to say, i have tried for a long time now with no success, searching google, reading tutorials, but nothing that can help me.
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
upload the image, get the extension, create a new image from that image with the set height&width, then save the image as a random numer.
for the image stuff look up imagecreatefromgif(); and the sort. I hate that area of php so im not much help there
for the random number you can do somthing like this (quick and not the best but it will work).
for the image stuff look up imagecreatefromgif(); and the sort. I hate that area of php so im not much help there
for the random number you can do somthing like this (quick and not the best but it will work).
Code: Select all
$a = rand(0, 9);
$b = rand(0, 9);
$c = rand(0, 9);
$d = rand(0, 9);
$e = rand(0, 9);
$num = $a.$b.$c.$d.$e;-
Maluendaster
- Forum Contributor
- Posts: 124
- Joined: Fri Feb 25, 2005 1:14 pm
-
Maluendaster
- Forum Contributor
- Posts: 124
- Joined: Fri Feb 25, 2005 1:14 pm
..
If it's a unique image name that you're looking for, dealing with number, why not use:
This will provide you with a unique number every time (unless an image is uploaded at the EXACT same time, which is unlikely).
Code: Select all
$num = time();-
Maluendaster
- Forum Contributor
- Posts: 124
- Joined: Fri Feb 25, 2005 1:14 pm
ok, right now I have 2 files, the problem is that the variable $clave doesnt show in the pass.php file ....
wap.php
pass.php
wap.php
Code: Select all
<?
header("Content-Type: text/vnd.wap.wml");
echo"<?xml version="1.0"?>"; ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="Descarga" title="The Chilean Sanitarium">
<do type="accept" label="Enviar">
<go method="post" href="pass.php">
<postfield name="wall" value="$clave"/>
</go>
</do>
<p>
ID
<input title="name" name="wall"/><br/>
</p>
</card>
</wml>Code: Select all
<?
header("Content-Type: text/vnd.wap.wml");
echo"<?xml version="1.0"?>"; ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<a href="http://www.metallica.com/wap/<?echo $HTTP_POST_VARSї'clave'] ?>.jpg">Descargar Wallpaper</a>
</wml>-
Maluendaster
- Forum Contributor
- Posts: 124
- Joined: Fri Feb 25, 2005 1:14 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
http://php.net/variables
you will also need to actually have the output for $clave processed by php. The code you posted has $clave outside of php's parsing.
you will also need to actually have the output for $clave processed by php. The code you posted has $clave outside of php's parsing.
-
Maluendaster
- Forum Contributor
- Posts: 124
- Joined: Fri Feb 25, 2005 1:14 pm