Re: [PHP] Passing var from one page to itself

2008-12-21 Thread kspal
hello, you can use session to store your variables between pages. Aslan a écrit : Hey there, I have a problem where I have a simple -script that I am wanting to pass back to itself three times 1) Symptoms - 2) Troubleshooting questions 3) Answer to problem The page is passing the vars

Re: [PHP] Image Resizing

2008-12-21 Thread Kevin Waterson
This one time, at band camp, Stephen Alistoun stephenalist...@gmail.com wrote: I want all the images to resize to 100px width but the height adjusts automatically. Two ways, GD or Imagick http://www.phpro.org/examples/GD-Thumbnail-Based-On-Image-Type.html

Re: [PHP] Image Resizing

2008-12-21 Thread Jason Paschal
i use imageMagick: ?php $image_path = ../images/myimage.jpg; //path to the image from my script $thumb_path = ../thumbnails/mymage.jpg;//path to where i want the thumbnail to be created $width = 100; //greatest allowed width for my thumbnails $height = 100; //greatest allowed

Re: [PHP] Passing var from one page to itself

2008-12-21 Thread Jason Paschal
also, you can store info in hidden form fields. on the 2nd page, populate the hidden fields with the data from the first page. when that form is submitted, the hidden field values will get submitted as well. that's not ideal, tho. if you have validation in place between the first and second

[PHP] Repeat Region Error

2008-12-21 Thread Gary Maddock-Greene
Hi All, I am getting the following error - Warning: mysql_fetch_assoc(): 3 is not a valid MySQL result resource in I think it has something to do with my Dreamweaver created code for a repeat region. The head code is: ?php if (!function_exists(GetSQLValueString)) { function

[PHP] Re: Repeat Region Error

2008-12-21 Thread Gary Maddock-Greene
Sorry guys .. resolved it doh! I was freeing the recordset in ?php mysql_free_result($rsSearch); ? -Gary Gary Maddock-Greene g...@maddock-greene.co.uk wrote in message news:5a.42.33998.4b83e...@pb1.pair.com... Hi All, I am getting the following error - Warning: mysql_fetch_assoc(): 3 is

Re: [PHP] Re: imap_rfc822_parse_adrlist problem

2008-12-21 Thread Ben Stuyts
Hi, On 21 dec 2008, at 03:41, Manuel Lemos wrote: on 12/20/2008 09:34 PM Ben Stuyts said the following: Hi, Since upgrading to php 5.2.8 I have a problem with imap_rfc822_parse_adrlist. When I run the example given on the manual page at http://nl3.php.net/imap_rfc822_parse_adrlist: ... So

Re: [PHP] Image Resizing

2008-12-21 Thread tedd
At 12:38 PM -0800 12/20/08, Stephen Alistoun wrote: Hi all, What is the best way in PHP to Resize an Image to a specific width. For Example I have images in the following sizes: (1) 200px width and 350px height (2) 125px width and 220px height (3) 166px width and 455px height I want all the

Re: [PHP] Image Resizing

2008-12-21 Thread Gary Maddock-Greene
nice post Tedd and useful web site :) -Gary tedd tedd.sperl...@gmail.com wrote in message news:p06240802c573f5a71...@[192.168.1.101]... At 12:38 PM -0800 12/20/08, Stephen Alistoun wrote: Hi all, What is the best way in PHP to Resize an Image to a specific width. For Example I have images

Re: [PHP] Passing var from one page to itself

2008-12-21 Thread tedd
At 4:10 PM +1300 12/21/08, Aslan wrote: Hey there, I have a problem where I have a simple -script that I am wanting to pass back to itself three times 1) Symptoms - 2) Troubleshooting questions 3) Answer to problem -snip- I have it currently all on one page, but it isn't quite what I was

[PHP] eof bof in php

2008-12-21 Thread Gary Maddock-Greene
Hi, I'm very new to php. Please can someone point me in the right direction? I want to display a message: 'No Products Found' if my search record set returns no value. I think I need to be looking at this section of my code ... $query_rsSearch = sprintf(SELECT * FROM products WHERE

Re: [PHP] eof bof in php

2008-12-21 Thread Ashley Sheridan
On Sun, 2008-12-21 at 15:22 +, Gary Maddock-Greene wrote: Hi, I'm very new to php. Please can someone point me in the right direction? I want to display a message: 'No Products Found' if my search record set returns no value. I think I need to be looking at this section of my code ...

Re: [PHP] eof bof in php

2008-12-21 Thread Gary Maddock-Greene
Thanks Ashley ... I have been trying that but I think my syntax id shot!! ?php if ($totalRows_rsSearch=0) echo Sorry no products were found; else echo h3Please click on a product for further information./h3 ? !-- Product block start search results -- ?php do { ? div

Re: [PHP] eof bof in php

2008-12-21 Thread Ashley Sheridan
On Sun, 2008-12-21 at 15:40 +, Gary Maddock-Greene wrote: Thanks Ashley ... I have been trying that but I think my syntax id shot!! ?php if ($totalRows_rsSearch=0) echo Sorry no products were found; else echo h3Please click on a product for further information./h3 ? !-- Product

Re: [PHP] eof bof in php

2008-12-21 Thread Gary Maddock-Greene
I have tried that but to no avail :) ?php if ($totalRows_rsSearch=0) echo Sorry no products were found; else // All seems OK to here, then the syntax error unexpected T_VARIABLE appears echo h3Please click on a product for further information./h3 ?php do { ? div class=productitemimg

Re: [PHP] eof bof in php

2008-12-21 Thread Ashley Sheridan
On Sun, 2008-12-21 at 16:22 +, Gary Maddock-Greene wrote: I have tried that but to no avail :) ?php if ($totalRows_rsSearch=0) echo Sorry no products were found; else // All seems OK to here, then the syntax error unexpected T_VARIABLE appears echo h3Please click on a

Re: [PHP] eof bof in php

2008-12-21 Thread Anthony Gentile
if (0 == $totalRows_rsSearch) { echo Sorry no products were found; } else Anthony Gentile On Sun, Dec 21, 2008 at 11:22 AM, Gary Maddock-Greene g...@maddock-greene.co.uk wrote: I have tried that but to no avail :) ?php if ($totalRows_rsSearch=0) echo Sorry no products were found; else

Re: [PHP] eof bof in php

2008-12-21 Thread Ashley Sheridan
On Sun, 2008-12-21 at 11:39 -0500, Anthony Gentile wrote: if (0 == $totalRows_rsSearch) { echo Sorry no products were found; } else Anthony Gentile On Sun, Dec 21, 2008 at 11:22 AM, Gary Maddock-Greene g...@maddock-greene.co.uk wrote: I have tried that but to no avail :)

[PHP] Create PHP form from MySQL table structure

2008-12-21 Thread R B MacGregor
Hi folks Anybody got any recommendations for a utility which would create a quick head start by creating the php/html code for a basic form using the field structure of a MySQL table ? Thanks for any suggestions. -- Ronnie MacGregor Scotland Ronnie at dBASEdeveloper dot co dot uk

Re: [PHP] Re: imap_rfc822_parse_adrlist problem

2008-12-21 Thread Manuel Lemos
Hello, on 12/21/2008 11:12 AM Ben Stuyts said the following: Since upgrading to php 5.2.8 I have a problem with imap_rfc822_parse_adrlist. When I run the example given on the manual page at http://nl3.php.net/imap_rfc822_parse_adrlist: ... So the host part isn't filled in correctly. I have

Re: [PHP] Create PHP form from MySQL table structure

2008-12-21 Thread tedd
At 10:35 AM + 12/21/08, R B MacGregor wrote: Hi folks Anybody got any recommendations for a utility which would create a quick head start by creating the php/html code for a basic form using the field structure of a MySQL table ? Thanks for any suggestions. -- Ronnie MacGregor Scotland

Re: [PHP] eof bof in php

2008-12-21 Thread Gary Maddock-Greene
Thanks guys .. I can get this part working great .. ?php if (0 == $totalRows_rsSearch) { echo h3Sorry no products were found/h3; } else echo h3Please click on a product for further information./h3 ? But I want to add the following so that only the products table appears when product are

Re: [PHP] Create PHP form from MySQL table structure

2008-12-21 Thread Bassel Safadi
On Sun, Dec 21, 2008 at 7:24 PM, tedd tedd.sperl...@gmail.com wrote: At 10:35 AM + 12/21/08, R B MacGregor wrote: Hi folks Anybody got any recommendations for a utility which would create a quick head start by creating the php/html code for a basic form using the field structure of a

Re: [PHP] eof bof in php

2008-12-21 Thread Anthony Gentile
...missing semicolon and some brackets. ?php if (0 == $totalRows_rsSearch) { echo h3Sorry no products were found/h3; } else { echo h3Please click on a product for further information./h3; } ? If there is more code you can show by perhaps pasting here: http://pastebin.redlinktech.com We can help

Re: [PHP] eof bof in php

2008-12-21 Thread Gary Maddock-Greene
I've corrected those errors thanks but how do I insert this code as the else statement? ?php do { ? div class=productitemimg src=products?php echo $row_rsSearch['product_image']; ? / div class=text h3?php echo $row_rsSearch['product_name']; ?/h3 p

Re: [PHP] eof bof in php

2008-12-21 Thread Anthony Gentile
?php if (0 == $totalRows_rsSearch) { echo h3Sorry no products were found/h3; } else { echo h3Please click on a product for further information./h3; while ($row_rsSearch = mysql_fetch_assoc($rsSearch)){ echo div class=\productitem\img src=\products\. $row_rsSearch['product_image']. div

Re: [PHP] eof bof in php

2008-12-21 Thread Anthony Gentile
err forgot the closing in img src=\products\. should look like img src=\products\. Anthony Gentile Cell: 704.657.8550 Diese E-Mail ist vertraulich. Wenn Sie nicht der rechtmaessige Empfaenger sind, duerfen Sie den Inhalt weder kopieren noch verbreiten oder benutzen. Sollten Sie diese E-Mail

Re: [PHP] eof bof in php

2008-12-21 Thread Gary Maddock-Greene
That's got it thanks Anthony. I love when you learn something. It was the back slash \ preceeding the 's in my html that I wasn't aware of. Now I know they are needed if using in your code. Thank you so much for your help. -- - Gary Maddock-Greene Anthony Gentile asgent...@gmail.com wrote

Re: [PHP] eof bof in php

2008-12-21 Thread Gary Maddock-Greene
thanks for the advice re html and php mashup!! I will research to find the way to do it outside the php. - Gary Maddock-Greene Anthony Gentile asgent...@gmail.com wrote in message news:2ce4207d0812211021g215d5346wb0afcedf039ef...@mail.gmail.com... ?php if (0 == $totalRows_rsSearch) { echo

[PHP] Re: Create PHP form from MySQL table structure

2008-12-21 Thread Al
R B MacGregor wrote: Hi folks Anybody got any recommendations for a utility which would create a quick head start by creating the php/html code for a basic form using the field structure of a MySQL table ? Thanks for any suggestions. Look at Pear HTML_QuickForm and other HTML classes.

Re: [PHP] eof bof in php

2008-12-21 Thread Gary Maddock-Greene
I guess you are right about mixing php with html. Actually the suggestion you gave breaks my search function. If I now search for a product called 'type 22' the space and first digit 2 breaks the serach. Also the \ in the htnl / php is causing a break in the image path urls ... so back to the

Re: [PHP] eof bof in php

2008-12-21 Thread Gary Maddock-Greene
I guess you are right about mixing php with html. Actually the suggestion you gave breaks my search function. If I now search for a product called 'type 22' the space and first digit 2 breaks the serach. Also the \ in the htnl / php is causing a break in the image path urls ... so back to the

[PHP] Variable as an index

2008-12-21 Thread MikeP
Hello, I am trying to output the value of the following:($x is an int incremented by a for statement. echo tr td width='110' bgcolor='$row_color' nowrap '$users[$x][U]'/td /tr; I have tried putting the quotes all over and all I get is: 'Array[U]'. What am I doing wrong. Thanks

Re: [PHP] Variable as an index

2008-12-21 Thread Marc Steinert
MikeP schrieb: I have tried putting the quotes all over and all I get is: 'Array[U]'. Try to avoid accessing the two-dimensional array $users inside a string. Use echo's ability to accept multiple parameters: echo 'trtd.', $users[$x]['U'], '/td'; Or by concating the string with

Re: [PHP] Variable as an index

2008-12-21 Thread German Geek
$users is an array and you are trying to simply put it in a string. $x seems to be undefined ergo it's not printing anything. If 'U' is the index in the array for your variable, use the '.' operator to concatenate strings: echo tr td width='110' bgcolor='$row_color' nowrap ' .

Re: [PHP] Variable as an index

2008-12-21 Thread German Geek
OK. I would think it uses more memory then, but doubt it would be slower. Isnt the output buffered in memory anyway though in PHP? Surely the buffer is bigger than 100 bytes (which is about the length of this string). So one way or the other, the memory is used. Tim-Hinnerk Heuer

Re: [PHP] Variable as an index

2008-12-21 Thread German Geek
Why is the first method faster and uses less memory? Tim-Hinnerk Heuer http://www.ihostnz.com On Mon, Dec 22, 2008 at 10:59 AM, Marc Steinert li...@bithub.net wrote: MikeP schrieb: I have tried putting the quotes all over and all I get is: 'Array[U]'. Try to avoid accessing the

Re: [PHP] Variable as an index

2008-12-21 Thread Marc Steinert
German Geek schrieb: Why is the first method faster and uses less memory? Because the concatenation operator first reassembles a new string, stores it in memory then passes this newly created string to the echo function, if I'm not misstaken. -- http://bithub.net/ Synchronize and share

Re: [PHP] Variable as an index

2008-12-21 Thread Anthony Gentile
for e.g. $var = 'world'; echo hello $var; vs echo 'hello '.$var; The first uses twice as many opcodes as compared to the second. The first is init a string and adding to it the first part(string) and then the second part (var); once completed it can echo it out. The second is simply two opcodes,

Re: [PHP] Replacing special characters with their HTML equivalents

2008-12-21 Thread Daniel Brown
On Sun, Dec 21, 2008 at 18:30, James Colannino ja...@colannino.org wrote: Hey everyone. I have a question. I have a web scraper that grabs information from web pages that often contain characters such as vowels with umlots (I know I spelled that wrong.) Welcome to the list, James.

Re: [PHP] Variable as an index

2008-12-21 Thread Anthony Gentile
True, it might mean the very slightest in milliseconds...depending on what you're doing/hardware. However, no harm in understanding the difference/how it works. Many will code echo Hello World and echo 'Hello World'; and never know the difference, I just happen to think being aware of the details

[PHP] Replacing special characters with their HTML equivalents

2008-12-21 Thread James Colannino
Hey everyone. I have a question. I have a web scraper that grabs information from web pages that often contain characters such as vowels with umlots (I know I spelled that wrong.) The data is editable, so the characters show up unmodified in an editable text box. However, when I try to import

Re: [PHP] Variable as an index

2008-12-21 Thread Chris
Anthony Gentile wrote: True, it might mean the very slightest in milliseconds...depending on what you're doing/hardware. Connecting to a db will (probably) take longer than most of those differences, let alone running a query processing the results. Ternaries that make a lot of people feel

Re: [PHP] Replacing special characters with their HTML equivalents

2008-12-21 Thread James Colannino
Daniel Brown wrote: Welcome to the list, James. Thanks :) Check out htmlentities(): http://php.net/htmlentities I'll check that out. James -- Black holes are where God divided by zero. --Steven Wright signature.asc Description: OpenPGP digital signature

Re: [PHP] Variable as an index

2008-12-21 Thread Chris
Anthony Gentile wrote: for e.g. $var = 'world'; echo hello $var; vs echo 'hello '.$var; The first uses twice as many opcodes as compared to the second. The first is init a string and adding to it the first part(string) and then the second part (var); once completed it can echo it out. The

Re: [PHP] Variable as an index

2008-12-21 Thread German Geek
Yes, i agree with this. Even if it takes a few nano seconds more to write out more understandable code, it's worth doing it because code management is more important than sqeezing out the last nano second. And then also an $var = Hello; echo $val World; has less characters than and is more

Re: [PHP] Replacing special characters with their HTML equivalents

2008-12-21 Thread Larry Garfield
On Sunday 21 December 2008 5:30:25 pm James Colannino wrote: Hey everyone. I have a question. I have a web scraper that grabs information from web pages that often contain characters such as vowels with umlots (I know I spelled that wrong.) The data is editable, so the characters show up

Re: [PHP] Variable as an index

2008-12-21 Thread Lars Torben Wilson
2008/12/21 German Geek geek...@gmail.com: Yes, i agree with this. Even if it takes a few nano seconds more to write out more understandable code, it's worth doing it because code management is more important than sqeezing out the last nano second. And then also an $var = Hello; echo $val