PHP - Can Anyone Spot A Problem With This?
i always get:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '://www.webaddress.co.uk/images/shop/uploaded/index/', 'test', 'magazine', 'test' at line 1 $title = $_POST['title']; $index_image = 'http://www.webaddress.co.uk/images/shop/uploaded/index/'.$indexname; $content = mysql_real_escape_string($_POST['content']); $type = mysql_real_escape_string($_POST['type']); $price = mysql_real_escape_string($_POST['price']); $spread1 = 'http://www.webaddress.co.uk/images/shop/uploaded/spreads/'.$image1name; $spread2 = 'http://www.webaddress.co.uk/images/shop/uploaded/spreads/'.$image2name; $spread3 = 'http://www.webaddress.co.uk/images/shop/uploaded/spreads/'.$image3name; $paypal = mysql_real_escape_string($_POST['paypal']); $date = date("Y-m-d H:i:s"); if($title && $content && $type && $price){ $sql = "INSERT INTO `shop` (`title`, `indeximage`, `content`, `type`, `price`, `spread1`, `spread2`, `spread3`, `buyuk`, `live`, `date`) VALUES ('$title', $index_image', '$content', '$type', '$price', '$spread1', '$spread2', '$spread3', '$paypal', '1', '$date')"; $result=mysql_query($sql) or die(mysql_error()); Similar TutorialsCan anybody see where the error is he Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/.../functions.php on line 10 Code: [Select] <?php //Wall_Updates class Wall_Updates { // Updates public function Updates($uid) { $query = mysql_query("SELECT M.msg_id, M.uid_fk, M.message, M.created, U.username FROM messages M, users U WHERE M.uid_fk=U.uid and M.uid_fk='$uid' order by M.msg_id desc") or die(mysql_error()); while($row=mysql_fetch_array($query)) $data[]=$row; return $data; } I have only posted the first few lines of code becouse apparently the error should be before line 10? Please let me knwo if you need the full code Hi i'm trying to get out a sub string from multiple pages where i'm using a start point string that looks like this "(integer)" where "integer is different every time. Is there any way I can tell it that its just an integer there so if its "(3)" on one page and "(10)" on another page it will start from the same spot? Hello Everyone I`m new to PHP, therefore I would really appreciate any help with this code. The error message I get: SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where cid=B' at line 1 This is the function, I`m trying to use: function update_student_course($sid, $cid, $grade, $comments) { $esc_sid = mysql_real_escape_string($sid, $this->conn); $esc_cid = mysql_real_escape_string($cid, $this->conn); $esc_grade = mysql_real_escape_string($grade, $this->conn); $esc_comments = mysql_real_escape_string($comments, $this->conn); $sql = "UPDATE studentcourses set grade='{$esc_grade}', comments='{$esc_comments}' where sid={$esc_sid} and cid={$esc_cid}"; $result = mysql_query($sql, $this->conn); if (!$result) die("SQL Error: " . mysql_error()); else { $numofrows = mysql_affected_rows($this->conn); return $numofrows; } } And this would be the code: <?php $db1 = new student_course(); $db1->openDB(); $sql = "SELECT sid FROM STUDENTS"; $result1 = $db1->getResult($sql); $sql = "SELECT cid FROM COURSES"; $result2 = $db1->getResult($sql); if (!$_POST) { //page loads for the first time ?> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post"> Choose student ID: <select name = "sid"> <?php while ($row = mysql_fetch_array($result1)) echo "<option value='{$row['sid']}'>{$row['sid']}</option>"; ?> </select><br/> Choose course ID: <select name = "cid"> <?php while ($row = mysql_fetch_array($result2)) echo "<option value ='{$row['cid']}'>{$row['cid']} </option>"; ?> </select><br/> Enter grade to update: <input type="text" name="cid" /><br /> Enter new comment: <input type="text" name="cname" /><br /> <input type="submit" value="Update" /> </form> <?php } //end if else { $sid = $_POST['sid']; $cid = $_POST['cid']; $grade = $_POST['grade']; $comment = $_POST['comment']; $db1 = new student_course(); $db1->openDB(); $numofrows = $db1->update_student_course($sid, $cid, $grade, $comment); echo "Success. Number of rows affected: <strong>{$numofrows}<strong>"; $db1->closeDB(); } ?> Any idea, what am I doing wrong??? Server version: 5.1.41 Thank you very much in advance, for taking the time and reading it!!! layman I have directories containing images. If an Image called front.jpg exists then I want that to display - if it doesn't then I want it to display any random image from the directory. All the bits works individually. but for some reason, even when front.jpg exists - it still displays a random image from the else statement. Can you see an error? Code: [Select] $frontimage = "/hotelimages/". $img_dir . "/" . $front . $ext; ?> <div id="topframe"> <?php if (file_exists($frontimage)) {?><img src="/image.php?width=245&height=245&cropratio=1:1&image=/<?php echo $img_folder.$image ;?>" alt="<?php echo ucwords($row_rs_properties['est_name']);?>" class="fltrt" border="1"/><? ;} else { ?> <img src="/image.php?width=245&height=245&cropratio=1:1&image=<?php echo "/hotelimages/". $img_dir . "/" . $front . $ext; ?>" alt="<?php echo ucwords($row_rs_properties['est_name']);?>" class="fltrt" border="1"/> <?php ;} ?> </div> Hey all. another quick question. here is the output of my 2D array: Code: [Select] array(2) { ["folder.jpg"]=> array(2) { ["valid"]=> bool(true) ["error"]=> bool(false) } ["file.mp3"]=> array(2) { ["valid"]=> bool(true) ["error"]=> bool(false) } } how can i foreach my way into getting an iterator that points to the folder.jpg and file.mp3? as is now, i have something that looks like this: foreach($arr as $val){ var_dump($val) } the var_dump of $val is an *array*. Thanks for your help! Guys thanks for helping me solve the problem i had but now i have another problem and i am lost. i have included the code below for you to have overview.
This is the code:
<table style="width:100%; margin-left:auto; margin-right:auto"> so i want to call my php file with a query string to select a record out of a XML file... im close but cant get the variable i pass to be the record selected.. example... index.php?auction=1 i highlighted in red, where it doesnt pick up the proper row Code: [Select] <?php ini_set('display_errors', 1); error_reporting(E_ALL); $auction = $_GET{auction}; // parse the xml $xmlFileData = file_get_contents("items.xml"); $xmlData = new SimpleXMLElement($xmlFileData); [color=red]$location = $xmlData->item[$auction];[/color] //Retrieving the content from the selected item $title = $location->title; $value = $location->value; $itemnumber = $location->itemnumber; $description = $location->description; $donatedby = $location->donatedby; $image1 = $location->image1; $image2 = $location->image2; $image3 = $location->image3; $image4 = $location->image4; $image5 = $location->image5; $image6 = $location->image6; $image7 = $location->image7; $image8 = $location->image8; ?> <style> .itemimages img {width: 10px; height: 10px;} img.large {width: 100px; height: 100px;} </style> <script language="JavaScript" src="http://code.jquery.com/jquery-1.5.min.js" type="text/javascript"></script> <script> $().ready(function() { $(".itemimages img").click( $("#largepic").attr("src","this"); }); }); </script> <table border="1" cellpadding="10"> <tr> <td valign="top"> <img src="<?php echo $image1 ?>" alt="" border="0" class="large" id="largepic"><br> <div class="itemimages"> <?php // image 1 if (trim(''.$image1) != '') { echo "<img src='"; echo $image1; echo "' alt='' border='0'/> "; } // image 2 if (trim(''.$image2) != '') { echo "<img src='"; echo $image2; echo "' alt='' border='0'/> "; } // image 3 if (trim(''.$image3) != '') { echo "<img src='"; echo $image3; echo "' alt='' border='0'/> "; } // image 4 if (trim(''.$image4) != '') { echo "<img src='"; echo $image4; echo "' alt='' border='0'/> "; } // image 5 if (trim(''.$image5) != '') { echo "<img src='"; echo $image5; echo "' alt='' border='0'/> "; } // image 6 if (trim(''.$image6) != '') { echo "<img src='"; echo $image6; echo "' alt='' border='0'/> "; } // image 7 if (trim(''.$image7) != '') { echo "<img src='"; echo $image7; echo "' alt='' border='0'/> "; } // image 8 if (trim(''.$image8) != '') { echo "<img src='"; echo $image8; echo "' alt='' border='0'/> "; } ?> </div> </td> <td valign="top"> <?php echo $title ?><br> Estimated Value: <?php echo $value ?><br> Item Number: <?php echo $itemnumber ?><br><br> <?php echo $description ?><br><br> Donated by: <?php echo $donatedby ?><br> </td> </tr> </table> I am trying to understand PHP OOP and I have some code that is not working. here is the error code. Code: [Select] Parse error: parse error, expecting `T_FUNCTION' in C:\wamp\www\testing\armor_lib.php on line 11 And here is the armor_lib.php file: <?php class armor { // Head public $head; public $torso; public $pants; public $gloves; public $boots; // new stuff here class head extends armor { function __construct($head){ $this->set_head($head); } } // Torso class torso extends armor { function __construct($torso){ $this->set_torso($torso); } } // Pants class pants extends armor { function __construct($pants){ $this->set_pants($pants); } } // Gloves class gloves extends armor { function __construct($gloves){ $this->set_gloves($gloves); } } // Boots class boots extends armor { function __construct($boots){ $this->set_boots($boots); } } } ?> And here is the php in the armor.php file I have: <?php $head = new armor("Leather Helm"); $torso = new armor("Leather Shirt"); $pants = new armor("Leather Pants"); $gloves = new armor("Chain Mail Gloves"); $boots = new armor("Leather Boots"); echo "You are wearing: " . $head->get_head() . "on your Head"; echo "<br />"; echo "You are wearing: " . $torso->get_torso() . "on your Torso"; echo "<br />"; echo "You are wearing: " . $pants->get_pants() . "on your Legs"; echo "<br />"; echo "You are wearing: " . $gloves->get_gloves() . "on your Hands"; echo "<br />"; echo "You are wearing: " . $boots->get_boots() . "on your Feet"; ?> Any Help in understanding this will be much appreciated. Thanks. Hello everyone Just found this forum and really need some help. I'm trying to create a popup contact form for my product pages. I managed to get a php form from a random site and i cant get the form to pop up. http://www.e-sol.co.uk/printer-scanner-copier.php If someone could help i would be very grateful. Code: [Select] <?php require('config.php'); $sql = "SELECT m.Title as title , f.Reg_URL as reg FROM website_main as m JOIN website_front as f LIMIT 0,01 "; $result = @mysql_query($sql) or die(mysql_error()); echo "<table border='3'>"; echo "<font size='9'><tr> <th><FONT COLOR=red><center>Title</center></font></th> <th><FONT COLOR=red>reg</th> </tr></font>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table $reg = $row['reg']; echo "<tr><td bgcolor=''><center>"; echo $row['title']; echo "</td><td bgcolor=''><center>"; echo '.$reg.'; echo "</td></tr>"; } ?> I got a problem i try to use an attribute for $reg but only appears as .$reg. on website anyone know why? Parts i have problems with are $reg = $row['reg']; and echo '.$reg.';. thank you im making a website it works fine on firefox but on ie doesnt work correctly. page looks weird i see the error is <? include("index/index_files/front/php/include.php"); ?> anyone can help me its in a <html> tab. Hi there, I have a map of America made in flash, where you click on a state and the page should display the SQL database information for that state in the HTML table - but instead all it shows is the first entry of the database regardless of which state you click and it doesn't display the 2 radio buttons. My code is as follows Flash Actionscript 3 (just showing one state) Code: [Select] function waClick(event:MouseEvent):void { var waURL:URLRequest = new URLRequest("restaurants.php?state=Washington"); navigateToURL(waURL, "_self"); } wa_btn.addEventListener(MouseEvent.CLICK, waClick); PHP code Code: [Select] <?php include("mvfconnect.php"); $theChoice = $_GET['state']; $query = "SELECT * FROM restaurants WHERE" .$theChoice; $result = @ mysql_query($query); if (!$result) { $message="Unfortunately we are having problems with this page, we promise to have it fixed as soon as possible"; die($message); } $num = mysql_num_fields($result); $i=0; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){ $show1=substr($row['state'],0,50)."..."; $show2=substr($row['city'],0,50)."..."; $show3=substr($row['rname'],0,50)."..."; $show4=substr($row['address'],0,50)."..."; $show5=substr($row['pnum'],0,50)."..."; $show6=substr($row['web'],0,50)."..."; $show7=substr($row['dishes'],0,50)."..."; $show8=substr($row['dish_details'],0,50)."..."; $show9=substr($row['challenges'],0,50)."..."; $show10=substr($row['challenge_details'],0,50)."..."; $show11=substr($row['youtube'],0,50)."..."; $show12=substr($row['images'],0,50)."..."; echo "<tr>". "<td>".$row['city']."</td>". "<td>".$row['rname']."</td>". "<td>".$row['address']."</td>". "<td>".$row['pnum']."</td>". "<td>".$row['web']."</td>". "<td>".$row['dishes']."</td>". "<td>".$row['challenges']."</td>". "<td id='state".$i."' style='display:none'>".$row['state']."</td>". "<td id='city".$i."' style='display:none'>".$row['city']."</td>". "<td id='rname".$i."' style='display:none'>".$row['rname']."</td>". "<td id='address".$i."' style='display:none'>".$row['address']."</td>". "<td id='pnum".$i."' style='display:none'>".$row['pnum']."</td>". "<td id='web".$i."' style='display:none'>".$row['web']."</td>". "<td id='dishes".$i."' style='display:none'>".$row['dishes']."</td>". "<td id='dish_details".$i."' style='display:none'>".$row['dish_details']."</td>". "<td id='challenges".$i."' style='display:none'>".$row['challenges']."</td>". "<td id='challenge_details".$i."' style='display:none'>".$row['challenge_details']."</td>". "<td id='youtube".$i."' style='display:none'>".$row['youtube']."</td>". "<td id='images".$i."' style='display:none'>".$row['images']."</td>". "<td><input type='radio' name='vid' id='vid".$i."' onclick='openVideo(".$i.")' /></td>". "<td><input type='radio' name='pic' id='pic".$i."' onclick='openImage(".$i.")' /></td>". "<td class='last'style='display:none'>".$show1." ".$show2." ".$show3." ".$show4." ".$show5." ".$show6." ".$show7." ".$show8." ".$show9." ".$show10."</td>". "</tr>"; $i++; } ?> I have used this code before and it has worked fine, can someone please help me out! Hi I make 3 querys first Order by DESC, second RAND() and third ASC. Now I want that in the second query can't be the same ids (produgg_users.id) that already taken in the first. And in the third not the ids from first and second. Like I have it now the same users can show up in the RAND() and the ASC like in DESC. Here my Script so far: $rs = mysql_query("select produgg_users.id, twitterUser, credits from produgg_users where twitterUser != '' and produgg_users.id IN (select concat_ws(',', id) from produgg_users where credits > 0 and id != ".$usersClass->userID().") and produgg_users.id NOT IN (select concat_ws(',', followedID) from produgg_activity where followerID = '".$usersClass->userID()."') and produgg_users.id NOT IN (select concat_ws(',', userid) from produgg_featured) ORDER BY credits DESC LIMIT 10") or die(mysql_error()); $nr = @mysql_num_rows($rs); if($nr != 0) { print "<p>Simply click <strong>get 1 point</strong> and you will automatically FOLLOW the USER and earn the credit!</p>"; print "<p><font color=\"#0066FF\">Top Members</font></p>"; while($row=@mysql_fetch_object($rs)) { $divLeft = '<div id="thediv_'.$row->id.'"><div style="float:left;width:400px;">'; $divRight = '<div style="float:left;width:150px;">'; $clearDiv = '<div style="clear:both;"></div>'; print "$divLeft<img src=\"http://api.twitter.com/1/users/profile_image/".strip_tags($row->twitterUser)."?size=mini\" alt=\"\" /> ".strip_tags($row->twitterUser)." <font color=\"#999999\" size=\"1\">$row->credits Points</font></div>$divRight <a href='javascript:void(0);' id='vote_$row->id' class='getPoint'>Get 1 Point</a></div>$clearDiv<hr /></div>"; $z = 1; } } //Lucky Riders $rs = mysql_query("select produgg_users.id, twitterUser, credits from produgg_users where twitterUser != '' and produgg_users.id IN (select concat_ws(',', id) from produgg_users where credits > 0 and id != ".$usersClass->userID().") and produgg_users.id NOT IN (select concat_ws(',', followedID) from produgg_activity where followerID = '".$usersClass->userID()."') and produgg_users.id NOT IN (select concat_ws(',', userid) from produgg_featured) ORDER BY RAND() LIMIT 5") or die(mysql_error()); $nr = @mysql_num_rows($rs); if($nr != 0) { print "<p><font color=\"#0066FF\">Lucky Riders</font></p>"; while($row=@mysql_fetch_object($rs)) { $divLeft = '<div id="thediv_'.$row->id.'"><div style="float:left;width:400px;">'; $divRight = '<div style="float:left;width:150px;">'; $clearDiv = '<div style="clear:both;"></div>'; print "$divLeft<img src=\"http://api.twitter.com/1/users/profile_image/".strip_tags($row->twitterUser)."?size=mini\" alt=\"\" /> ".strip_tags($row->twitterUser)." <font color=\"#999999\" size=\"1\">$row->credits Points</font></div>$divRight <a href='javascript:void(0);' id='vote_$row->id' class='getPoint'>Get 1 Point</a></div>$clearDiv<hr /></div>"; $z = 1; } } //Lucky Riders $rs = mysql_query("select produgg_users.id, twitterUser, credits from produgg_users where twitterUser != '' and produgg_users.id IN (select concat_ws(',', id) from produgg_users where credits > 0 and id != ".$usersClass->userID().") and produgg_users.id NOT IN (select concat_ws(',', followedID) from produgg_activity where followerID = '".$usersClass->userID()."') and produgg_users.id NOT IN (select concat_ws(',', userid) from produgg_featured) ORDER BY credits ASC LIMIT 5") or die(mysql_error()); $nr = @mysql_num_rows($rs); if($nr != 0) { print "<p><font color=\"#0066FF\">Last Rides</font></p>"; while($row=@mysql_fetch_object($rs)) { $divLeft = '<div id="thediv_'.$row->id.'"><div style="float:left;width:400px;">'; $divRight = '<div style="float:left;width:150px;">'; $clearDiv = '<div style="clear:both;"></div>'; print "$divLeft<img src=\"http://api.twitter.com/1/users/profile_image/".strip_tags($row->twitterUser)."?size=mini\" alt=\"\" /> ".strip_tags($row->twitterUser)." <font color=\"#999999\" size=\"1\">$row->credits Points</font></div>$divRight <a href='javascript:void(0);' id='vote_$row->id' class='getPoint'>Get 1 Point</a></div>$clearDiv<hr /></div>"; $z = 1; } } i have written a script using touch() function for creating new pages.. but the url's appear are not search engine frendly i want the urls to appear like this everyspace filled with - oder than a space because the space makes the url display as http://localhost/gl/uploads/movies/2010/08/The%20Hangman%202010%20Hindi%20Movie%20Watch%20Online/The%20Hangman%202010%20Hindi%20Movie%20Watch%20Online.php I want it to appear this way http://www.onlinewatchmovies.net/hindi/vroom-2010-hindi-movie-watch-online.html any suggestion how can i do this? I have a simple text file called bio.txt: Code: [Select] wohlersr; Richie Wohlers; Intermediate; Four Aces meyersg; Greg Meyers; Novice; Four Aces I wrote a little script, to return the info for Greg Meyers if the user id is correct, or say "Member not found" if incorrect. For some reason, my output is giving me both. I assume it's a context error, but can't figure it out. Here's my script: Code: [Select] <?php $file=file("bio.txt"); $count=count($file); $i=0; while($i<=$count) { $row = explode(";", $file[$i]); $id = $row[0]; $name = $row[1]; $class = $row[2]; $club = $row[3]; if($id=="meyersg"){ echo $name."</br>"; echo $class."</br>"; echo $club."</br>"; }else{ echo "Member not found."; } $i++; } ?> And here's the output I'm getting: Code: [Select] Member not found. Greg Meyers Novice Four Aces Member not found. i'm getting this erro "Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /***/***/*****.php on line 278 not an active session, starts new" this is the code: if ($phase = mysql_result(mysql_query("SELECT `phase` FROM `as_support` WHERE `mission` = '$var2'"),0,0)) { if ($phase=='5') { // mysql_query("DELETE FROM `as_support` WHERE `mission` = '$var2'"); // header("Location: https://www.**********/*******/*******.php"); } else { echo date('h:i:s') . ": PHASE is $phase<br />"; echo "\$var1=$var1,\$var2=$var2<br />"; } } else { echo "not an active session, starts new<br />"; echo "\$var1=$var1,\$var2=$var2<br />"; mysql_query("INSERT INTO `as_support` (`mission`, `phase`) VALUES ('$var2', '0')") OR DIE(mysql_error()); the first line is line no. 278 can someone please tell me what to do? tnx shirley Hi. I am from poland. I am 17 old age and like webmastering. I write my social network. I have new server 10 GB VPS and my script no runing In my server. in my server do can not login. No runing function Code: [Select] mb_strtolower();as delete function mb_strtolower() ; this login runing. In my server haven`t installing liberary GD and no runing upload avatars. my code upload is: elseif ($_GET['act'] == "upload") { echo <<< KONIEC <hr> <center> <p> <h2>Dodaj zdjęcie</h2> <ul class="gallery clearfix"> <li class="extra"> KONIEC; error_reporting(E_ALL); // we first include the upload class, as we will need it here to deal with the uploaded file include('include/class.upload.php'); // retrieve eventual CLI parameters $cli = (isset($argc) && $argc > 1); if ($cli) { if (isset($argv[1])) $_GET['file'] = $argv[1]; if (isset($argv[2])) $_GET['dir'] = $argv[2]; if (isset($argv[3])) $_GET['pics'] = $argv[3]; } // set variables $dir_dest = (isset($_GET['dir']) ? $_GET['dir'] : 'test'); $dir_pics = (isset($_GET['pics']) ? $_GET['pics'] : $dir_dest); if (!$cli) { } // we have three forms on the test page, so we redirect accordingly if ((isset($_POST['action']) ? $_POST['action'] : (isset($_GET['action']) ? $_GET['action'] : '')) == 'simple') { // ---------- SIMPLE UPLOAD ---------- // we create an instance of the class, giving as argument the PHP object // corresponding to the file field from the form // All the uploads are accessible from the PHP object $_FILES $handle = new Upload($_FILES['my_field']); // then we check if the file has been uploaded properly // in its *temporary* location in the server (often, it is /tmp) if ($handle->uploaded) { // yes, the file is on the server // now, we start the upload 'process'. That is, to copy the uploaded file // from its temporary location to the wanted location // It could be something like $handle->Process('/home/www/my_uploads/'); $handle->Process($dir_dest); function TestProcess(&$handle, $title = 'test', $details='') { global $dir_pics, $dir_dest; $unlink = 'test/'. $handle->file_dst_name; $myid = $_SESSION['id']; $opis = htmlspecialchars(stripslashes(strip_tags(trim($_POST["opis"]))), ENT_QUOTES); $handle->Process($dir_dest); if ($handle->processed) { unlink("$unlink"); $link = ''.$dir_pics.'/' . $handle->file_dst_name .''; $addphoto = mysql_query("INSERT INTO photo VALUES('', '$myid', '$link', '$opis')"); echo <<< KONIEC <br> <center> <img src="$link" > <br> <br /> </center> KONIEC; } else { echo '<fieldset class="classuploadphp">'; echo ' <legend>' . $title . '</legend>'; echo ' Error: ' . $handle->error . ''; if ($details) echo ' <pre class="code php">' . htmlentities($details) . '</pre>'; echo '</fieldset>'; } } if (!file_exists($dir_dest)) mkdir($dir_dest); // ----------- $handle->image_convert = 'jpg'; $handle->image_resize = true; $handle->image_ratio_y = true; $handle->image_x = 500; $handle->image_precrop = 15; $handle->image_watermark = "watermark_large.png"; $handle->image_watermark_x = 20; $handle->image_watermark_y = -20; TestProcess($handle, '15px pre-cropping (before resizing 800 wide), large watermark automatically reduced, position 20 -20', "\$foo->image_convert = 'jpg';\n\$foo->image_resize = true;\n\$foo->image_ratio_y = true;\n\$foo->image_x = 800;\n\$foo->image_precrop = 15;\n\$foo->image_watermark = 'watermark_large.png';\n\$foo->image_watermark_x = 20;\n\$foo->image_watermark_y = -20;"); } else { // one error occured echo '<fieldset>'; echo ' <legend>file not uploaded to the wanted location</legend>'; echo ' Error: ' . $handle->error . ''; echo '</fieldset>'; } // we copy the file a second time // we delete the temporary files $handle-> Clean(); } else { // if we are here, the local file failed for some reasons echo '<fieldset>'; echo ' <legend>local file error</legend>'; echo ' Error: ' . $handle->error . ''; echo '</fieldset>'; } echo <<< KONIEC <li> </ul> </p> </center> KONIEC; is it the only problem that isn`t installing GD as i have something off in php.ini ? Plise Help me Hi, i use mysql_real_escape_string() function when insert in db, but when echo i use htmlentities($var, ENT_QUOTES, "UTF-8") Now problem is '\ in that text. In db it write text with single quote with \, example That\'s wrong, and when echo it show just the same like in db.. How can i fix this ? I am trying to use the following code snippet to return values from a database with a "," after each value apart form the last one. At the moment for testing I have 2 rows with values 1 and 3 $totalRows_Recordset3 equals 2 (I echoed this to check) $i=1; while($row_Recordset3 = mysql_fetch_assoc($Recordset3)) { if($i < $totalRows_Recordset3) { $str = $str.$row_Recordset3['reading'].","; $i=$i+1; } else { $str = $str.$row_Recordset3['reading']; $i=$i+1; } } I get the number 3 which is the last value in the database, but I can't see why I don't get "1,3" I am sure it is something simple but it just escapes me. Thanks in advance for any help Gordon Hi, I am trying to write in an existing excel file. But for some reason, I can't open the workbook (but I know I have made similar code work before). Here I am just pasting the code upto the error line $filename="C:\\apache\\htdocs\\GAC2\\dload\\template.xls"; $excel = new COM("excel.application") or die("Unable to instanciate excel"); $excel->Visible = 1; $excel->DisplayAlerts = 1; try{ $wkb = $excel->Workbooks->Open($filename); }catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } //........ Later part of the code This returns the following error Code: [Select] Caught exception: Source: Microsoft Office Excel Description: Unable to get the Open property of the Workbooks class For record, the I have already validated the file location. And I have tried the following line instead without any positive result. Code: [Select] $filename="C:\apache\htdocs\GAC2\dload\template.xls"; Looking for any help please. -Abd |