QuickOldCar
Staff Alumni-
Posts
2,972 -
Joined
-
Last visited
-
Days Won
28
Everything posted by QuickOldCar
-
Cannot get move_uploaded_file to work properly
QuickOldCar replied to timpickens's topic in PHP Coding Help
Only thing I see is this if (!move_uploaded_file($_FILES['userfile']['tmp_name'], $upfile)) Are doing a check for if move_uploaded_file() was done, but yet you never actually moved it with the function. -
Portfolio Website Crit (XHTML/CSS/PHP/JS)
QuickOldCar replied to aspacecodyssey's topic in Website Critique
Impressive, one of the best working and functional sites I've seen in a long time. Good job. Now time to animate your avatar, ha. -
That one seems to show more like when one is about to expire. Try something like this, because can update or modify it to your needs. http://www.weberdev.com/get_example-4603.html
-
Actually someone was nice enough to already write a tutorial at php freaks on image resizing and posted the code. http://www.phpfreaks.com/forums/faqcode-snippet-repository/dynamic-thumbnail-creation/
-
If this helps here are the domain lists from whois, most scripts do checks to see if they exist there or not. http://who.is/whois_index/index.php
-
Explain better please. Do you mean a check if a domain is alive or dead, or if is registered already? If talking about alive or dead I have a pretty fast script for for that, but that just tells you if the domain is currently online or not. As for registered domains....well most use some type of whois query, because these change hands so much and is so many of them. The downfall is whois doesn't have every top and second level domain. I came up with there's about 500 all together for all the countries. So looking at whois at just those popular one's they have there, this falls way short. Sadly the registrars of all countries will not provide lists if beg or even pay them. (yes I tried) If need a whois script, this one works very well. http://www.phpwhois.org/ If planning on doing the entire world and have adequate servers piles of drives and bandwidth....I could help, I got the stuff to already do this but I just don't.
-
remove commas from search string and pass results to a query
QuickOldCar replied to XandarX's topic in PHP Coding Help
http://dev.mysql.com/doc/refman/5.5/en/fulltext-boolean.html It takes some work, and why most sites just have a simple search. But you should prob be looking into exact phrase, or can just add a + or - before each search word for include and exclude. So for the search word would be +faith +hill Comma's are usually not used in mysql for in the searches, maybe is a way to add it, but I wouldn't. I do have this clump of code I made, maybe will help, maybe not, but this is for a multiple search select. of course you don't have same values, also I have the start and stop rows to limit mysql for pagination. Just be sure to have the full text index made for each field or would be very slow. <?php $display = mysql_real_escape_string($_GET['display']); $order = mysql_real_escape_string($_GET['order']); $search_name = mysql_real_escape_string($_GET['search_name']); $search_words = mysql_real_escape_string($_GET['search_words']); //search get variables from search form if ($search_name == "first_begins_characters") { $result = mysql_query("SELECT * FROM users WHERE firstname LIKE '".$search_words."%' ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users WHERE firstname LIKE '".$search_words."%'"); } elseif ($search_name == "first_contains_characters") { $result = mysql_query("SELECT * FROM users WHERE firstname LIKE '%"."$search_words"."%' ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users WHERE firstname LIKE '%"."$search_words"."%'"); } elseif ($search_name == "last_begins_characters") { $result = mysql_query("SELECT * FROM users WHERE lastname LIKE '".$search_words."%' ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users WHERE lastname LIKE '".$search_words."%'"); } elseif ($search_name == "last_contains_characters") { $result = mysql_query("SELECT * FROM users WHERE lastname LIKE '%"."$search_words"."%' ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users WHERE lastname LIKE '%"."$search_words"."%'"); } elseif ($search_name == "all") { $result = mysql_query("SELECT * FROM users ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users"); } else { //if anything goes wrong above or nothing selected, this will be used as the default query instead $result = mysql_query("SELECT * FROM users ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users"); } ?> <form name="input" action="" method="get"> <?php if (!$_GET['display']) { $display = "firstname"; } ?> Display:<Select style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" name="display"> <option "Input" style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="<?php echo $display; ?>"><?php echo $display; ?></option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="firstname">firstname</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="lastname">lastname</option> </select> <?php if (!$_GET['order']) { $order = "ASC"; } ?> Order:<Select style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" name="order"> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="<?php echo $order; ?>"><?php echo $order; ?></option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="ASC">Ascending</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="DESC">Descending</option> </select> <?php if (!$_GET['search_name']) { $search = "all"; } ?> Search Type:<Select style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" name="search"> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="<?php echo $search; ?>"><?php echo $search; ?></option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="all">all</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="first_begins_characters">User Begins Character(s)</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="first_contains_characters">User Contains Character(s)</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="last_begins_characters">Last Begins Character(s)</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="last_contains_characters">Last Contains Character(s)</option> </select> <br /> Search Word(s) or Char(s):<input size="40"type="text" name="search_words" style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="<?php echo $_GET['search_words']; ?>"> <input type="submit" style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="Search Name" /> </form> -
You need to check them like this and then use the proper imagecreatefrom. $ext = substr($image_source, strripos($image_source, '.'),strlen($image_source)); if($ext=='.jpg' || $ext=='.jpeg'){ $image = imagecreatefromjpeg($image_source); } if($ext=='.gif'){ $image = imagecreatefromgif($image_source); } if($ext=='.png'){ $image = imagecreatefrompng($image_source); } if ($ext != ".jpg" || $ext != ".jpeg" || $ext != ".gif" || $ext != ".png") { die("<h2>$ext not allowed</h2><br /> <a href=\"javascript: history.go(-1)\">Click here to try again</a>"); }
-
It's probably more that the new server has error reporting disabled. It's more likely in your code itself because you can be checking what the mime should be...then of those results then do a case for any imagecreatefrom, then also a case for the output of that exact mime type as well. Look here , you are trying to create from a jpeg image when actually it's a png image. Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'images/projects/porncheck_star.png' is not a valid JPEG file in /home/content/t/h/e/thereferralpro/html/beta/region.php on line 144
-
Or as noXstyle said, but instead of doing it in php.ini, you can do it for just that particular script if would like. Place this top of your code in your upload script. This is roughly 5 minutes. set_time_limit(300); max_execution_time(300);
-
I happened to notice a spelling mistake of yours. this: $commtest2=strpos($subt1, $comm); if($comtest2!=false){ should probably be: $commtest2=strpos($subt1, $comm); if($commtest2 != false){ was missing an m in $commtest2
-
mysql_query missing //Connect to database mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error()); mysql_select_db($dbname) or die(mysql_error()); session_start(); $username = $_POST[‘username’]; $password = $_POST[‘password’]; $query = mysql_query(“select * from users where username=’$username’ and password=’$password’”); $result = mysql_query($query); if (mysql_num_rows($result) != 1) { $error = “Bad Login”; include “login.html”; } else { $_SESSION[‘username’] = “$username”; include “memberspage.php”; } ?>
-
Made this up just for you and tested it even. <?php function checkLiveMp3($url){ $context = stream_context_create(array( 'http' => array( 'timeout' => 1 ) )); $the_contents = @file_get_contents($url, 0, $context); if (empty($the_contents)) { echo "$url is Dead<br />"; echo "Insert some code here for an error or other code.<br />"; echo "<br /><hr>"; } else { $mp3_check = substr("$url", -4); if ($mp3_check != ".mp3") { echo "$url is alive but not mp3 file<br />"; echo "Insert some code here for an error or other code.<br />"; echo "<br /><hr>"; } else { echo "Alive and mp3 file<br />"; echo "Insert some code here so some music can play.<br />"; echo "Mp3: <a href='$url'>$url</a>"; echo "<br /><hr>"; } } } ?> <?php //Usage $url = "http://www.wyntonmarsalis.org/audio/tribute/wyntonstribute.mp3"; checkLiveMp3($url); checkLiveMp3("http://somesite.com/something.jpg"); checkLiveMp3("http://www.sotone.com/samples/!2-Shapiro_Brahms.1st.mvmt.mp3"); ?>
-
I wrapped the final_location in quotes. <?php $timestamp = time(); $tbl_name="guestbook"; // Table name $email = $_REQUEST["email"]; $name = $_REQUEST["name"]; $comment = $_REQUEST["comment"]; $datetime = date("dmy"); $uploaddir = "upload/"; $filename = $timestamp.$_FILES['file']['name']; $filename = strtolower($filename); $final_location = "$uploaddir$filename"; $pathinfo = pathinfo($_FILES['userfile1']['name']);//not sure what doing with this if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 2000000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $filename . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />"; if (file_exists($final_location)) { echo $filename . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], $final_location); echo "Stored in: " . $final_location . "<br>"; mysql_connect("$host", "$username", "$password")or die("cannot connect server "); mysql_select_db("$db_name")or die("cannot select DB"); //not saving the filename to database? wondering why this was here for an image upload form //I stuck this here if wanted to save the images if image was accepted, if not just move down below $sql="INSERT INTO $tbl_name(name, email, comment, datetime)VALUES('$name', '$email', '$comment', '$datetime')"; $result=mysql_query($sql); } } } else { echo "Invalid file"; } if($result){ echo "Successful added update to the Melody Bear Bulletin Board"; echo "<BR>"; echo "<a href='ViewBulletinBoard.php'>View Bulletin Board</a>"; } else { echo "ERROR"; } mysql_close(); ?>
-
I changed a bit of this for you, one thing I do not understand is why that insert query has nothing to do with the code. That for something else? Are you planning on using the query to save the image locations and just didn't get to that part? <?php $timestamp = time(); $tbl_name="guestbook"; // Table name $email = $_REQUEST["email"]; $name = $_REQUEST["name"]; $comment = $_REQUEST["comment"]; $datetime = date("dmy"); $uploaddir = "upload/"; $filename = $timestamp.$_FILES['file']['name']; $filename = strtolower($filename); $final_location = $uploaddir$filename; $pathinfo = pathinfo($_FILES['userfile1']['name']); if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 2000000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $filename . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />"; if (file_exists($final_location)) { echo $filename . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], $final_location); echo "Stored in: " . $final_location . "<br>"; mysql_connect("$host", "$username", "$password")or die("cannot connect server "); mysql_select_db("$db_name")or die("cannot select DB"); //not saving the filename to database? wondering why this was here for an image upload form $sql="INSERT INTO $tbl_name(name, email, comment, datetime)VALUES('$name', '$email', '$comment', '$datetime')"; $result=mysql_query($sql); } } } else { echo "Invalid file"; } if($result){ echo "Successful added update to the Melody Bear Bulletin Board"; echo "<BR>"; echo "<a href='ViewBulletinBoard.php'>View Bulletin Board</a>"; } else { echo "ERROR"; } mysql_close(); ?>
-
I don't fully understand the question, do you mean how can you also search emails and such as well? If so show both your current codes for the form and also the php select page.
-
If had any whatsoever code and were doing it with gd, I would be able to help. But what you are planning takes quite a bit of code to be done correctly. When comes to cropping, it's different for so many images as to width and height, so gotta ask...how could anything know from some random image where to crop it from and whats the way the user wants. Maybe you don't actually mean crop, but a width or height set at a certain maximum dimension? My best suggestion is to try phpthumb, it can generate the desired thumbs/resized images for you and save them into a cache folder. http://phpthumb.sourceforge.net/
-
I came back and looked at the code more too, why not try like this. <?php include '../script/database.php';//locate the database $conn = dbConnect(); if (!$conn) die("Could not connect to the database."); $query = "SELECT * FROM User WHERE name LIKE '".$search_words."%' ORDER BY name ASC" ); // my query to display the necessary fields $result = mysql_query ($query, $conn); // get results by running the query while ($row = mysql_fetch_row($result)) //use loop to get the results { $name = $row['name']; $login_id = $row['login_id']; $password = $row['password'];//really want to display passwords? $email = $row['email']; ?> <td><?php echo $name;?></td> <td><?php echo $login_id;?></td> <td><?php echo $password;?></td> <td><?php echo $email;?></td> </tr> <?php } dbDisconnect($conn); // to disconnect database ?> </table> So this is it no limits or pagination, I really don't know the rest of your page coding or the way using this, but this should at least show you some results and work so can work with it. Naturally if there are no search words inserted there would be no results, is why i did the if and else statements for the query in the first code I wrote.
-
Change this $query = "SELECT * FROM User WHERE name LIKE '".$search_words."%' UNION SELECT name,login_id,password, email FROM User ORDER BY name ASC "; to this $query = "SELECT * FROM User WHERE name LIKE '".$search_words."%' ORDER BY name ASC LIMIT $startrow,$posts_per_page" ); And you should certainly be limiting these results, and is why I left the limit in the query, If have any type pagination use your values there for where to start the row for mysql and where to stop.
-
Well to sum it up in easy terms. Make a form. Have the form perform a mysql select query by connecting to your database. In the select are additional words as LIKE,MATCH,against, Boolean mode for full text searches that require full text indexing on the fields wanted to search on the tables. % is used in front, after or around the search terms depending on how would like to search the words, as in from the first characters, within the word and so on. This may help http://www.joedolson.com/Search-Engine-in-PHP-MySQL.php Or from mysql boolean mode search http://dev.mysql.com/doc/refman/5.1/en/fulltext-boolean.html or maybe this clump of code I just made up the other day, this is just to give an idea, and also mine is kinda unique because I did it multi-selects and for different type searches. For you to try and integrate this would require your database connect information, and also add the values of the query selects to suit your needs. The display of the query results and should have some sort of pagination as well. Don't forget to also close the connection at the end. <?php $display = mysql_real_escape_string($_GET['display']); $order = mysql_real_escape_string($_GET['order']); $search_name = mysql_real_escape_string($_GET['search_name']); $search_words = mysql_real_escape_string($_GET['search_words']); //search get variables from search form if ($search_name == "first_begins_characters") { $result = mysql_query("SELECT * FROM users WHERE firstname LIKE '".$search_words."%' ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users WHERE firstname LIKE '".$search_words."%'"); } elseif ($search_name == "first_contains_characters") { $result = mysql_query("SELECT * FROM users WHERE firstname LIKE '%"."$search_words"."%' ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users WHERE firstname LIKE '%"."$search_words"."%'"); } elseif ($search_name == "last_begins_characters") { $result = mysql_query("SELECT * FROM users WHERE lastname LIKE '".$search_words."%' ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users WHERE lastname LIKE '".$search_words."%'"); } elseif ($search_name == "last_contains_characters") { $result = mysql_query("SELECT * FROM users WHERE lastname LIKE '%"."$search_words"."%' ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users WHERE lastname LIKE '%"."$search_words"."%'"); } elseif ($search_name == "all") { $result = mysql_query("SELECT * FROM users ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users"); } else { //if anything goes wrong above or nothing selected, this will be used as the default query instead $result = mysql_query("SELECT * FROM users ORDER BY $display $order LIMIT $startrow,$posts_per_page" ); $total_count = mysql_query("SELECT * FROM users"); } ?> <form name="input" action="" method="get"> <?php if (!$_GET['display']) { $display = "firstname"; } ?> Display:<Select style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" name="display"> <option "Input" style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="<?php echo $display; ?>"><?php echo $display; ?></option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="firstname">firstname</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="lastname">lastname</option> </select> <?php if (!$_GET['order']) { $order = "ASC"; } ?> Order:<Select style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" name="order"> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="<?php echo $order; ?>"><?php echo $order; ?></option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="ASC">Ascending</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="DESC">Descending</option> </select> <?php if (!$_GET['search_name']) { $search = "all"; } ?> Search Type:<Select style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" name="search"> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="<?php echo $search; ?>"><?php echo $search; ?></option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="all">all</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="first_begins_characters">User Begins Character(s)</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="first_contains_characters">User Contains Character(s)</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="last_begins_characters">Last Begins Character(s)</option> <option style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="last_contains_characters">Last Contains Character(s)</option> </select> <br /> Search Word(s) or Char(s):<input size="40"type="text" name="search_words" style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="<?php echo $_GET['search_words']; ?>"> <input type="submit" style="color: #FFFFFF; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #000000;" size="15" value="Search Name" /> </form>
-
Another thought, That's where a popular phrase holds true. 300 to 400 milliseconds = the blink of a human eye
-
I think 5 centiseconds is pretty fast already.
-
You can try this. http://www.phpf1.com/manual/curl-multi-exec.html Here's what I did... I have lists of url's in text files, I made a single page which has the curl code and mysql update or insert statements (yeah I do a check because I only want one and no duplicates). It will call to the text file, get the top url, use it, and delete that top url from the list. Connects to the site, grabs the info if alive and inserts. At the end of the script I simply do a meta refresh of how many seconds I would like to delay the process. The way I do it...you could also run as many instances you would like, and also on as many servers as would want. I started out doing say 20 simultaneous instances with a 1 second refresh. But now I add images so I set it slower to also have the image available just after the post is published. But that's just me, I'm in no hurry. So lets say you really want to make a search engine.....I can easily see you using a single curl to get the correct pages, then maybe simple html dom to parse the pages for additional links, get the titles or w/e and the href of each links(save to db), then also save those discovered links into a text files as well for the future crawling. Number the text files 1.txt, 2.txt, 3.txt, etc. Trim any white spaces and blank lines for the text files, can even remove any duplicate url's. Have in your curl code for the url insertion if 1.txt is empty then 2.txt be used and onward, at the end can just redirect the code to some empty page. so doesn't have to keep running in a loop. Anyway, this is the system I've come up with and used for a year now, seems to work pretty good. if search engines were fast and easy to do, would be a ton more of them out there, it just takes time to connect to these.
-
Yeah I know what you mean. Here's with a border and some text. http://get.blogdns.com/thumb-create.php?size=400&rotate=0&text=Dynaindex.com&textsize=10&textcolor=aqua&crop=1.1&bordermargin=0&borderwidth=14&bordercolor=pink&imgsource=http://glamouredited.com/howtos/sexylegs/how-get-sexy-legs-Paris.jpg But really for a nicer effect I think be better to get an image of a polaroid outline (with no center area), and resize the image inside the polaroid border, basically merging the 2 images as one, but the polaroid lays on top after. Here is a basic tutorial on how to add borders, it just a matter of using imageline() and colors. http://www.roseindia.net/tutorial/php/phpgd/About-AddBorder.html Is some useful other tutorials there for GD also.
-
For something simple as adding all the values of an array. <?php $cash_array = array(234,34,876,21,21,324); foreach ($cash_array as $cash) { $total_cash = array_sum($cash_array); } echo "Total cash = ".$total_cash."<br>"; ?> I suppose if need to show the process can make $cash into a new array as $cash[] and in a loop do a $cash + $cash, is just like doing regular math. I believe $CurrentCash is already the array. $cash[]