Re: [PHP] CSS & tables

2009-05-15 Thread Ed Curtis

PJ wrote:

I know of no better place to ask. This may not be strictly a PHP issue,
but...
I am busting my hump trying to format rather large input pages with CSS
and trying to avoid tables; but it looks to me like I am wasting my time
as positioning with CSS seems an impossibly tortuous exercise. I've
managed to do some pages with CSS, but I feel like I am shooting myself
in the foot or somewhere...
Perhaps I am too demanding. I know that with tables, the formatting is
ridiculously fast.
Any thoughts, observations or recommendations?

  

Whatever works best for you IMHO.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: New Horizon! scam

2009-03-02 Thread Ed Curtis

Alan Bell wrote:
that would appear to be a scam of some sort, not sent by Alan Lord at 
all, he can spell electronic and generally speaks English.


Alan.

Alan Lord wrote:

New Horizon!
i would like to introduce a good company who trades mainly in 
electornic products.
Now the company is under sales promotion,all the products are sold 
nearly at its cost.
They provide the best service to customers,they provide you with 
original products of
good  quality,and what is more,the price is a surprising happiness to 
you!
It is realy a good chance for shopping.just grasp the opportunity,Now 
or never!

The web address:


Windows Live Messenger just got better.





Damn! I though it was a good deal, what is more, I already vistied their 
site and checked over all electornic product.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Which file "Included" me?

2009-02-18 Thread Ed Curtis
Is there a function or variable that will tell me if a file has asked 
another file to include something much the same as 
$_SERVER['HTTP_REFERER'] works. I have a script that is included on 
every page of a site but also needs to include some javascript only if 
it's called from a certain URL.


thanks,

Ed

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Chrome 1.0 released

2008-12-24 Thread Ed Curtis

Bill Guion wrote:

At 9:30 AM -0500 12/14/08, tedd wrote:


At 3:08 PM -0800 12/13/08, Yeti wrote:

I have to defend poor little IE a little now. It supports XHTML and
CSS2 pretty well so far. And those standards came out a couple of
months ago.


Even a blind pig finds an acorn every once in a while.

Cheers,

tedd


Tedd,

You should apologize to all pigs for that comparison.

 -= Bill =-

Yeah, but javascript is still a PITA.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] alphabetical filenames with readdir

2008-08-25 Thread Ed Curtis

Ed Curtis wrote:

Is there a way to make readdir output filenames alphabetically?

Thanks,

Ed



Never mind. I figured out how to do it using an array and sort.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] alphabetical filenames with readdir

2008-08-25 Thread Ed Curtis

Is there a way to make readdir output filenames alphabetically?

Thanks,

Ed


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Code works alone but not with other code.

2008-07-25 Thread Ed Curtis
I've got this chunk of code (included) that used to work fine in a 
script up until a couple of weeks ago. Nothing has changed in the php 
page at all, it just quit working. If I take this chunk of code and 
place it alone in a php script it works just fine, but only by itself. I 
don't understand what's going on and don't see anything that would make 
the script seem like it's just skipping this chunk of code, without 
errors, when I run it. I'm using PHP 4.4.4-8 mand MySQL 5.0.32 on Debian 
Etch.


The code does use nested MySQL queries, it worked before but I thought 
maybe something changed in PHP or MySQL recently in updates that might 
have broken it, but there is another chunk of code in the script that 
uses nested queries as well that works fine just as it had been.


I also have another script that has recently broke and seems to skip a 
section of code as well without errors. There are no real similarities 
between the two that I can see.


Thanks,

Ed


//DO COUNTY BY COUNTY SORTED REPORTS (SORTED BY CITY,PRICE)

echo "Starting Standard County By County Reports";

mysql_connect ($local_host, $local_user, $local_pass);   
  
$result = mysql_query ("SELECT countyname FROM ehs.tempinventorycounties 
ORDER BY countyname ASC");


if ($row = mysql_fetch_array($result)) {

   do {

   $currentcounty = $row['countyname'];

   echo "Generating Report for $currentcounty County";

   $ap = fopen("$report_path/$currentcounty$issue.txt", "w");

   $result2 = mysql_query ("SELECT * FROM ehs.tempinventory WHERE 
county = '$currentcounty' AND property_type NOT LIKE 'Commercial' AND 
property_type NOT LIKE 'Land & Lots' ORDER BY city,price DESC");


   if ($row2 = mysql_fetch_array($result2)) {

   do {

   fputs($ap, $row2['mls']);
   fputs($ap, $nl);
   fputs($ap, $row2['city']);
   fputs($ap, $sp);
   fputs($ap, $dol);
   fputs($ap, number_format($row2['price']));
   fputs($ap, $nl);
   fputs($ap, $row2['beds']);
   fputs($ap, $sp);
   fputs($ap, "Bedroom");
   fputs($ap, $sp);
   fputs($ap, $row2['baths']);
   fputs($ap, $sp);
   fputs($ap, "Bath");
   fputs($ap, $nl);
  
   if ($row2['garage'] != "None") {
  
   $garage_type = explode(" ", $row2['garage']);


   $garage_show = $garage_type[1] . " " . $garage_type[2];

   fputs($ap, $garage_show);
  
   } else {


   fputs($ap, $row2['garage']);

   }

   fputs($ap, $sp);
   fputs($ap, $row2['squarefeet']);
   fputs($ap, $sp);
   fputs($ap, "SF");
   fputs($ap, $nl);
   fputs($ap, "MLS#");
   fputs($ap, $row2['mls']);
   fputs($ap, $nl);
   fputs($ap, $row2['phone']);
   fputs($ap, $nl);
   fputs($ap, "Email: ");
   fputs($ap, $row2['email']);
   fputs($ap, $nl);
   fputs($ap, $row2['company']);
   fputs($ap, $sp);
   fputs($ap, $row2['agent']);
   fputs($ap, $nl);
   fputs($ap, $nl);
  
   //COPY LISTING IMAGE TO INVENTORY IMAGES


   $path = $row2['path'];
   $image = $row2['image'];

   exec ("cp -p $path/listings/$image $image_path/$image");

   //COPY AGENT IMAGE TO INVENTORY AGENT IMAGES

   $agent_image = $row2['agent'];
   $agent_image = str_replace(" ", "_", $agent_image);
   $agent_image = $agent_image . ".jpg";

   exec ("cp -p $path/agents/$agent_image 
$agent_path/$agent_image");


   }
   while ($row2 = mysql_fetch_array($result2));

   }   


   fclose($ap);

   }

   while ($row = mysql_fetch_array($result));

}

mysql_close();


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] strlower problem

2008-06-02 Thread Ed Curtis

Michael Kubler wrote:

Does :

/echo strtolower("CL22");/

work?
You could also try :

/var_dump($strLow);

/

Ed Curtis wrote:

Richard Heyes wrote:

Ed Curtis wrote:
I'm converting upper case characters in a string to lower case and 
am coming up with an empty string.


As I've done a million times before with other non-numerical strings.

$thisStr = "CL22";

$strLow = strtolower($thisStr);

echo $thisStr;

Why does $strLow come up empty?
My mistake. I meant to type echo $strLow; not echo $thisStr; in my 
post.




I found the problem myself. The actual code follows the same principal 
but the value of $thisStr is a $_GET value from a link. The name of that 
value in the link was 'style'. Oops, you should never use a HTML 
reserved attribute as a varible identifier in a link. I just wasn't 
thinking at the time I wrote it. ()


Sorry I took up your time,

Ed 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] strlower problem

2008-06-02 Thread Ed Curtis

Richard Heyes wrote:

Ed Curtis wrote:
I'm converting upper case characters in a string to lower case and am 
coming up with an empty string.


As I've done a million times before with other non-numerical strings.

$thisStr = "CL22";

$strLow = strtolower($thisStr);

echo $thisStr;

Why does $strLow come up empty?


Because you're echoing out the original (uppercase) string. Try:

echo $strLow;



My mistake. I meant to type echo $strLow; not echo $thisStr; in my post.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] strlower problem

2008-06-02 Thread Ed Curtis
I'm converting upper case characters in a string to lower case and am 
coming up with an empty string.


As I've done a million times before with other non-numerical strings.

$thisStr = "CL22";

$strLow = strtolower($thisStr);

echo $thisStr;

Why does $strLow come up empty?

Thanks,

Ed



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Upgrade

2007-09-21 Thread Ed Curtis

Ben wrote:
It really depends on your situation. 
We are an ISP hosting lots of website. Upgrading from 4 to 5 means a lot of 
sites will have trouble. 
Personally I have some problem of upgrading from 4 to 5. 


The below codes work on 4:

include("DB/DataObjects.php");
$pro = DB_DataObject::factory('Product');
$pro->find();
while($pro->fetch())
   $allPro[] = $pro;  


But on 5, it has to be modified to
include("DB/DataObjects.php");
$pro = DB_DataObject::factory('Product');
$pro->find();
while($pro->fetch())
   $allPro[] = clone $pro;  


The above is only an example. So upgrading to 5 is not an option for us.

--
Ben
Web Design Shropshire, Software programing
http://www.sparkcomputing.co.uk

  
Thanks, I did find a way to do what I needed to do and not have to 
upgrade. There are more system calls but it won't be used often enough 
to worry about.


Ed

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Upgrade

2007-09-21 Thread Ed Curtis
I'm currently running Debian Woody with PHP 4.1.2 installed by default. 
It's really stable and I like it alot. Would I run into any problems 
upgrading it to say 4.3.0. There are some functions I need in it that 
4.1.2 doesn't have. I'm not ready to make the jump to PHP5 yet. I've 
tried it on a test server and have run into a couple of problems with 
the upgrade.


Thanks,

Ed

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] using preg_match

2007-05-16 Thread Ed Curtis

Christian Haensel wrote:

Hi Ed,

did you try the backslash as escape character?




 That's what did it. I was thinking the \ was the escape for the 
command but wanted to make sure.


Thanks!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] using preg_match

2007-05-16 Thread Ed Curtis

I'm trying to use preg_match to find a string in a system path.

What I need to do is see if the string '/realtors' exists in a variable 
named '$path'.


I know '/' is used as a container within the command itself. How do I 
escape it to find the string '/realtors'?


Thanks,

Ed

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] db query not working

2007-03-07 Thread Ed Curtis
It is an old guy thing, at least in my case (trivia: I was born the day 
after the ENIAC was turned off)


Aha! October 3, 1955

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript error

2007-03-07 Thread Ed Curtis

Edward Kay wrote:


you've got a stay quote mark in one of your PHP vars.


Not it, I looked and there's nothing there.



I'm sure it's because you've got some stray characters in your output that
mess it up. It would help if you actually posted the source rather than just
saying it's OK, when it clearly isn't.



The problem wasn't a stray apostrophe. Brad Fuller was dead on. It was 
the space in the window name option of the javascript. It works as 
expected once the space is removed.





PPS: It's advisable not to use the short tags, use 

Can you tell me why? Is it just a personal preference?


If you move to another server where the short tags option is off, your code
will break. From the manual:

Using short tags should be avoided when developing applications or libraries
that are meant for redistribution, or deployment on PHP servers which are
not under your control


My scripts aren't meant for distribution also they will only ever be 
delpoyed on a server that I control. Thanks for the tip though and 
thanks to everyone that helped.


Ed

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript error

2007-03-07 Thread Ed Curtis





This produces an "Error on Page" in IE 7, but works perfectly in Firefox
and Netscape.

I have several other javascript calls on the page where this call
resides and all of them work perfectly except for this one. Does this
error occur because I'm sending the variables to another script that
does some logging then forwards the user to the URL or is it just a IE
quirk?



This is a JavaScript issue, but may have something to do with the data you
are echoing out in PHP. Look at the source in the browser. My guess it
that



you've got a stay quote mark in one of your PHP vars.


Not it, I looked and there's nothing there.


PS: If you want your code to validate, change the & to &  Add the
closing  tag too.


Thanks, the &'s are now all &. The closing  is in the script, 
just wasn't posted in the message.



PPS: It's advisable not to use the short tags, use 

Can you tell me why? Is it just a personal preference?

Another JS call directly in front of this one works perfectly.



Send Me Email


The only difference is this call has the window options included the one 
that doesn't work doesn't have them. I've added them just to check and 
it didn't change anything.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php and javascript error

2007-03-07 Thread Ed Curtis

Németh Zoltán wrote:

2007. 03. 7, szerda keltezéssel 10.59-kor Ed Curtis ezt írta:


I've just run into this problem this morning




This produces an "Error on Page" in IE 7, but works perfectly in Firefox 
and Netscape.


I have several other javascript calls on the page where this call 
resides and all of them work perfectly except for this one. Does this 
error occur because I'm sending the variables to another script that 
does some logging then forwards the user to the URL or is it just a IE 
quirk?





I'm almost sure it has nothing to do with php
rather javascript, and maybe microsoft's special javascript
interpretations...


I know it's not the PHP but rather the JS that's causing it. What I fail 
to understand is that there are 2 JS calls before, and 2 JS calls after 
this one in my page and the other 4 work perfectly. They are basically 
the same call too, just to different scripts. I just wondered if anyone 
 knew why this particular call doesn't work or had come across anything 
like this.


Thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] db query not working

2007-03-07 Thread Ed Curtis

Satyam wrote:
I saw two people pointing two errors on the SQL insert statement which 
you would have found yourself had you put the 'or die()' at the end of 
the query, as someone else suggested.  Do never leave any query without 
the 'or die()' after it (or any other means to check if mysql_query 
returns anything not false).  This would have saved lots of your time, 
our time, everybody's bandwidth and would avoid your asking everybody 
again for the next error you make.  We all make errors, none of us is 
above that, that's why, at least in my case, I never fail to add the or 
die() at the end.  That's why the developers of function libraries have 
put some means of reporting errors back.  It takes time for providing 
good error reporting.  You are wasting that effort as well.


Do you deserve all this speech?  No more than the dozens who write what 
I call 'ballistic' code: code you have no control over once it launches. 
Guided missiles are far better.  Anyway, you got it because I had time 
to rant about this.


Satyam


 I wasted no more bandwidth than you did with your rant. My code post 
was edited from the original code and that's where the mistake was made, 
not in the code itself. And I do, by the way, end all my queries with 
or die(). I just left it out of the edit. Besides, the problem is fixed 
now. Thanks to all that helped.


Ed

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] php and javascript error

2007-03-07 Thread Ed Curtis

I've just run into this problem this morning




This produces an "Error on Page" in IE 7, but works perfectly in Firefox 
and Netscape.


I have several other javascript calls on the page where this call 
resides and all of them work perfectly except for this one. Does this 
error occur because I'm sending the variables to another script that 
does some logging then forwards the user to the URL or is it just a IE 
quirk?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] db query not working as expected

2007-03-07 Thread Ed Curtis

I have this code:

mysql_connect ($local_host, $local_user, $local_pass);
mysql_select_db ($local_db);

mysql_query ("DELETE FROM tmphitsmag");

$result = mysql_query ("SELECT DISTINCT company FROM view_log WHERE 
company != ''");


if ($row = mysql_fetch_array($result)) {

do {

$magazine_path = $row['company'];
$magazine_path = explode("/", $magazine_path);

echo str_replace("_", " ", $magazine_path[2]) . "";

mysql_query ("INSERT INTO tmphitsmag (magazine) 
VALUES 		('$magazine_path[2]')");


} while($row = mysql_fetch_array($result));

} mysql_close();

The code dumps the first table fine, selects, manipulates, and echoes 
the string the way I expect, but fails to input the string into the 
tmphitsmag table.


Any ideas?

Thanks,

Ed

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] db query not working

2007-03-07 Thread Ed Curtis

I have this code:

mysql_connect ($local_host, $local_user, $local_pass);
mysql_select_db ($local_db);

mysql_query ("DELETE FROM tmphitsmag");

$result = mysql_query ("SELECT DISTINCT company FROM view_log WHERE 
company != ''");


if ($row = mysql_fetch_array($result)) {

do {

$magazine_path = $row['company'];
$magazine_path = explode("/", $magazine_path);

echo str_replace("_", " ", $magazine_path[2]) . "";

mysql_query ("INSERT INTO tmphitsmag (magazine) 		 
   VALUES('$magazine_path[2]'");


} while($row = mysql_fetch_array($result));

} mysql_close();

It dumps the table fine, works the explode, outputs the string in the 
echo command the way I expect, but doesn't place the value in tmphitsmag 
table.


Anyone have a clue?

Thanks,

Ed

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Is this really a pdf?

2006-08-07 Thread Ed Curtis


On Mon, 7 Aug 2006, Sjef wrote:

> Is it possible to recognize if a file for upload really is a pdf (like the
> function getimagesize retuns the file type of the image)?
> Thanxs,
> Sjef

 Yes it is.

 $_FILES['{form_field_name}']['type'] is your friend here. Just match it
against a mime type your looking for.

Ed Curtis

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Silly varible question

2006-07-13 Thread Ed Curtis


> Just make $item a 2-dimensional array, with the first diemnsion addressed by 
> $count; so:
>
>   $item[$count][] = $_POST['phone'];
>   $item[$count][] = $_POST['category'];
>   $item[$count][] = $_POST['copy'];
>   $item[$count][] = $_POST['pic_style'];
>   $item[$count][] = $cost;
>   $item[$count][] = $image;
>
>   $count += 1;
>
>   $item[$count][] = ...;
>   $item[$count][] = ...;
>   // etc.
>
> Incorporating the (good) advice to use $_SESSION, this becomes:
>
>   $_SESSION['item'][$count][] = $_POST['phone'];
>   $_SESSION['item'][$count][] = $_POST['category'];
>   $_SESSION['item'][$count][] = $_POST['copy'];
>   $_SESSION['item'][$count][] = $_POST['pic_style'];
>   $_SESSION['item'][$count][] = $cost;
>   $_SESSION['item'][$count][] = $image;
>
>   $count += 1;
>
>   $_SESSION['item'][$count][] = ...;
>   $_SESSION['item'][$count][] = ...;
>   // etc.
>
>
> Personally, I'd be inclined to use string indexes that indicate what's in 
> each element, to avoid having to remember somehow which numeric index 
> corresponds to which attribute; so:
>
>   $_SESSION['item'][$count]['phone'] = $_POST['phone'];
>   $_SESSION['item'][$count]['category'] = $_POST['category'];
>   $_SESSION['item'][$count]['copy'] = $_POST['copy'];
>   $_SESSION['item'][$count]['pic_style'] = $_POST['pic_style'];
>   $_SESSION['item'][$count]['cost'] = $cost;
>   $_SESSION['item'][$count]['image'] = $image;
>
>   $count += 1;
>
>   $_SESSION['item'][$count]['phone'] = ...;
>   $_SESSION['item'][$count]['category'] = ...;
>   // etc.
>

 Thanks for all the help guys. I now have a better understanding of multi
dimensional arrays and can use it for what I'm trying to accomplish. This
list is the greatest!!

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Silly varible question

2006-07-13 Thread Ed Curtis

 I know this is probably simple as all get out but it's early and I can't
find an answer anywhere after searching for a while


 I need to assign a number to a variable and then use that variable in a
session to store an array. It's for a shopping cart system I'm building.

What I've got is:

$count = 1; //First item in the cart passed from form to form

$item = array();

$item[] = $_POST['phone'];
$item[] = $_POST['category'];
$item[]  = $_POST['copy'];
$item[] = $_POST['pic_style'];
$item[] = $cost;
$item[] = $image;

session_register('item');

In the session the item is known as 'item'. What I need for it to be is
'item1' so when the customer chooses another product I can increase $count
by 1 and have the next array with values stored as 'item2'.

Thanks for any help,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] getimagesize()

2006-04-07 Thread Ed Curtis

 Can you call getimagesize() multiple times in one script? I'm trying to
use it multiple times but it only seems to work in the first loop I call
it in. I read something in the docs about it cacheing the results and
didn't know if this has something to do with it.

 I also tried creating an array out of the results I get from it but it
will only output the size values when it's building the array, never when
I try to loop back through it and output the values.

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Handling File uploads pre 4.2.0

2005-03-11 Thread Ed Curtis

I need a way to make sure an upload has been "uploaded" correctly to my
server.

I know version 4.2.0 has the $_FILE['userfile']['error'] directive but
unfortunately I'm stuck with verision 4.1.2 at the moment and upgrading
may be a way off for me.

Should I use file_exists($_FILES['userfile']['tmp_name'] to see if it
exists before moving it to wherever I'm moving it too?

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] fireing function with onChange

2005-02-10 Thread Ed Curtis


On Thu, 10 Feb 2005, Richard Lynch wrote:

> Ed Curtis wrote:
> > On Thu, 10 Feb 2005, Richard Lynch wrote:
> >>
> >> In honor of our recent Super Bowl, here is a slow-motion instant replay:
> >>
> >> Bob: "Well, it's a great day so far for PHP today, isn't it Jim?"
> >> Jim: "You've got that right, Bob!  Now let's check out this play."
> >> Bob: "Watch as the user surfs right to that web page!"
> >> Jim: "Yeah, smooth!"
> >> Bob: "Then, Apache detects the .php in the URL and hands off the action
> >> to
> >> PHP!"
> >> Jim: "PHP has been really strong today, hasn't it?"
> >> Bob: "Sure has, Jim!"
> >> Jim: "Then, PHP builds up some HTML and JavaScript and sends it out!"
> >> Bob: "Yeah, and then PHP says 'Job Done.'"
> >> Jim: "You've got that right, Bob! PHP is outta the game for now,
> >> resting."
> >> Bob: "Now watch carefully as the user interacts with the browser."
> >> Jim: "Pay particular attention as they change items in the filelist
> >> box."
> >> Bob: "Oh! What a fumble!!!"
> >> Jim: "Yeah, it's definitely much too late to be handing off to PHP!"
> >> Bob: "Sure is, Jim. PHP has been out of the game now for awhile!"
> >>
> >> Copyright Richard Lynch and the NFL.
> >> Unauthorized re-broadcast is a violation of Federal Law.
> >
> >  Your comments are quite funny but wouldn't it have been alot easier to
> > say that you can't call a PHP function within a generated HTML element?
> > You can however use the onChange event to call another PHP script that
> > will perform the function. Not nearly as many keystrokes :)
>
> The other 237 times I've answered this question, the reader doesn't
> understand *WHY* they can't do that unless it's broken down into a
> slow-motion instant replay of server-side versus client-side.
>
> And if they don't understand *THAT*, they are going to have troubles down
> the road with Cookies, HTTP Authentication, scraping from SSL sites,
> sessions, and probably a couple other PHP topics.
>
> I'd rather get them thinking about this now than answer a dozen more
> questions all stemming from a fundamental lack of understanding of the
> interaction of browser, server, and PHP.  YMMV
>
> I know *I* didn't get this until somebody was kind enough to build a
> diagram of what happens in an HTTP exchange.  It's in the archives (about
> 6 years back, mind you...)
>
> So I typed Jim, Bob and "" a lot, and a couple extra lines for fun.
> [shrug]  I type fast anyway. :-)
>

 Sorry I started this. I didn't mean for it to become another "kid caught
using PHP" thread.

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] fireing function with onChange

2005-02-10 Thread Ed Curtis


On Thu, 10 Feb 2005, Richard Lynch wrote:
>
> In honor of our recent Super Bowl, here is a slow-motion instant replay:
>
> Bob: "Well, it's a great day so far for PHP today, isn't it Jim?"
> Jim: "You've got that right, Bob!  Now let's check out this play."
> Bob: "Watch as the user surfs right to that web page!"
> Jim: "Yeah, smooth!"
> Bob: "Then, Apache detects the .php in the URL and hands off the action to
> PHP!"
> Jim: "PHP has been really strong today, hasn't it?"
> Bob: "Sure has, Jim!"
> Jim: "Then, PHP builds up some HTML and JavaScript and sends it out!"
> Bob: "Yeah, and then PHP says 'Job Done.'"
> Jim: "You've got that right, Bob! PHP is outta the game for now, resting."
> Bob: "Now watch carefully as the user interacts with the browser."
> Jim: "Pay particular attention as they change items in the filelist box."
> Bob: "Oh! What a fumble!!!"
> Jim: "Yeah, it's definitely much too late to be handing off to PHP!"
> Bob: "Sure is, Jim. PHP has been out of the game now for awhile!"
>
> Copyright Richard Lynch and the NFL.
> Unauthorized re-broadcast is a violation of Federal Law.

 Your comments are quite funny but wouldn't it have been alot easier to
say that you can't call a PHP function within a generated HTML element?
You can however use the onChange event to call another PHP script that
will perform the function. Not nearly as many keystrokes :)

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Validating input

2005-01-28 Thread Ed Curtis

I've been looking at the docs and found preg_match and preg_match_all but
these functions only seem to match 1 specific search item. I want to make
sure a variable (say $mlsnumber) contains only numbers and no spaces. What
would I use to accomplish this?

Thanks

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Display only one filed of the repeated records

2004-11-30 Thread Ed Curtis


On Tue, 30 Nov 2004, Ahmed Abdel-Aliem wrote:

> Hi,
> i have a tables in database which fields is
> id - title - category
>
> what i want to do is to display the categories entered in the
> categories fields, without repeating any of them
> for eample if the records is like follow
>
> ID  Title   Cattegory
> 1Matrix   Sci-Fi
> 2Spartacus History
> 3Alexander History
> 4whatever   Horror
>
> i want to list the categories only like this
>
> Sci-Fi - History - Horror
>
> can anyone help me throught this please ?

 Use DISTINCT in your query, maybe?

 SELECT DISTINCT Cattegory from tablename;

 Hope that helps.

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] RE: **[SPAM]** [PHP] Correct context

2004-09-20 Thread Ed Curtis


On Mon, 20 Sep 2004, Jay Blanchard wrote:

> There are several ways  here is one
>
> if(("" != $row['photo_check']) && (("Copy Change" != $entry) || ("Banner
> Change" != $entry) || ("Price Change" != $entry)))
>
> Note the parentheses to define preference order.

 That's what I was looking for.

Thanks again,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Correct context

2004-09-20 Thread Ed Curtis

Before I go screwing this code up I thought I would ask for the
formatting. How would you write the following in PHP?

if $entry not equal to "Copy Change"
OR
"Banner Change"
OR
"Price Change"

AND

$row['photo_check'] not equal to ""

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] thumbnail of webpage

2004-09-20 Thread Ed Curtis

 If you have a Linux box available here's something to try although it
does have some required software.

http://www.babysimon.co.uk/khtml2png/index.html

There is also a link on the site for a commercial product for Windows that
does the same thing.

I can't endorse either one as I have not used them. Just giving the
information.

Ed


On Sat, 18 Sep 2004, raditha dissanayake wrote:

> Michael Mao wrote:
>
> > Is there a way to capture a snapshot of a html page and save it as a
> > jpg  using php?
> >
> This is something that's very very hard to do with PHP but can be easily
> done with Java.
>
>
>
>
> --
> Raditha Dissanayake.
> 
> http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 128 KB | with progress bar.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] session_cache_limiter confusion

2004-08-20 Thread Ed Curtis

 I've been looking through the online docs and man is this one confusing.
Seems there are plenty of different ways to use this. Using this with
forms, what is the best setting to avoid back button mishaps?
(none,private, etc..)

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing using php script CRON

2004-07-27 Thread Ed Curtis

You could try this:

http://marginalhacks.com/Hacks/html2jpg/

Save the page as an image, and then run it through the printer. It does
have some overhead though to get it done.

Hope it helps,

Ed

On Tue, 27 Jul 2004, Vern wrote:

> I feel like I taking a hammer and well I'm sure you all know the
> feeling.
>
> cURL does help me to get the file and save the file somewhere locally,
> however printing a page like this gives me all the html code (i.e. ,
> etc) and I need the report that is being displayed to the browser in all
> it's glory (color, graphs and so forth). So somehow I need to simply have
> the output of this file converted to an image file of some some. You would
> think that there is and easy command from the command prompt that would
> allow you to do this. Am I incorrect? Do I have to rewrite this whole page
> to output to an image or pdf?
>
> Seems there should be an easier way.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] quotes in text.

2004-07-16 Thread Ed Curtis


On Fri, 16 Jul 2004, John W. Holmes wrote:

> Ed Curtis wrote:
> > On Fri, 16 Jul 2004, Justin Patrin wrote:
> >>This is why he said: "Since you seem to have magic_quotes_gpc enabled,
> >>you can put the value directly into your query."
> >>
> >>You shouldn't use htmlentities when putting it into the DB. Use it
> >>when displaying the text.
> >
> >  I tried it both ways and it only works correctly when I do use
> > htmlentities($_POST['text']) in my insert query. I'm not showing the text
> > to the user on page 3 at all.
>
> Well, if you're happy with it "just working" and not knowing why or how
> it's going to break in the future... have fun.
>

Ok then, I want to know how to do it the right way but just using
$_POST['text'], as stated before, in my query still cuts off the text at
the quote.

While passing this field between pages I don't do anything to it but when
I want to show it to the user I would use stripslashes($_POST['text']). Is
this the correct way to make sure my quotes get passed into the database?

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] quotes in text.

2004-07-16 Thread Ed Curtis

On Fri, 16 Jul 2004, Justin Patrin wrote:

> This is why he said: "Since you seem to have magic_quotes_gpc enabled,
> you can put the value directly into your query."
>
> You shouldn't use htmlentities when putting it into the DB. Use it
> when displaying the text.

 I tried it both ways and it only works correctly when I do use
htmlentities($_POST['text']) in my insert query. I'm not showing the text
to the user on page 3 at all.

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] quotes in text.

2004-07-16 Thread Ed Curtis



On Fri, 16 Jul 2004, John W. Holmes wrote:

> Let's say you have $_POST['text'] from the user.
>
> To display the value back to the user with magic_quotes_enabled, you'd
> do this:
>
> echo htmlentities(stripslashes($_POST['text']));
>
> To put the value into a hidden form element, you'd do this:
>
>  value="">
>
> Now, $_POST['text'] will come out correctly on Page 3. Since you seem to
> have magic_quotes_gpc enabled, you can put the value directly into your
> query.

Actually when I tried the above example nothing was entered into the
database. This worked.. htmlentities($_POST['text']).

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] quotes in text.

2004-07-16 Thread Ed Curtis

I'm having some difficulty with quotation marks, both single and double,
input via a textarea in a form.

Here's and example of text.

Trying out the "Special Character" thing.

Page 1 is the form.

Page 2 is the data shown back to the user.
original POST data is not touched. NO stripslashes
original typed text is show to the user by stripslashes($thistext)
original POST data is transferred to next page via hidden input field
without stripping slashes.

Page 3 posts the data to a MySQL database.
original POST data is not touched. No stipslashes.
Text gets cut off in database (Trying out the)

What exactly do I need to do to the text so that any quotation marks
(single or double) get input into the database.

TIA,

Ed Curtis



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] RE: SOLVED! [PHP] Echoing a value

2004-07-12 Thread Ed Curtis
On Mon, 12 Jul 2004, Pablo Gosse wrote:

> Try changing:
>
> fputs($ap, $row['users.name']);
> fputs($ap, $row['users.company']);
>
> To:
>
> fputs($ap, $row['name']);
> fputs($ap, $row['company']);
>
> That should do the trick.
>
> Cheers,
> Pablo
>

That did the trick! I knew it was something simple I was overlooking.

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Echoing a value

2004-07-12 Thread Ed Curtis

I'm having some trouble echoing a value to a file that is being pulled
from a MySQL database. I've included my code below I'm sure it's something
really simple but I'm not seeing it. $row['users.name'] and
$row['users.company'] echo nothing while $row['cnt'] echoes it's expected
values. If anyone can tell me what I'm doing wrong I'd appreciate it.

Thanks,

Ed

$ap = fopen("$ad_path/AdCount$issue.txt", "w");

mysql_connect ($local_host, $local_user, $local_pass);

mysql_select_db ($local_db);

$result = mysql_query ("SELECT *, COUNT(*) as cnt FROM users, listings
WHERE listings.user_id = users.id AND listings.active = '1' GROUP BY
users.company, users.name");

if ($row = mysql_fetch_array($result)) {

do {

fputs($ap, $row['users.name']);
fputs($ap, $sp);
fputs($ap, $sp);
fputs($ap, $row['users.company']);
fputs($ap, $sp);
fputs($ap, $sp);
fputs($ap, $row['cnt']);
fputs($ap, $nl);

}

while($row = mysql_fetch_array($result));

mysql_close(); }

fclose($ap);


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] IE 6 hotix and header problem

2004-03-09 Thread Ed Curtis

Does anyone happen to have the link on microsoft's support site that
addresses the problem with the latest IE 6 hotfix and incomplete headers
being sent? I can't seem to find my bookmark and I can't access the
archive site to find it.

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Image resize on upload

2004-02-26 Thread Ed Curtis

 Make sure you use imagecreatetruecolor() with GD when resizing images or
you'll get some undesirable results. Imagemagick's convert and mogrify
worked well for me although I was resizing an uploaded image.

Ed Curtis


On Thu, 26 Feb 2004, Will wrote:

> Thanks!! I found some documentation on the GD library.
> I most likely be posting again!! :)
>
> ~WILL~
>
>
> [EMAIL PROTECTED] wrote:
> > gd seems to work fine ? even nconvert via command line does a good job and
> > it resizes gif too
> >
> >
> >>I'll second that one, I wrote a shell script in PHP to resize images,
> >>using ImageMagicks mogrify
> >>command, and it took ages.  It's really much too slow for a web site.
> >>
> >>If you need a faster solution, I think you have to buy something.
> >>
> >>On 26 Feb 2004, at 09:15, Adam Bregenzer wrote:
> >>
> >>
> >>>On Thu, 2004-02-26 at 02:25, Will wrote:
> >>>
> >>>>I forgot to mention what I was trying to do.
> >>>>There is a web page that pulls the image file name from the database
> >>>>then  reads the URL to the directory where the image is.  Is it
> >>>>possible
> >>>>to just resize it when the web page is brought up in the browser?
> >>>
> >>>I use ImageMagick's[1] convert[2] to do this.  It is not a PHP module
> >>>and must be run through exec[3].  Also, in my experience image
> >>>manipulation is rather time consuming, it is a good idea to cache
> >>>altered images so they do not have to be recreated on every page load.
> >>>
> >>>[1] http://www.imagemagick.org/
> >>>[2] http://www.imagemagick.org/www/convert.html
> >>>[3] http://www.php.net/exec
> >>>
> >>>--
> >>>Adam Bregenzer
> >>>[EMAIL PROTECTED]
> >>>http://adam.bregenzer.net/
> >>>
> >>>
> >>>--
> >>>PHP General Mailing List (http://www.php.net/)
> >>>To unsubscribe, visit: http://www.php.net/unsub.php
> >>>
> >>>
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] thumbnail

2004-01-21 Thread Ed Curtis

> No need to copy+mogrify; just use
>
>   convert [options] /path/to/old /path/to/new
>
> instead :-)

 I wasn't aware of that command. This list is great!!

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] thumbnail

2004-01-21 Thread Ed Curtis



> [snip]
> OK, but how? I already use GD, I need to now how to create a thumbnail,
>
> somebody now how to use the GD functions to create a thumbnail???
> [/snip]
>
> http://www.php.net/GD

 Personally, I think Imagemagick's mogrify works alot better. I've been
using GD for the past few months and it's very inconsistent on thumbnail
quality even when the quality setting is at maximum.

 The only real problem with mogrify is that you have to copy an image to a
seperate location if you want to keep the original file as it overwrites
the file it's making a thumnail of.

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] picturing webpage

2004-01-09 Thread Ed Curtis

> > Hi!
> >
> >
> > %
> > % I wanted to know if it is possible to picture a webpage via
> > PHP. % By "picturing" I mean that the program can generate a
> > picture, a view, out


 Don't know if this is exactly what you're looking for but this might be
what you're after. It was posted on Freshmeat just this week.

http://www.babysimon.co.uk/khtml2png/

Ed Curtis

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: progress in PHP

2003-12-23 Thread Ed Curtis

> Join the 11,000 people who use megaupload progress bar (with a little
> help from perl)
> http://www.sourceforge.net/projects/megaupload/

 I tried. It wasn't worth all the perl mods I would to have had to
install to make it work.

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: progress in PHP

2003-12-22 Thread Ed Curtis


> Now that might interest me.  So what has been added to the PHP codebase
> that makes this work?  And what tweaking would I need to do?  [Can't I
> just have it display in the current window?  Why bother with a popup?]

>From rumors I've heard on the list a future version of PHP may have a
progress bar function built in. Don't know if it's true or not but it
would be nice.

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Working pop-up progress window

2003-12-22 Thread Ed Curtis



> If I understand you correctly, when you call window.close on the next
> page you want it to close the child window.  I am not sure if this is
> possible
> with Javascript if you go to a new page, it might be.  You would want
> to not call window.close but something like myPopUp.close() on the next
> page.
>
> Someone else might be able to shed so more light on it.  Keep in mind
> that more and more users are blocking all pop ups.

That's correct. I didn't make that clear enough in my first post. When I
call the popup I give it a name (i.e. MyWindow) and when I try to close it
I call MyWindow.close() and it still will not close.

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Working pop-up progress window

2003-12-22 Thread Ed Curtis

 I've read through the archives and run through some of the suggestions
given for progress bars and pop ups with animated gifs and haven't had
much luck.

 I've had the most luck using the pop-up window method. In the 
element I call onSubmit="{open some window here}" This works as the pop-up
appears while the file is transferring. Here's where I run into problems.
I've tried all kinds of examples found on google and can never get it to
work right.

 In the script where my form goes to, I'm supposed to use a  on
the page containing the form. Either my pop-up stays open or I close the
parent window.

Does anybody have a working example I could work off of so I could please
my boss. Personally, I didn't want to do this but he thinks we should have
these flashy things on out site.

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Building a query string

2003-12-03 Thread Ed Curtis

> To answer the question, $query_str.=" AND garage = '$garage' ";
>
> BUT. If $garage is an id (numeric), then you should use
> $garage=abs($garage) first in order to defeat SQL injection. If it's a
> string, well, say so and we'll tell you what to do (a lot to explain,
> and not useful if it's an ID).
>
> Bogdan

 All values pulled from $_POST are strings such as $garage = "Attached 2
Car" or "Detached 1 Car", etc. There are a few options that will be based
on a checkbox. If the box is checked it means you want that option
included in the query as well, i.e. (fireplace == "yes".) If the box is
not checked it means no, i.e (fireplace == "no".)

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Building a query string

2003-12-03 Thread Ed Curtis

 This list has helped me out alot and I hope it can do it one more time.

I need to build a MySQL query based on 11 different options from a form.
Some options will have values others will be checkboxes to say include in
the query.

How I thought about going at it was using a default query string and add
additional strings to the default string based on results of the form.

$query_str = "SELECT * FROM listings WHERE id > 0 ";

if ($garage != "") {

$garage_str = "AND garage = '$garage' ";

//add $garage_str to $query_str//

}

This would continue through all eleven options then produce a query string
with all included query options needed. Can this be done this way? If so,
how do I add a string to a string?

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Comparing 2 strings.

2003-11-19 Thread Ed Curtis

 I guess I did miss that it says that the comparison is case sensitive
and binary safe.

Thanks,

Ed


On Wed, 19 Nov 2003, CPT John W. Holmes wrote:

> From: "Ed Curtis" <[EMAIL PROTECTED]>
>
> >  I currently store text from a MySQL blob field in a string $orig_text. I
> > need to compare that with something someone type in from a form stored in
> > $new_text. How would I go about comparing them to see if they are
> > different or exactly the same? strcmp doesn't look like it will handle
> > this too well.
>
> Why would you say that when strcmp() is exactly what you need to use??
>
> ---John Holmes...
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Comparing 2 strings.

2003-11-19 Thread Ed Curtis

 I currently store text from a MySQL blob field in a string $orig_text. I
need to compare that with something someone type in from a form stored in
$new_text. How would I go about comparing them to see if they are
different or exactly the same? strcmp doesn't look like it will handle
this too well. I can't go by the number of characters in the string
either. Someone may be able to use new words but keep the length of the
string the same.

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Concerning number_format()

2003-11-06 Thread Ed Curtis

 Duh. Yeah, works like a charm.

Thanks,

Ed


On Thu, 6 Nov 2003, Jay Blanchard wrote:

> [snip]
> $price = "1234.567890";
>
> $price = number_format($price, 2, '.', '');
>
> echo $price;
>
> Returns 1234.567890
>
> Should return 1234.57 correct?
> [/snip]
>
> Use a new variable to hold the modified information
>
> $price = "1234.567890";
>
> $newPrice = number_format($price, 2, '.', '');
>
> echo $newPrice;
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Concerning number_format()

2003-11-06 Thread Ed Curtis

I'm using an example straight from the manual on the php site that
doesn't seem to work.

$price = "1234.567890";

$price = number_format($price, 2, '.', '');

echo $price;

Returns 1234.567890

Should return 1234.57 correct?

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Stripping Decimals

2003-11-04 Thread Ed Curtis

 Thanks! Works like a charm.

Ed


On Tue, 4 Nov 2003, CPT John W. Holmes wrote:

> From: "Ed Curtis" <[EMAIL PROTECTED]>
> >  I currently use number_format() and str_replace() to remove a "," or "$"
> > if entered and reformat it  as a price for an item. I've asked the
> > user not to use decimals but some still do. How do I remove a decimal and
> > anything after from a number in a varable?
>
> $new_number = preg_replace('/\.[0-9]+/','',$old_number);
>
> I would do that first, then a
>
> $new_number = preg_replace('/[^0-9]/','',$new_number);
>
> afterwards to remove anything that's not a number from the string.
>
> ---John Holmes...
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Stripping Decimals

2003-11-04 Thread Ed Curtis

 I currently use number_format() and str_replace() to remove a "," or "$"
if entered and reformat it  as a price for an item. I've asked the
user not to use decimals but some still do. How do I remove a decimal and
anything after from a number in a varable?

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Multidimensional Arrays

2003-10-20 Thread Ed Curtis

 I'm trying to submit multiple values to a variable within an 
tag by using a value such as value="this,that" There are multiple 
statements on this form each counting up from 1 using $count and
$listings as such.





This and That
That and This



On the recieving side I'm parsing many instances of these using the
following method

 $count = 1;
 $listings = 3;

while ($count <= $listings) {

$listing['$count'] = $_POST['listing[$count]'];

}


This example works fine if I need to get the full value (this,that) or
(that,this). What I'd like to do is break this into a multidimensional
array so I have approximately the following depending on what they choose
for each example.

$listing[1][0] = this
$listing[1][1] = that

$listing[2][0] = that
$listing[2][0] = this

 Hopefully this example is clear enough that someone will understand what
I'm doing. I tried the following with no luck.

$listing['count'] = $_POST['listing[count]'];

$listing['$count'] = explode(",", $listing['$count']);

Any takers? Thanks.

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Avoiding "Warning - Page Expired"

2003-09-30 Thread Ed Curtis

 Is there any way to avoid having this happen using php if someone sits
on a page too long and clicks the back button to go back to a form they
have filled out and not having the values in a session?

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] One variable not equal to 2 values.

2003-09-25 Thread Ed Curtis

 How would I write this statement:

if $thisvar is not equal to this value or that value. { do stuff }


Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File Types

2003-09-15 Thread Ed Curtis

> Didn't google hard enough :)
>
> .pm5  application/x-pagemaker
> I'd guess that can be extended to pm7 and 65 - I've seen x-pagemaker5 as
> well.
>
> pmd is also pagemaker according to filext.com, as well as some software I've
> never heard of.
>
> QXP is a good one, and you may need to ask the manufacturer of the software
> what mime type is used.
>

 I think too that application/pagemaker should work for .p65 and .pm7
as well as .pmd (Page Maker Document). I think .qpx is a Quark Express
document but I can't find the mime for that anywhere.

Thanks for the repiles,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] File Types

2003-09-15 Thread Ed Curtis

On Mon, 15 Sep 2003, Javier Tacon wrote:

>
> You could use the function exif_imagetype() to see what type of file
> has been uploaded.
>

 The filetypes are not all images types.

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File Types

2003-09-15 Thread Ed Curtis

On Mon, 15 Sep 2003, Raditha Dissanayake wrote:

> You don't need to look any further than mime.types files included in
> your apache distro.

Did that as well as googled for the list of extensions. Still can't seem
to find the mime type for .pm7, .p65, .qxp and .pmd.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] File Types

2003-09-15 Thread Ed Curtis

 I currently limit file types in an upload script by using an allowed
types array

$allowed_types = array("image/jpeg", "image/gif");

 I also need to allow files of with the following extentions.

 .tif, .pm7, .p65, .pdf, .qxp, .pmd, .eps

Is there a site out there anywhere that gives the mime types of theses
files?

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] some kind of redirection (not the header function)

2003-09-11 Thread Ed Curtis

 I'm pretty sure that YahooGroups uses cookies for this to hold values
while you're not on their site. When you return it checks for the cookies
and reloads the values from the last visit. You can accomplish this with
PHP as well.

Ed

On Thu, 11 Sep 2003, Juan Nin wrote:

> On Thu, 2003-09-11 at 15:39, Ed Curtis wrote:
> >  Is there any type of criteria that would point a user to directoryA or
> > directoryB?
> >
> >  I recently rebuilt a site that handled a couple thousand
> > different working directories for clients but used only one set of
> > scripts for all. The user would have to login and variables were pulled
> > from a database to set the directory that they would work in. The
> > directory name could be passed from script to script or stored in
> > sessions.
>
> The beheaviour I want to acomplish is the same as in yahoorgoups.
>
> You can access a mian page, where you login and have a list of all the groups you 
> are subscribe to.
> You click on the link to each one and it redirects you to: 
> http://groups.yahoo.com/groups/yourGroup/
>
> There it displays the page for your group with all it´s characteristics. The same 
> behaviour
> if you access that URL directly. Or you can also access 
> http://groups.yahoo.com/groups/yourGroup/messages/ etc
>
> That¶ what I ant to do  :)
>
> Any ideas?
>
> thnx again,
>
> Juan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] some kind of redirection (not the header function)

2003-09-11 Thread Ed Curtis

 Is there any type of criteria that would point a user to directoryA or
directoryB?

 I recently rebuilt a site that handled a couple thousand
different working directories for clients but used only one set of
scripts for all. The user would have to login and variables were pulled
from a database to set the directory that they would work in. The
directory name could be passed from script to script or stored in
sessions.

Ed



On Thu, 11 Sep 2003, Juan Nin wrote:

> Hi!!!
>
> I´m programming a site in PHP, where I want to do the following:
>
> I will have a set of different directories, where each directory must
> execute the same PHP pages, but giving as result different data,
> according to the directory where you are located (obtained by
> $_SERVER[´PHP_SELF´] for example).
>
> For example I have:
>
> http://www.domain.com/directoryA/
> http://www.doamin.com/directoryB/
>
> So each one must have (or should act as if they had) the same PHP pages
> and directories under them.
>
> The solution I thought, as copying each page in every directory makes no
> sense (if I modify the code I´ll have to change all the pages in all
> directories), is to have an includes directory. where I put all the PHP
> pages, and in each of the different directories I create pages that
> simply include or require the ones from the include directories.
>
> That way I´ll only modify code inone place..
>
> Now.. is there any better way to achieve this??
> I thought that maybe with some Apache stuff, but I don´t think there¶
> something that will help, since directives such as RedirectMatch, etc.
> rewrite the URL, and I don´t want that, I want the URL to remain
> http://www.domain.com/directoryX/whatever.php
>
> Is there any way to do this, or I should stick up with the includes??
>
> Thnx in advance,
>
> Juan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Acessing session vars

2003-08-15 Thread Ed Curtis

 I just started using sessions and am having some trouble understanding how
to pull values out of sessions to use in another page.

I set the values as:

session_start();
session_register{'magazine');
session_register('company');

The data is saved as a session because I can read the file located in my
/tmp directory.

Now I click on a link and go to a different page and I do:

session_start()

Magazine: 

Company: 

Should I be able to retrieve the values in this fashion? I'm using php
4.1.2. 

Thanks,

Ed


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Problems with variables and PHP/HTML

2002-09-24 Thread Ed Curtis

I am currently using Apache 1.3.26 and PHP 4.2.3 on a Linux box running
Kernel 2.0.36

My trouble is in passing variable from within a form submission or within a
URL.
I can get a From submission to work if I declare the variable and resubmit
it to another variable name.

I.E. form field name = username passed to readform.php
   in readform.php $username = $_POST['username']

 I can then user $username

Used to be you could just use $username as a variable if it was passed from
a form to another script.

Now I have $username defined and useable but if I try to add it to a URL
such as:



It becomes a null value or doesn't get passed at all.

I thought this might have something to do with track-vars but track vars are
enabled by default in PHP since before my version. When I compiled
everything I compiled PHP as a DSO. Any ideas?

TIA,

Ed Curtis



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php