Jump to content

brooksh

Members
  • Posts

    139
  • Joined

  • Last visited

Everything posted by brooksh

  1. Here is my script. Can anyone tell me what I'm doing wrong? $dw = 640; $prop = ($oldimagesize[0]/$dw); $dh = ($oldimagesize[1]/$prop); $sw = $oldimagesize[0]; $sh = $oldimagesize[1]; $largeimagename = 'large_' . $newimagename; $largeimagefull = $uploadDir . $largeimagename; $largeimage = imagecreatetruecolor($dw, $dh); imagecopyresampled($largeimage, $oldimage, 0, 0, 0, 0, $dw, $dh, $sw, $sh); $watermark = imagecreatefrompng('/home/photos/public_html/images/watermark.png'); $watermark_width = imagesx($watermark); $watermark_height = imagesy($watermark); $largeimage = imagecreatefromjpeg($largeimage); $size = getimagesize($largeimage); $dest_x = $size[0] - $watermark_width - 5; $dest_y = $size[1] - $watermark_height - 5; imagecopymerge($largeimage, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100); imagedestroy($watermark); call_user_func("image" . $imageTypes[$oldimagesize[2]], $largeimage, $largeimagefull);
  2. I created a support ticket system that emails me when someone starts a new support ticket. When I reply, I would like it to also post into my mysql database based on the ticket number found in the subject. What is this called, and how can it be done?
  3. I'm not sure why this isn't working. I am selecting multiple checkboxes, and having the next step search based on those selections. The first step I select States and want to find out counties associated with the states selected. But it doesn't work. for( $i=0; $i<count($_POST['State']); $i++ ) { $State1 .= $_POST['State'][$i] . ","; } $str_temp_len=strlen($State1); $State1=substr($State1,0,($str_temp_len-1)); $sql = "select DISTINCT county from zip_codes where state_prefix = '$State1' order by county"; $result = mysql_query ($sql);
  4. I am running php 4.3 and I don't know if that's why I'm getting this error. Warning: join() [function.join]: Bad arguments.
  5. How can this be accomplished? I know the code below is completely unrealistic, but how can it be done? SELECT DISTINCT City FROM listings WHERE area = 'array($_POST[area])' order by City
  6. This is the sql $sql = "SELECT imagename FROM images WHERE id = '$id' order by imagename";
  7. I am trying to sort my images by file name, but it is out of place. How can I sort it in order? This is how it sorts, how can I change it to go from 1-12? image_1.jpg image_10.jpg image_11.jpg image_12.jpg image_2.jpg image_3.jpg image_4.jpg image_5.jpg image_6.jpg image_7.jpg image_8.jpg image_9.jpg
  8. How could I do that? I tried fopen ($file[0], "r"); and I tried echo $file[0];
  9. sorry but it didn't work, and I did not get any errors.
  10. I'm trying to import my csv but how do I tell it that it is ENCLOSED BY '\"' and LINES TERMINATED BY '\r\n' My CSV looks like this //line1 "OfficeID","Name","Phone","Extension","Address","City","State","Zip Code","Country","Fax Number","Email Address","URL","Short ID" //line2 1,"Exact","789-9400","","Aleshia, 421 Oak","City","State","33333","","838-2117","","","ext" //line3 2,"Martin","667-9800","","5 South Washington","City","State","33333","","456-8201","","","MPR" Here is my code, but because the first line is enclosed with "" and the lines there after are enclosed with " it messes up. $file = "file.csv"; $tbl = "organizations"; $handle = fopen ($file, "r"); mysql_query($sql); while (!feof ($handle)) { $line = fgets($handle, 1000); list($OfficeID,$Name,$Phone,$Extension,$Address,$City,$State,$Zip,$Country,$Fax,$Email,$URL,$ShortID) = split("'","\'",$line); $sql = "insert into $tbl (OfficeID,Name,Phone,Extension,Address,City,State,Zip,Country,Fax,Email,URL,ShortID) values ('$OfficeID', '$Name', '$Phone', '$Extension', '$Address', '$City', '$State', '$Zip', '$Country', '$Fax', '$Email', '$URL', '$ShortID')"; mysql_query($sql); }
  11. Doesn't seem to work for me. I'm running PHP 4.3 I got these two errors Warning: Unexpected character in input: '\' (ASCII=92) state=1 Parse error: syntax error, unexpected T_STRING, expecting '}'
  12. I would like to display each city in the database from every state in the US. table 1 "state - CA, cities - Los Angeles, San Jose, San Francisco" table 2 "state - WA, cities - Olympia, Seattle, Tacoma" Displayed as: Los Angeles Olympia San Jose San Francisco Seattle Tacoma
  13. I am trying to combine two different queries but I can only seem to get the first query to display. It only comes up with the first state. Here is my code. $sql = "SELECT DISTINCT state from cities where country = 'US' ORDER BY state"; $result = mysql_query ($sql); while($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { $state = $row[state]; $arr = array($state); reset($arr); while (list(, $value) = each($arr)) { } } foreach ($arr as $key => $value) { $sql = "SELECT cities from cities where country='US' AND state='$value'"; $result = mysql_query ($sql); while($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { $cities = $row[cities]; } }
  14. Thank you it works. $result = mysql_query($query); $cities = explode (',' , mysql_result($result, 0)); foreach ($cities as $city) { echo "$city<br/>"; }
  15. I know this should be something simple, but I can't figure it out. Can someone please help me? I have a table name cities with a field named cities that has "Austin,Los Angeles,New York,San Francisco,Seattle" I want to grab each city from the field and display it. Here is what I have, but it is obviously wrong. $query = "SELECT * FROM cities WHERE country='US'"; $result = mysql_query($query); $rows = mysql_num_rows($result); $i = 0; while ($i < $rows){ $cities = $rows[cities]; $cities = explode(",", $cities); $name = mysql_result($result, $i, "city"); echo "$name<br>"; $i++; }
  16. I am having a problem when using a php file as xml. php code will not work inside the { } Has anyone ever had this problem? <?php header("Content-type: text/xml"); echo '<?xml version="1.0" encoding="UTF-8"?>'; ?> <slideshow> <preferences backgroundColor="ffffff" showLoadingIcon="false" /> <?php $image1 = "2_3z6zfodn.jpg"; ### DB TO XML ################## // Connect to database include("config/config.inc.php"); include("config/function.inc.php"); $connection = db_connect(); mysql_select_db("database"); $listing_id = $_GET['listing_id']; $sql = "SELECT file_name FROM images WHERE listingid='".$listing_id."'"; $res = mysql_query($sql, $connection); $num = mysql_num_rows($res); echo '<album title="Title" description="Description">'; for ($x=0;($x < $num);$x=$x+1) { $array = mysql_fetch_array($res); echo '<img src="images/'.$array['file_name'].'"/>'; //this does not work echo '<img src="images/'.$image1.'"/>'; //this does not work echo '<img src="images/2_3z6zfodn.jpg"/>'; //this does not work } echo '<img src="images/2_3z6zfodn.jpg"/>'; //this works echo '<img src="images/'.$image1.'"/>'; //this works echo '</album>'; ################################ ?> </slideshow>
  17. Does anyone know of any good scripts that displays photos and zooms in and out, right to left, up to down, fading in and out? Here is an example of what I mean. http://www.realestateshows.com/show.php?id=0000211448&var=show&mls=basic
  18. This was my first thought, but each number has a "-" in it. I am just looking for some script out there that jumbles up the number.
  19. There are many encrypt and decrypt scripts out there. Some of them include a password so it is harder to decrypt. But I'm still looking for a script that will convert everything into a number. And yes base64 can be decrypted.
  20. It doesn't need to be secure at all. I just don't want a basic user to figure out the real number.
  21. Thanks, but is it possible to make $secure display only as a number?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.