[PHP] putting variables in a variable
Hi, I am making and HTML email. I have 3 images to put in. Currently I have $body .= table tr tdimg src=\image1.jpg\/td /tr tr td/td /tr /table ; ideally I would like to have $myimage1 = image1.jpg; $myimage2 = image2.jpg; $myimage3 = image3.jpg; and put them into the HTML body variable. I have tried escaping them in every way i can think of, dots and slashes and the rest. Any ideas? Ross -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP ide?
Just wondering if anyone uses an IDE and if so what ones? Ta, H. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] isodd() php5?
Hi, Is there a built in function in PHP5 to determine if an integer is even or odd? Ross -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] moving over to php 5
Hi, It is about time I made the jump to 5, however the only thing that is holding me back is the problem with hosts. How many hosts still run php 4 and am I going to have to spend hours and hours persuading them to upgrade before I can run my code? I have very little time as it is and am anxious that this is going to be swallowed up on the phone to hosing companies and their rubbish technical staff. Please let me know if I will find this an easy transition or should I hold off for now. R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] what is the point of prepare?
Hi, Begining using the php5 mysql functions and want to know what is the point of preparing/binding the data before I insert it? $prep = $mysqli-prepare (INSERT INTO cd (cdid,title,artist) VALUES ('0',?,?)); $prep-bind_param ('22',$title,$artist); Ta, R.
[PHP] problem with bind_param
Hi, I am still having poblems with the php5 functions. I have 4 variables in each. What is the problem? Warning: mysqli_stmt::bind_param() [function.mysqli-stmt-bind-param]: Number of elements in type definition string doesn't match number of bind variables in on line 21 $prep = $mysqli-prepare (UPDATE events SET title=?, date=?, content=?, imageUrl=?); $prep-bind_param ( $_POST['title'], $_POST['date'], $_POST['content'], $_POST['imageUrl']); thanks, H. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with download script on safari and ie 7
The problem I am getting is safari just downloads the .php file. IE7 corrupts the binary file. It opens fine on FF and IE6. Is this a headers problem? Thanks, R. ?php if(isset($_GET['id'])) { $id= $_GET['id']; $query = SELECT file_name, type, size, content FROM results WHERE id = '$id'; $result = mysql_query($query) or die(mysql_error());; list($file_name, $type, $size, $content) = mysql_fetch_array($result); /*echo $file_name; echo $type; echo $size;*/ header(Content-Type: $type); header(Content-Disposition: attachment; filename=$file_name); header(Content-Length: .filesize($file)); header(Accept-Ranges: bytes); header(Pragma: no-cache); header(Expires: 0); header(Cache-Control: must-revalidate, post-check=0, pre-check=0); header(Content-transfer-encoding: binary); echo $content; exit; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: problem with download script on safari and ie 7
I changes it now so it is... header('Content-Type: application/octet-stream'); header(Content-Disposition: attachment; filename=$file_name); echo $content; exit; Which works on ie7 but safari still downloads the .php R. Hulf [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] The problem I am getting is safari just downloads the .php file. IE7 corrupts the binary file. It opens fine on FF and IE6. Is this a headers problem? Thanks, R. ?php if(isset($_GET['id'])) { $id= $_GET['id']; $query = SELECT file_name, type, size, content FROM results WHERE id = '$id'; $result = mysql_query($query) or die(mysql_error());; list($file_name, $type, $size, $content) = mysql_fetch_array($result); /*echo $file_name; echo $type; echo $size;*/ header(Content-Type: $type); header(Content-Disposition: attachment; filename=$file_name); header(Content-Length: .filesize($file)); header(Accept-Ranges: bytes); header(Pragma: no-cache); header(Expires: 0); header(Cache-Control: must-revalidate, post-check=0, pre-check=0); header(Content-transfer-encoding: binary); echo $content; exit; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problems with donwload
Under the results there are 3 files to download. Some users are getting an uable to read or corrupt message. http://vps.aztechost.co.uk/~trisco/index.php and 3 here http://vps.aztechost.co.uk/~trisco/rankings.php The upload script is similar if(isset($_POST['_upload']) $_FILES['userfile']['size'] 0) { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; $fp = fopen($tmpName, 'r'); $content = fread($fp, filesize($tmpName)); $content = addslashes($content); fclose($fp); if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); } $id= $_POST['id']; /*$query = UPDATE results SET title='$title', file_name='$fileName', size='$fileSize', type='$fileType', content='$content', last_updated=CURDATE() WHERE id=$id;*/ $query =INSERT INTO results (title, content, file_name, size, type, last_updated) VALUES ('$title', '$content', '$fileName', '$fileSize', '$fileType', CURDATE()); mysql_query($query); echo mysql_error(); } and the download ?php if(isset($_GET['id'])) { // if id is set then get the file with the id from database include(/home/trisco/public_html/secure/scripts/connect.php); $id= $_GET['id']; $query = SELECT file_name, type, size, content FROM results WHERE id = '$id'; $result = mysql_query($query) or die(mysql_error());; list($file_name, $type, $size, $content) = mysql_fetch_array($result); /*echo $file_name; echo $type; echo $size;*/ header(Content-Type: $type); header(Content-Disposition: attachment; filename=$file_name); header(Content-Length: .filesize($file)); header(Accept-Ranges: bytes); header(Pragma: no-cache); header(Expires: 0); header(Cache-Control: must-revalidate, post-check=0, pre-check=0); header(Content-transfer-encoding: binary); echo $content; exit; } ? I can open them on my desktop and laptop. Any clue why this is happening? Permissions? Thanks, R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php downlaod script
My download script only gives me empty (0kb) xls files. They are being uploaded as blobs and seem ok. Can someone shed some light on why the downoad is not working. Many Thanks, R. ?php if(isset($_GET['id'])) { // if id is set then get the file with the id from database $id= $_GET['id']; $query = SELECT id, file_name, size, type, content FROM results WHERE id = '$id'; $result = mysql_query($query) or die(mysql_error()); list($id, $file_name, $type, $size, $content) = mysql_fetch_array($result); header(Content-Type: application/vnd.ms-excel); header(Content-Disposition: attachment; filename=$file_name); header(Content-Length: .filesize($size)); header(Accept-Ranges: bytes); header(Pragma: no-cache); header(Expires: 0); header(Cache-Control: must-revalidate, post-check=0, pre-check=0); header(Content-transfer-encoding: binary); exit; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] scaling images
I have images of varying sizes. I want them to be scaled prior to upload to a set size of 300 x 200 px $imageinfo = getimagesize($_FILES['userfile']['tmp_name']); $ix=$imageinfo[0]; $iy=$imageinfo[1]; //upload the images script I -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: scaling images
Sorry my message was cut off. Yes I want to scale to 300 x 200px before I upload the image to my folder. Here is my code so far. thanks, H. $imageinfo = getimagesize($_FILES['userfile']['tmp_name']); echo $x=$imageinfo[0]; echo $y=$imageinfo[1]; $newwidth = 300; $newheight = 200; // Load $thumb = imagecreatetruecolor($newwidth, $newheight); $source = imagecreatefromjpeg($_FILES['userfile']['tmp_name']); // Resize imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // Output $myimage = imagejpeg($thumb); $target_path = ../property_images/$property_id/.basename( $_FILES['userfile']['name']); $img_url= $property_id./.basename( $_FILES['userfile']['name']); if(move_uploaded_file($myimage, $target_path)) { /* echo The file . basename( $_FILES['userfile']['name']). has been uploaded;*/ } else{ echo There was an error uploading the file, please try again!; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] scaling and uploading the pt 2
This is the full code so far. The files are saving but they are not resizing. Can anyone help? I need to get this $myimage = imagejpeg($thumb); into $target_path directory. H. -- if(isset($_POST['_upload']) $_FILES['userfile']['size'] 0) { $imageinfo = getimagesize($_FILES['userfile']['tmp_name']); echo $width=$imageinfo[0]; echo $height=$imageinfo[1]; $newwidth = 300; $newheight = 200; // Load $thumb = imagecreatetruecolor($newwidth, $newheight); $source = imagecreatefromjpeg($_FILES['userfile']['tmp_name']); // Resize $myimage = imagecopyresized($thumb, $source, 0, 0, 0, 0, 300, 200, $width, $height); // Output $myimage = imagejpeg($thumb); $target_path = ../property_images/$property_id/.basename( $_FILES['userfile']['name']); $img_url= $property_id./.basename( $_FILES['userfile']['name']); if(move_uploaded_file($_FILES['userfile']['tmp_name'], $target_path)) { /* echo The file . basename( $_FILES['userfile']['name']). has been uploaded;*/ } else{ echo There was an error uploading the file, please try again!; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ptting the variable inside the input
This does not work echo $title=$row['title']; echo trtdinput name=\title\ type=\text\ value=\$title\ //td; Ta, R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] for loop inside a switch
Hi, switch ($q) { for ($i=0; $i 21; $i++) { case 'faq$i': echo $faq1; break; } } I just want to loop out a big long list of cases. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php SHOW
Is there a way to output my data and tables using a php version of SHOW? Doesn't have to be pretty HTML just output to screen Ta, R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] output the schema
Hi, I reword my last post. I want to take the result and generate the field info to the screen e.g id, int(10) name, varchar(30) age, varchar(30). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php SHOW
I mean get the schema. Hulf [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is there a way to output my data and tables using a php version of SHOW? Doesn't have to be pretty HTML just output to screen Ta, R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] if inside an echo.
I am outputting a selectbox and want to do the follwoing. How can I add the IF statement inside the the echo? for ($value = 0; $value = 2000; $value += 100) { echo option value=\$value\ if ($min_rent==$value) {echo selected=selected } $value/option; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php