
Mutley
Members-
Posts
765 -
Joined
-
Last visited
Everything posted by Mutley
-
I have a product list page, users can check the product then go to an e-mail form, that lists the products they checked. On this, they can then chose a quantity for every product, how do I make it so when they send the e-mail, it gets the quantity for each product (using PHP mail, to send)? The field would be: <input type="text" size="4" maxlength="4" value="1" name="quantity"> But that wouldn't work for multiple ones? Would I use a "foreach" statement, somehow?
-
Try: <?php $image=mysql_result($godinass,$i,"image"); $imgcheck = $_GET['image']; if(empty($imgcheck)) { $imageurl = "http://mysite.com/images/empty.gif"; }else{ $imageurl = "http://mysite.com/features/".$image; } ?>
-
I'm guessing your subdomain is in the /hdtv/ folder? So try: $uploaddir = '../hdtv/images/';
-
The competition is a good idea but usually only the more experienced can really get anything out from them. How about a community project, where a task is set, like a CMS, forum or something similar, then everyone can chose or is given a part to do and then help build it, it would mean all abilities could help out in some way and really learn from doing it too. There's no prizes and it's not a race, just something to bond the community more and have the satisfaction of "I helped make that" at the end. Just a suggestion.
-
Try just: $uploaddir = '../images/';
-
Some trial and error should get it right. I'm unsure without seeing the code, it could just be as simple as moving a few DIVs/Tables about or adjusting forms. If it's all called by PHP, it might be a little harder.
-
Try: $uploaddir = dirname($_SERVER['SCRIPT_FILENAME']) ."../Images/";
-
Make sure your IE is accepting the cookies. Try changing the security level by going to Tools > Options in IE, then Security and set it to off/low.
-
If you want to delete the contents of the column "Image2" just update it to blank, such as: mysql_query("UPDATE ads SET Image2= '' WHERE ID = '$ID'");
-
Overlapping DIV layers? So the users image is sitting behind the circle corners, that would make up the full circle in another DIV.
-
<?php $con = mysql_connect("localhost","name","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("npsari_other", $con); mysql_query("DELETE FROM ads WHERE ID='$ID'"); mysql_close($con); ?> That would delete the row where the id = $id. I'm not sure what the "Image2" part is referring too?
-
I have a script that looks in a flat text file for an image and coordinates, then plots them on Google Maps in a DIV tooltip. I want to convert the script to database but need to know how it works in order to do so (mainly when there is 2 or more pictures under the same coordinates it will group them in the same DIV and not loads over lapping each other). Here is the code: <?php $locations = array(); $lines = file("locations.txt"); $count = 0; foreach ($lines as $line) { list($gallery,$lat,$long) = split(" ", $line); $long = trim($long); if (!array_key_exists($lat . "," . $long,$locations)) { $locations[$lat . "," . $long] = array(); } array_push($locations[$lat . "," . $long],$gallery); } foreach ($locations as $latlong => $galleries) { $size = count($galleries); $count = $count + 1; print "var marker$count = new GMarker(new GLatLng($latlong));\n"; $tooltip = "<div style='width: 205px; height: " . (55 * $size) . ";'>"; foreach ($galleries as $gallery) { $tooltip = $tooltip . "<div style='width: 205px; height: 55px;'><table width='100%'><tr><td valign='middle'><a href='images/$gallery'><img height='50' border='2' src='images/$gallery'></a></td><td align='center' valign='middle'><font size='-2'>" . str_replace("_"," ",$gallery) . "yes</font></td></tr></table></div>"; } $tooltip = $tooltip . "</div>"; print "GEvent.addListener(marker$count, 'click', function() { marker$count.openInfoWindowHtml(\"$tooltip\"); });\n"; print "map.addOverlay(marker$count);\n"; } ?> The flat file looks like: So the images are "images/mt.jpg" for example, and the next set of numbers are the coordinates. Thanks, help on finding what groups the same coordinates in a DIV would be really helpful.
-
It's clean table wise, only errors are spaces and text characters.
-
I have a problem with Internet Explorer enlarging table rows. Here is a picture of both browsers side by side (IE is on left, Firefox on right): Full size image here: http://img401.imageshack.us/img401/3291/arghna6.jpg As you can see IE has a grey sort of bar beneath the red one (same row) and each row is spaced. The code for the header section: <table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td class="header" height="100" width="80%" colspan="3"><center><h1>J.J.Metcalfe & Son</h1></center></td> <td rowspan="3" width="20%" style="border:#000000 1px solid; background-color:#FFFFFF"> <marquee scrollamount="3"> <table class="productlist" width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <?php include('includes/sql_connect.php'); $sql = "SELECT id, category, name, cpn, pn, description, descriptionf, descriptiong, weight, price, ofeatured, onew, osale FROM products WHERE ofeatured='1'"; $result = mysql_query($sql) or die("SQL Query: {wordwrap($sql)}<br />Error because: " . mysql_error()); if(mysql_num_rows($result)!=0) { while(list($id, $category, $name, $cpn, $pn, $description, $descriptionf, $descriptiong, $weight, $price, $ofeatured, $onew, $osale) = mysql_fetch_row($result)) { ?> <td> <center> <a href="viewproduct.php?id=<?=$id?>"> <?php $filelocation = "images/products/$id.jpg"; if(file_exists($filelocation)) { echo "<img src=\"image_thumbs.php?id=$id\" alt=\"$cpn\" />"; } else { echo "<img src=\"images/products/noimage.png\" alt=\"No Image\" />"; } ?> </a><br /> <font class="pn"><?=$cpn?>/<?=$pn?></font><br /> </center> </td> <?php } } else { echo "No Featured Products."; } ?> </tr> </table> </marquee> </td> </tr> <tr> <td class="infobar" colspan="3"><center>Tel: 0044 (0)1609 771124 Fax: 0044 (0)1609 760635</center></td> </tr> <tr> <td class="searchbar" colspan="3"><center><? include('search.php'); ?></center></td> </tr> </table> In the CSS it only changes font colour and style, nothing to do with the tables/padding.
-
How do I select a number randomly? I tried this: <?php $a = array('10','20','30','40'); $b = array_rand($a); echo $b; ?> I want it to echo "10" or "20" etc but instead it comes out with numbers between 1-4?
-
Is negative numbers reversed when using greater than (>) or smaller than (<)? So '-7' is greater than '-3'?
-
I'd prefer to echo the error, just I don't know how to scan for bad characters in the first place.
-
I want to stop people inserting characters into forms (such as !"£$%^&*()><?.,). What's the best way of doing this? Can I stop them from doing it to return a message, or is it better to just wipe the characters before inserting into a database, or both? The only symbols I need is for an e-mail field, which are . - @ otherwise it's just numbers 0-9 and letters A-Z. I found a script to disable input but it doesn't stop people from finding other ways of inputting bad characters. Assistance would be appreciated, thanks.
-
Hehe, yeah I just did it like that. Thanks for the help.
-
I can redirect to another page, that's easy, just how can I display a confirmation message then?
-
Is there a method to stopping a form refreshing? So when you submit a form, you can't hit refresh and submit the data again?
-
In my database I have a field with numbers, when I arrange them DESC, it says 5819 is greater than 500355. Why is this? My numbers show in this order: 903669 5819 500355 319 -50002 I tried clearing them and re-entering the numbers but no luck.
-
Thanks but why can't I divide by zero? I get an error saying I can't divide by zero.
-
This is probably really basic but I can't figure it out. If I have someone who has played 10 times, 8 times he has won and 2 times he has lost. What I want to do is make a % for this (in this case it should be 80%). If I do: (8/2)*100 = 400% So how do I get it to work the way I want? Basic maths I fail at.