![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
DBookatay
-
Posts
334 -
Joined
-
Last visited
Posts posted by DBookatay
-
-
Can someone please help me understand this script:
[a href=\"http://www.phpfreaks.com/tutorials/36/0.php?topic_id=1144&hl=2527#2527\" target=\"_blank\"]http://www.phpfreaks.com/tutorials/36/0.ph...44&hl=2527#2527[/a]
Where exactly do I place the code:
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]$newfilename="anexample.gif";$old="files/".$_FILES['imagefile']['name'];$new="files/$newfilename;rename($old,$new1);[/quote]
I have a login area that echos $USERNAME on every page, so what I want to do is have the usernames company logo that is uploaded renamed to something like "(username)_logo.gif" but dont understand just how to go about it.
I got the origional script to work correctly, but now I'm stuck.
Also, after I got this to do what I wanted, I wanted to make it so that they can not only upload .gifs, but also .jpgs as well. And have them so that they are only a certian size. 200x150 max.
Anyone have any ideas?
-
I am working on a internal posting area for my company, where users are asked to upload an image onto the server, and then have the image displayed. I found this code and got it to work properly:
[code]if (is_uploaded_file ($_FILES['image']['tmp_name'])) {
if (move_uploaded_file($_FILES['image']['tmp_name'], "user_logos/{$_FILES['image']['name']}"))
$i = $_FILES['image']['name'];
} else {
$i = "";
}[/code]
What I now need to do is be able to rename the images, incase 2 users upload the same image name. Is there an easy way to do this? -
Anyone???
-
Anyone?
-
As the title says, I need a little help from the experts on shopping cars.
Right now I'm trying to find a cart that customizable based on certian features that we need, but the few I have tried so far, OSCart, CubeCart, ZenCart, all require you to use pre-made templates, which are good, but they are for the entire site, not just the actual "cart" page. I spent quite a while designing my site, and want to stick with the layout that I chose.
Do you know of any good tutorials or codes for carts, that doesn’t require me to use their ready-made templates? Basically the "Add to Cart" type pages, where then they can select certian things like size, color, ect, then hit "Update" and either "Check Out" or "Continue Shopping."
-
[!--quoteo(post=356686:date=Mar 20 2006, 12:59 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Mar 20 2006, 12:59 PM) [snapback]356686[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I don't know if that makes sense, but it's hard for me to tell what it's currently doing.
[/quote]
You're right, that makes NO sense to me... Could you possible show me a working example?
I would apprechiate it... -
I'm sure this one is easy for someone with more experience to figure out, but after spending over 2 hours of looking at errors I'm stumped...
I'm trying to create a page where you view items, and have 3 rows, with 3 items per row, a total of 9 images per page. I was able to get the 3 rows to work, but can't seem to get the 3 items per row to take shape. Can somebody look at my code and tell me what I have to do?
[code]<?php
if(isset($_GET['category']));
switch($_GET['category'])
{
case 'bracelets':
$pTitle = 'Bracelets';
break;
case 'cufflinks':
$pTitle = 'Cufflinks';
break;
case 'nameplates':
$pTitle = 'Nameplates';
break;
case 'pendants':
$pTitle = 'Pendants';
break;
case 'Earrings':
$pTitle = 'Our Earring Collection';
break;
case 'moneyclips':
$pTitle = 'Money Clips';
break;
}
include ('include/header.php');
?>
<table>
<tr>
<td class="shadowL"><img src="images/spacer.gif" width="19" height="1" /></td>
<td>
<table>
<tr>
<td class="lftNavHldr"><?php include ('include/leftNav.php'); ?></td>
<td class="mainHldr">
<table>
<tr><td class="pTitle"><? echo $pTitle; ?></td></tr>
</table>
<?php
require_once ('include/mysql_connect.php');
if(!$_GET['page']) {
$_GET['page'] =1;
}
$offset = ($_GET['page']-1)*3;
$query = "SELECT count(*) as thecount from products where category = '{$_GET['category']}' and status = 'Active'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$total = $row[thecount];
$pages = ceil($total/3);
$query = "SELECT * FROM products where category = '{$_GET['category']}' and status = 'Active' limit $offset,3";
$result = mysql_query($query);
$numrows = mysql_num_rows($result);
while($row = mysql_fetch_array($result)){
$image = "<img src=\"products/{$row[Category]}/{$row['SKU']}s.jpg\" width=\"155\" height=\"155\" alt=\"$alt\"/>";
echo "
<div align=\"center\">
<table>
<tr>
<td class=\"itmHldr\">
<table width=\"100%\">
<tr><td class=\"imgHldrS\"><a href=\"view_item.php?SKU={$row['SKU']}\">$image</a></td></tr>
<tr><td class=\"itmDescS\">{$row['Desc_S']}</td></tr>
</table>
<div align=\"center\">
<table>
<tr>
<td class=\"prc1S\">M.S.R.P</td>
<td class=\"prc2S\">$ {$row['MSRP']}</td>
</tr>
<tr>
<td class=\"prc3S\">Your Price</td>
<td class=\"prc4S\">$ {$row['Sell']}</td>
</tr>
<tr>
<td class=\"prc5S\">You Save</td>
<td class=\"prc6S\">$1245.00</td>
</tr>
</table>
</div>
</td>
<td><img src=\"images/spacer.gif\" width=\"20\" height=\"1\" /></td>
<td class=\"itmHldr\">
<table width=\"100%\">
<tr><td class=\"imgHldrS\"><a href=\"view_item.php?SKU={$row['SKU']}\">$image</a></td></tr>
<tr><td class=\"itmDescS\">{$row['Desc_S']}</td></tr>
</table>
<div align=\"center\">
<table>
<tr>
<td class=\"prc1S\">M.S.R.P</td>
<td class=\"prc2S\">$ {$row['MSRP']}</td>
</tr>
<tr>
<td class=\"prc3S\">Your Price</td>
<td class=\"prc4S\">$ {$row['Sell']}</td>
</tr>
<tr>
<td class=\"prc5S\">You Save</td>
<td class=\"prc6S\">$1245.00</td>
</tr>
</table>
</div>
</td>
<td><img src=\"images/spacer.gif\" width=\"20\" height=\"1\" /></td>
<td class=\"itmHldr\">
<table width=\"100%\">
<tr><td class=\"imgHldrS\"><a href=\"view_item.php?SKU={$row['SKU']}\">$image</a></td></tr>
<tr><td class=\"itmDescS\">{$row['Desc_S']}</td></tr>
</table>
<div align=\"center\">
<table>
<tr>
<td class=\"prc1S\">M.S.R.P</td>
<td class=\"prc2S\">$ {$row['MSRP']}</td>
</tr>
<tr>
<td class=\"prc3S\">Your Price</td>
<td class=\"prc4S\">$ {$row['Sell']}</td>
</tr>
<tr>
<td class=\"prc5S\">You Save</td>
<td class=\"prc6S\">$1245.00</td>
</tr>
</table>
</div>
</td>
</tr>
</table><br />\n";
$row_count++;
} // End of record loop.
mysql_close($dbc);
?>
</div>
<table width="100%">
<tr>
<td class="pgNums">
<?
for($x = 1; $x<= $pages; $x++) {
if($_GET['page'] != $x) {
echo "<a href=\"view_items.php?category={$_GET[category]}&page={$x}\">{$x}</a>
";
}
else {
echo "[{$x}] ";
}
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td class="shadowR"><img src="images/spacer.gif" width="19" height="1" /></td>
</tr>
</table>
<?php include ('include/footer.php'); ?>[/code]
Working with images
in PHP Coding Help
Posted