[PHP] Array sizes?

2006-02-08 Thread Anders Norrbring
Maybe I'm just blind, but I can't find any way to count an array size in bytes? I have a quite big array with multiple data formats in it, and I would like to know how big it is in bytes... -- Anders Norrbring -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www

[PHP] Re: image location hiding techniques

2006-02-08 Thread David Dorward
hbeaumont hbeaumont wrote: > I have a site with images that I want people to download but not have > the direct path to. ie. I do not want them to be able to just view the > source, find the dir and then download everything or direct link to > them. Turn off directory indexes or put an index.html

Re: [PHP] The Big Date and Time Debacle

2006-02-08 Thread Stephen Martindale
Christopher Taylor wrote: Stephen Martindale wrote: I am having great difficulty understanding dates and times with PHP and MySql. As far as I understand them, the PHP date and time construct is timezone and DST aware, but MySql's DATETIME and TIMESTAMP fields are not. I believe that this is

[PHP] Advanced PHP Chat

2006-02-08 Thread Stephen Martindale
Hello All, What would be the definitive PHP chat community to join for someone who likes to discuss how things *should* be done, or would be done *properly* as opposed to the ol' "How do I ..."-style discussions? I've never been satisfied with my code just working, I always want to know whet

[PHP] Re: Array sizes?

2006-02-08 Thread Barry
Anders Norrbring wrote: Maybe I'm just blind, but I can't find any way to count an array size in bytes? I have a quite big array with multiple data formats in it, and I would like to know how big it is in bytes... I don't think a "function" exists, but i would probably use (for benchmarking)

Re: [PHP] Re: Array sizes?

2006-02-08 Thread Paul Novitski
Anders Norrbring wrote: Maybe I'm just blind, but I can't find any way to count an array size in bytes? I have a quite big array with multiple data formats in it, and I would like to know how big it is in bytes... At 01:05 AM 2/8/2006, Barry wrote: I don't think a "function" exists, but i wou

Re: [PHP] Re: Array sizes?

2006-02-08 Thread Barry
Paul Novitski wrote: Anders Norrbring wrote: Maybe I'm just blind, but I can't find any way to count an array size in bytes? I have a quite big array with multiple data formats in it, and I would like to know how big it is in bytes... At 01:05 AM 2/8/2006, Barry wrote: I don't think a "fu

[PHP] How to output multiple tables nicely(!) from PHP in Excel format?

2006-02-08 Thread Olaf Greve
Hi, One of our clients is a true Excel wizard and in order to enable his highly advanced sheets to become available for others as well (editable and all), I have created a PHP version of his Excel sheets which uses a MySQL DB for storage. I shall spare you all the technical intricacies of th

Re: [PHP] REGEX query

2006-02-08 Thread Burhan
phplists wrote: Hi, I'm still trying to get to grips with REGEX and have hit a hurdle with the following: I have this bit of text: (\(EX\) RV-6 ) I want to remove the '\(EX\)' part of it so leaving just: ( RV-6 ) $text = '(\(EX\) RV-6 )'; $bits = explode(' ',$text); $leaving = '( '.$bits[0

Re: [PHP] REGEX query

2006-02-08 Thread Kim Christensen
> > I have this bit of text: > > (\(EX\) RV-6 ) > > > > I want to remove the '\(EX\)' part of it > > so leaving just: ( RV-6 ) $text = '(\(EX\) RV-6 )'; $str = str_replace('\(EX\)','',$text); As Burhan put it, regex is not always the solution to your problem - in most cases, using regex for this

RE: [PHP] Advanced PHP Chat

2006-02-08 Thread Jay Blanchard
[snip] What would be the definitive PHP chat community to join for someone who likes to discuss how things *should* be done, or would be done *properly* as opposed to the ol' "How do I ..."-style discussions? I've never been satisfied with my code just working, I always want to know whether the

[PHP] suggest a cart...

2006-02-08 Thread Ross
Hi, I am looking for a cart that allows me to do the following -Add new items with image -deleted items -indicate when an item is sold put - is integratable with paypal R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Advanced PHP Chat

2006-02-08 Thread Jared Williams
Sitepoints' PAD http://www.sitepoint.com/forums/forumdisplay.php?f=147 Jared > > What would be the definitive PHP chat community to join for > someone who likes to discuss how things *should* be done, or > would be done > *properly* as opposed to the ol' "How do I ..."-style discussions? >

Re: [PHP] How to output multiple tables nicely(!) from PHP in Excel format?

2006-02-08 Thread Olaf Greve
Hi all, I've written a ArrayToExcel(XML) class, you're welcome to use if you wish. May need a bit of tweaking to get the colspan working (I haven't touched it in quite a while). But the process itself I think is rather nice :) > > http://projects.londonis.co.uk/arraytoexcel/ Thanks for your

Re: [PHP] How to output multiple tables nicely(!) from PHP in Excel format?

2006-02-08 Thread tedd
Does anyone know of a way to achieve this nicely, preferrably creating a tab per table? Thanks in advance, and cheers, Olaf Olaf: I don't know if this will solve your problem, but if you like it, you are welcome to the solution. Please note, the first time into the page, you'll have proble

Re: [PHP] How to output multiple tables nicely(!) from PHP in Excel format?

2006-02-08 Thread Oli Howson
The example given outputs to two tabs, "sheeta" and "sheetb" Quoting Olaf Greve <[EMAIL PROTECTED]>: Hi all, I've written a ArrayToExcel(XML) class, you're welcome to use if you wish. May need a bit of tweaking to get the colspan working (I haven't touched it in quite a while). But the proc

RE: [PHP] suggest a cart...

2006-02-08 Thread Dan Parry
Zen Cart http://www.zen-cart.co.uk/ Open source and very well supported... lots of user contributions too Dan -Original Message- From: Ross [mailto:[EMAIL PROTECTED] Sent: 08 February 2006 13:08 To: php-general@lists.php.net Subject: [PHP] suggest a cart... Hi, I am looking for a car

RE: [PHP] How to output multiple tables nicely(!) from PHP in Excelformat?

2006-02-08 Thread Albert
Olaf Greve wrote: > I would still be very interested in a way to get the 3 tables sent to > different tabs though, but I'm not certain the way I do it can take care > of that. Last time I needed (3 years ago) to output something to MS Excel format, I used Excel Writer (http://phpclasses.fonant.c

Re: [PHP] REGEX query

2006-02-08 Thread phplists
Thanks for that...and yes that would do very nicely. Unfortunately, for what I'm trying to do, it is of little use. I probably should have mentioned that the bit of text I used is actually just part of a much bigger bit of text so exploding on a space would cause havoc with the rest of it. Hen

Re: [PHP] Array sizes?

2006-02-08 Thread tedd
Maybe I'm just blind, but I can't find any way to count an array size in bytes? I have a quite big array with multiple data formats in it, and I would like to know how big it is in bytes... -- Anders Norrbring Yeah, I know -- sizeof is simply count, which doesn't solve the problem. You cou

[PHP] global variable declaration

2006-02-08 Thread suresh kumar
hai, this is my sample code: i am having user table with SponsorID as one field in mysql database,this is my query; for($j=0;$j<5;$j++): $result=mysql_query("select * from user where SponsorID='$id[$j]' "); endfor; in above code when

[PHP] imagecreate

2006-02-08 Thread Ross
Hi, I am trying to replace the images in a page with this code This is fine here... http://www.ecurry.net/example1.php http://www.ecurry.net/example2.php but when I try and embed in inside a html page I get a garbled mess http://www.ecurry.net/menu6.php http://www.ecurry.net/menu6.phps I

Re: [PHP] global variable declaration

2006-02-08 Thread Richard Davey
On 8 Feb 2006, at 14:46, suresh kumar wrote: this is my sample code: i am having user table with SponsorID as one field in mysql database,this is my query; for($j=0;$j<5;$j++): $result=mysql_query("select * from user where SponsorID='$id [$j]' "

Re: [PHP] imagecreate

2006-02-08 Thread Richard Davey
On 8 Feb 2006, at 14:20, Ross wrote: I am trying to replace the images in a page with this code This is fine here... http://www.ecurry.net/example1.php http://www.ecurry.net/example2.php but when I try and embed in inside a html page I get a garbled mess http://www.ecurry.net/menu6.php ht

[PHP] Re: global variable declaration

2006-02-08 Thread Barry
suresh kumar wrote: hai, this is my sample code: i am having user table with SponsorID as one field in mysql database,this is my query; for($j=0;$j<5;$j++): $result=mysql_query("select * from user where SponsorID='$id[$j]' "); endfor;

RE: [PHP] global variable declaration

2006-02-08 Thread Jay Blanchard
[snip] for($j=0;$j<5;$j++): $result=mysql_query("select * from user where SponsorID='$id[$j]' "); endfor; in above code when i print mysql_num_rows($result) inside for loop its output is 5.when i print outside the for loop its o/p is 0.I searched weberdev.com website and dec

[PHP] SESSION and include

2006-02-08 Thread Fredrik Tillman
Hi PROBLEM: I want to let certain users use certain funcions on my page. To manage that I start a session and define $_SESSION[user_level] to a value from a mySQL table. So far so good. Users with $_SESSION[user_level]=="1" can access things on the .php page they are on. I made a simple if-st

[PHP] Re: SESSION and include

2006-02-08 Thread Barry
Fredrik Tillman wrote: Hi PROBLEM: I want to let certain users use certain funcions on my page. To manage that I start a session and define $_SESSION[user_level] to a value from a mySQL table. So far so good. Users with $_SESSION[user_level]=="1" can access things on the .php page they are o

RE: [PHP] suggest a cart...

2006-02-08 Thread Dan Parry
(I hope this message works... mail server has been playing up) Zen Cart http://www.zen-cart.com Open source, great support and user contribs HTH Dan -Original Message- From: Ross [mailto:[EMAIL PROTECTED] Sent: 08 February 2006 13:08 To: php-general@lists.php.net Subject: [PHP] sugge

Re: [PHP] global variable declaration

2006-02-08 Thread Miles Thompson
At 10:46 AM 2/8/2006, suresh kumar wrote: hai, this is my sample code: i am having user table with SponsorID as one field in mysql database,this is my query; for($j=0;$j<5;$j++): $result=mysql_query("select * from user where SponsorID='$id[$j]' ")

Re: [PHP] how to show 6 randomly selected featured products?

2006-02-08 Thread afan
I'm still in trouble with this problem :( Solution: $query = my_query(" SELECT p.prod_id, p.prod_name, p.prod_no, chp.cat_id, c.cat_name, c.cat_parent, pr.price FROM products as p LEFT JOIN categories_has_products as chp ON chp.prod_id = p.prod_id LEFT JOIN categories as c ON chp.cat_i

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Fredrik Tillman
ok.. Let me explain the problem better. 'user_level' is set by a login script. It seems to be working fine since I can make things like: if ("1"==$_SESSION[user_level]) { let this stuff happen } on my mainpage. on that same mainpage I use include ("page.php"); (I also tried require...) If I

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Barry
Fredrik Tillman wrote: ok.. Let me explain the problem better. 'user_level' is set by a login script. It seems to be working fine since I can make things like: if ("1"==$_SESSION[user_level]) { let this stuff happen } on my mainpage. on that same mainpage I use include ("page.php"); (I also

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Jochem Maas
Fredrik Tillman wrote: ok.. Let me explain the problem better. 'user_level' is set by a login script. It seems to be working fine since I can make things like: if ("1"==$_SESSION[user_level]) { let this stuff happen } $_SESSION[user_level] is wrong unless 'user_level' is a defined constant

[PHP] Smarty Templates?

2006-02-08 Thread R. Van Tassel
I'm contemplating using Smarty Templates for a website and was wondering what opinions on them, pro or con, may be. Thanks in advance for all your help. -Roy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Fredrik Tillman
ok.. I was a little too fast again when explaining my problem.. Gonna put some code up for you to see... First of all I DO use quotes. I tried both single and double ones (',") Ok here are some code: IN LOGINSCRIPT: "; include 'index.htm'; exit(); } // Convert password to md5 hash $pass

[PHP] php.ini version changed, code broke

2006-02-08 Thread [EMAIL PROTECTED]
Hello all from a newbie. We have a Nitix server (from Net Integration Technologies, Inc.) that hosts various web site. Recently they released a software upgrade, and in the release notes was this warning: "A number of PHP options (in the php.ini file) were changed, either to improve security or

Re: [PHP] Smarty Templates?

2006-02-08 Thread Jochem Maas
starting a new topic by replying to an existing thread is bad form - we know how much work it is to click on the 'new mail' button and fill in an address but please make the effort (it's in your interest as well!). with regard to Smarty why not try searching for existing writing on the subject?

Re: [PHP] php.ini version changed, code broke

2006-02-08 Thread Duncan Hill
On Wednesday 08 February 2006 16:16, [EMAIL PROTECTED] wrote: > What displays???  Just ttt of course.  What exactly could have changed to > make this simple script fail? register_globals probably http://uk.php.net/register_globals -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

RE: [PHP] php.ini version changed, code broke

2006-02-08 Thread Jay Blanchard
[snip] What displays??? Just ttt of course. What exactly could have changed to make this simple script fail? [/snip] register_globals in the php.ini has been set to 'off' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Barry
Fredrik Tillman wrote: IN PAGE.PHP [More code here] Hit me if i am wrong, but doesn't it start a new session here? Would you mind removing the session_start() from that file and test it again? btw please try what i mentioned earlier. it's easier to locate the problem. Thanks. Barry --

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Jochem Maas
your problem is probably the fact that when you include page.php you are in effect calling session_start() twice - no idea what that does to your session but I wouldn't be suprised if that borked the _SESSION array. TIP: create a 'global include file' that contains all the code required by every

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Fredrik Tillman
PROBLEM SOLVED! What I actually was including was a variable ($main) and since some my pages are called on from different pages in different folders what I actually did was seting $main to the full URL to the site (http://mysite.com/page.php) to avoid confusion. But when calling on a URL I gu

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Eric Butera
On 2/8/06, Fredrik Tillman <[EMAIL PROTECTED]> wrote: > Ok here are some code: > /* Check User Script */ > session_start(); // Start Session > > include 'db.php'; > // Convert to simple variables > $username = $_POST['username']; > $password = $_POST['password']; > > if((!$username) || (!$passwo

[PHP] Sending error_log to screen

2006-02-08 Thread Reuben D. Budiardja
Hello, For debugging purposes, I have "display_errors = On" in the /etc/php.ini on my development server. I'm trying to use the error_log() function to log errors, however, the string message does not get send to script output (ie. browser), even with "display_errors = on". I can only see the

Re: [PHP] Re: Array sizes?

2006-02-08 Thread Rory Browne
> At 01:05 AM 2/8/2006, Barry wrote: > >I don't think a "function" exists, but i would probably use (for > >benchmarking) a recursive foreach in combination with strlen. > >And add it all up. > >(This is probably some work for the PC so that's why benchmarking) > > > It would be interesting to know

Re: [PHP] Recompile PHP on pre-installed system

2006-02-08 Thread Rory Browne
If you're using a Redhat Enterprise version with a support contract then I personally don't think you should attempt to run a non-redhat php binary. Instead find out how redhat make their php-mysql or php-ldap or php-{some_other_php_module} rpm, Make an RPM, and install it like you would any other

[PHP] target?

2006-02-08 Thread William Stokes
Hello Is target="_parent" opposite to target="_blank"? Thanks -Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] target?

2006-02-08 Thread Jay Blanchard
[snip] Is target="_parent" opposite to target="_blank"? [/snip] Opposite? no. Not alike? yes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] REGEX query

2006-02-08 Thread phplists
Hi Murray, The length of text is quite long..it is in fact a 150+ page PDF file, which as it's using an earlier version of PDF I can 'translate' into a format that I can extract data from..it's just this one bit of text that I'm stuck on. Yes it does appear multiple times, but the pattern is

Re: [PHP] REGEX query

2006-02-08 Thread Kim Christensen
Alexis, > Unfortunately, for what I'm trying to do, it is of little use. I > probably should have mentioned that the bit of text I used is actually > just part of a much bigger bit of text so exploding on a space would > cause havoc with the rest of it. Hence the REGEX question. $text = '

Re: [PHP] REGEX query

2006-02-08 Thread phplists
>>> > I have this bit of text: >>> > (\(EX\) RV-6 ) >>> > >>> > I want to remove the '\(EX\)' part of it >>> > so leaving just: ( RV-6 ) $text = '(\(EX\) RV-6 )'; $str = str_replace('\(EX\)','',$text); As Burhan put it, regex is not always the solution to your problem - in most cases, using re

Re: [PHP] target?

2006-02-08 Thread William Stokes
I mean. If I open popup named page2.htm from page1.htm with target="_blank" can I go back to page1.htm with target="_parent"? -W "Jay Blanchard" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED] > [snip] > Is target="_parent" opposite to target="_blank"? > [/snip] > > Opposite? no. N

Re: [PHP] Re: Array sizes?

2006-02-08 Thread Anders Norrbring
Rory Browne skrev: At 01:05 AM 2/8/2006, Barry wrote: I don't think a "function" exists, but i would probably use (for benchmarking) a recursive foreach in combination with strlen. And add it all up. (This is probably some work for the PC so that's why benchmarking) It would be interesting to

Re: [PHP] Recompile PHP on pre-installed system

2006-02-08 Thread Justin Cook
Yes, we are using RHE 4 with a support contract. I need to get db2 support compiled in so we can access our AS400 using ODBC. _ From: Rory Browne [mailto:[EMAIL PROTECTED] To: Marcus Bointon [mailto:[EMAIL PROTECTED] Cc: Justin Cook [mailto:[EMAIL PROTECTED], PHP General [mailto:[EMAIL PRO

Re: [PHP] Recompile PHP on pre-installed system

2006-02-08 Thread Dan McCullough
you can use php-odbc make sure you have unixODBC or like install on the system, once you do that its a piece of cake, been doing that here for a few months. On 2/8/06, Justin Cook <[EMAIL PROTECTED]> wrote: > Yes, we are using RHE 4 with a support contract. I need to get db2 support > compiled in

RE: [PHP] target?

2006-02-08 Thread Weber Sites LTD
What you need to do is close page2.htm with JavaScript (window.close) And then page1.htm will be back. To make sure page1 will be back You can reload it with onload=focus() in the . Sincerely berber Visit the Weber Sites Today, To see where PHP might take you tomorrow. PHP code examples :

Re: [PHP] Recompile PHP on pre-installed system

2006-02-08 Thread Justin Cook
Great, I'll do it that way. That sounds easier than what I was attempting to do. Thanks! _ From: Dan McCullough [mailto:[EMAIL PROTECTED] To: php-general@lists.php.net Sent: Wed, 08 Feb 2006 13:23:17 -0600 Subject: Re: [PHP] Recompile PHP on pre-installed system you can use php-odbc make

RE: [PHP] target?

2006-02-08 Thread afan
Let's say you did some change on your popup window (page2.php) if(isset($_POST['change'])) { # your "changes" code here # and, once you are finished you are going to execute the folloving html code ?>