hi guys im new here and i need ur help its very urgent and very important there is very small task that i have to do and i dont know how to do.
visit this link
http://www.tshirtcreator.com/createtshirt.php
i want to do the same thing as on this page i mean changing the color of the image writing on the image etc.
i mean exactly the same thing.
guys im counting on you i need this.
waiting for ur replieeeeeeeeeeeeeeeeessss.
ahtasham
need help urgent
Moderator: General Moderators
-
ahtasham82
- Forum Newbie
- Posts: 10
- Joined: Fri Jan 14, 2005 10:42 pm
- Location: PAKISTAN
- Contact:
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
-
ahtasham82
- Forum Newbie
- Posts: 10
- Joined: Fri Jan 14, 2005 10:42 pm
- Location: PAKISTAN
- Contact:
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Have a folder with separate images named blue.jpg, red.jpg etc etc...ahtasham82 wrote:thanks
i know how to write on the image but dont know how to change the color of the image so whats your suggestion regarding this
please reply soon
Then simply have something like...
Code: Select all
switch ($_GET['color']) {
case 'red': $img = 'red.jpg';
break;
case 'blue': $img = 'blue.jpg';
break;
default: $img = 'yellow.jpg';
break;
}
echo '<div style="width:300px; height:400px; background-image:url('.$img.'); background-repeat:no-repeat;">Text</div>';Read the manual on http://www.php.net/ if you haven't done so already.... it's the best resource available for understanding PHP
POST could also be utilized and the content being processed within the page coding if you want it EXACTLY like that site and don't want to pass it to the URL.
Code: Select all
<?
if($_POST['action'] == "tshirt")
{
switch($_POST['color'])
{
case blue:
$image = "blue.jpg";
break;
case red:
$image = "red.jpg";
break;
case green:
$image = "green.jpg";
}
echo "<img src=\"tshirts\$image\" alt=\"".$_POST['color']." Tshirt\">";
} ELSE
{ ?>
<form action="<? echo $PHP_SELF; ?>" method="POST">
<input type="hidden" name="action" value="tshirt">
<select name="color">
<option value="blue">Blue</option>
<option value="red">Red</option>
<option value="green">Green</option>
</select>
// whatever other variables you want here.. like text.. etc
</form>
<? } ?>