[PHP] PHP based Menu Builder for Flash (by Stephen Fegan)

2005-08-06 Thread Gurdeep Singh (Guru)




Hi All,

I am trying to develop a script that would add/delete/modify the menus
in the Flash (http://www.netsoc.ucd.ie/flash/)
The file that is used to build the menu is "system.menu" located in the
/usr/slocal/lib/flash/ directory.

So far I have made few scripts that would take inputs from the user and
add them into a database. I am stuck on the output part. The idea is to
query database and sent the output of the query to the file system.menu

I have attached my scripts and db file to this email. Any help would be
highly appreciated.

Thanks,
Guru.





-- phpMyAdmin SQL Dump
-- version 2.6.3-pl1
-- http://www.phpmyadmin.net
-- 
-- Host: localhost
-- Generation Time: Aug 06, 2005 at 01:09 PM
-- Server version: 4.1.10
-- PHP Version: 4.3.9
-- 
-- Database: `nterm`
-- 

-- 

-- 
-- Table structure for table `customermenu`
-- 

CREATE TABLE `customermenu` (
  `customermenu` varchar(15) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `customermenu`
-- 

INSERT INTO `customermenu` VALUES ('cust1');
INSERT INTO `customermenu` VALUES ('cust2');
INSERT INTO `customermenu` VALUES ('cust3');

-- 

-- 
-- Table structure for table `devicemenu`
-- 

CREATE TABLE `devicemenu` (
  `ID` int(5) NOT NULL auto_increment,
  `nhid` varchar(15) NOT NULL default '',
  `mainmenu` varchar(15) NOT NULL default '',
  `customermenu` varchar(15) NOT NULL default '',
  `ipaddre` varchar(15) NOT NULL default '',
  `epass` varchar(30) NOT NULL default '',
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

-- 
-- Dumping data for table `devicemenu`
-- 

INSERT INTO `devicemenu` VALUES (2, 'NMMUMGURU', 'Servers', 'company', 
'4.2.2.2', 'lol');

-- 

-- 
-- Table structure for table `mainmenu`
-- 

CREATE TABLE `mainmenu` (
  `mainmenu` varchar(15) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `mainmenu`
-- 

INSERT INTO `mainmenu` VALUES ('Firewalls');
INSERT INTO `mainmenu` VALUES ('Core Devices');
INSERT INTO `mainmenu` VALUES ('Juni Devices');
INSERT INTO `mainmenu` VALUES ('Servers');

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

Re: [PHP] Re: Sending post data from a script

2005-08-06 Thread glumtail
you can try this:

$sock = fsockopen($parse_url['host'], $parse_url['port'], $errno, $errstr, 30);
if (!$sock) {
   die("$errstr ($errno)\r\n");
}

$tmp = explode('&',$parse_url['query']);
$data = NULL;
foreach($tmp as $val) {
   $p = explode('=',$val);
   if(empty($data)) {
   $data  = $p[0] . "=" . urlencode($p[1]);
   } else {
   $data .= "&" . $p[0] . "=" . urlencode($p[1]);
   }
}

fwrite($sock, "POST " . $parse_url['path'] . " HTTP/1.0\r\n");
fwrite($sock, "Host: " . $parse_url['host'] . "\r\n");
fwrite($sock, "Content-type: application/x-www-form-urlencoded\r\n");
fwrite($sock, "Content-length: " . strlen($data) . "\r\n");
fwrite($sock, "Accept: */*\r\n");
fwrite($sock, "\r\n");
fwrite($sock, "$data\r\n");
fwrite($sock, "\r\n");

$body = "";
while (!feof($sock)) {
   $body .= fgets($sock, 4096);
}

fclose($sock);

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



Re: [PHP] Return Path

2005-08-06 Thread Sebastian

try using -f

mail($toemail, $subject, $message, $from, '-f [EMAIL PROTECTED]');

[EMAIL PROTECTED] wrote:

I don't seem to be able to set the "return path" using the mail() function. I can't figure out why "from" will let me set it, but not the return path. 


$headers = 'From: [EMAIL PROTECTED]' . "\r\n" .
  'Return-path: [EMAIL PROTECTED]' . "\r\n" .
  'X-Mailer: PHP/' . phpversion();

mail($email, $subject, $message, $headers);


Any thoughts?

Andrew Darrow
Kronos1 Productions
www.pudlz.com


 




--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.1/64 - Release Date: 8/4/2005

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



Re: [PHP] Can I retrieve a stored php session variable from within a javascript function?

2005-08-06 Thread Burhan Khalid

Mauricio Pellegrini wrote:
Hi , 
I wonder if it's possible to retrieve the value from a php session

variable from within a javascript function.

Does anyone have any ideas about this?


No. You cannot retrieve it, restore it, read it, send it, anything else.

You can write it from PHP :

echo 'var sess = 
'.$_SESSION['somevar'].'';


But that's it.

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



Re: [PHP] Average time spent on a page


[EMAIL PROTECTED] wrote:

Hi,

How can i found out the average time users spent on a page. Anyone know a 
tutorial?

Thanks in advance for your help !!!


PLEASE ONLY SEND YOUR MESSAGE ONCE!!!

Also, remember that google is your friend.

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



Re: [PHP] Return Path [SOLVED]

Works great. Thank you.

Although I swear I tried that last night. Eh I probably messed something up.

Andrew Darrow
Kronos1 Productions
www.pudlz.com


- Original Message - 
From: "Sebastian" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: 
Sent: Saturday, August 06, 2005 6:12 AM
Subject: Re: [PHP] Return Path


> try using -f
>
> mail($toemail, $subject, $message, $from, '-f [EMAIL PROTECTED]');
>
> [EMAIL PROTECTED] wrote:
>
> >I don't seem to be able to set the "return path" using the mail()
function. I can't figure out why "from" will let me set it, but not the
return path.
> >
> >$headers = 'From: [EMAIL PROTECTED]' . "\r\n" .
> >   'Return-path: [EMAIL PROTECTED]' . "\r\n" .
> >   'X-Mailer: PHP/' . phpversion();
> >
> >mail($email, $subject, $message, $headers);
> >
> >
> >Any thoughts?
> >
> >Andrew Darrow
> >Kronos1 Productions
> >www.pudlz.com
> >
> >
> >
> >
>
>
> -- 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.338 / Virus Database: 267.10.1/64 - Release Date: 8/4/2005
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.338 / Virus Database: 267.10.1/64 - Release Date: 8/4/2005
>
>

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



Re: [PHP] Can I retrieve a stored php session variable from within a javascript function?


Quoting Mauricio Pellegrini <[EMAIL PROTECTED]>:


Hi ,
I wonder if it's possible to retrieve the value from a php session
variable from within a javascript function.


I'm no PHP expert, but I'll give it a try (there are plenty of smart 
people on this list who will correct me if Im wrong :-)



Does anyone have any ideas about this?


Yes, two of the top of my head.

1. You can send the session variable to the client along with the script.

ex.
function doSomething()
{
  sessVar = ;

  // Do some stuff.
}

Of course, sessVar won't be updated if the session variable changes 
unless the script is reloaded.


2. My favorite, but probably overkill. Write a php page that outputs 
the session variables (as XML would be cool). Then use xmlhttprequest 
to retrieve them from javascript (Google AJAX for more information).


Hope this helps,
Rick
--
Rick Emery

"When once you have tasted flight, you will forever walk the Earth
with your eyes turned skyward, for there you have been, and there
you will always long to return"
 -- Leonardo Da Vinci

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



[PHP] Bug or programmer-error?

Dear PHP_friends,

 

I have found a strange behaviour of the "include"  function.

 

Here it is .

 

// 1. this works fine 

include ("../../gps_info/fetch_fields.php");

// 2. this works fine

$doc_root=$_SERVER[DOCUMENT_ROOT];

include
("$doc_root"."/pages/gps_info/fetch_fields.php");

// 3. this open the doc fetch_fields.php allright, but variables
that have been set outside fetchfields.php are not available within
fetch_fields.php

$root= 'webserver-2';

include
("$root"."/pages/gps_info/fetch_fields.php");

 

 

Does anybody have a clou as to what's wrong here?

 

 

Best regards/ Met vriendelijke groet,

Rob Ziere

Webmaster/beheerder GO-GPS.nl, alles over GPS en wandelen

http://www.go-gps.nl

 

 



Re: [PHP] Bug or programmer-error?


Rob Ziere wrote:


Dear PHP_friends,



I have found a strange behaviour of the "include"  function.



Here it is .



   // 1. this works fine 


   include ("../../gps_info/fetch_fields.php");

   // 2. this works fine

   $doc_root=$_SERVER[DOCUMENT_ROOT];

   include
("$doc_root"."/pages/gps_info/fetch_fields.php");

   // 3. this open the doc fetch_fields.php allright, but variables
that have been set outside fetchfields.php are not available within
fetch_fields.php
 



You could try calling a var with global first

global $variable

(reference: http://nl2.php.net/global )


   $root= 'webserver-2';

   include
("$root"."/pages/gps_info/fetch_fields.php");





Does anybody have a clou as to what's wrong here?





Best regards/ Met vriendelijke groet,

Rob Ziere

Webmaster/beheerder GO-GPS.nl, alles over GPS en wandelen

http://www.go-gps.nl






 



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



Re: [PHP] how to check http:// or https:// ?


[EMAIL PROTECTED] wrote:

Right. Tested and found $_SERVER['HTTPS'] has to be 'on'  :)

But, there is something in the code Jochem wrote that bothers me for a 
while:


if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') {
   echo 'you are secure(-ish?)';   }

Doesn't
$_SERVER['HTTPS']=='on'
automatically means
isset($_SERVER['HTTPS'])
?



indeed - I'm a bit of correctness freak  like that - without the isset
an E_NOTICE is generated - which you could supress:

if('on' == @$_SERVER['HTTPS']) {
// yes!
}

(others are speed freaks - and will
probably go for the E_NOTICE :-) - although I have no idea whether thats even 
any faster
than calling isset() as the E_NOTICE generation must all have _some_ overhead,
and how error supression affects performance. regardless the difference if 
probably
almost immeasurable.)


I mean, if $_SERVER['HTTPS'] exists doesn't mean it's equal to 'on'
but if $_SERVER['HTTPS'] == 'on' IT MEANS $_SERVER['HTTPS'] exists

why then
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on')


-afan


Jochem Maas wrote:


Marco Tabini wrote:


On 8/5/05 2:43 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:



Thanks Marco!
:)

I was looking for something like this on phpinfo() but didn't found?





That's because it shows up only if you are under HTTPS! :-)




AFAICT tell you should check whether the value is actually set to 'on'
(IIRC a post by Rasmus):

e.g.

if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') {
echo 'you are secure(-ish?)';   }

SIDENOTE REGARDING BEEBLEX.COM:

I just added a bookmark in firefox to beeblex.com as follows

http://beeblex.com/search.php?d=ALLDB&s=%s
and I gave it a keyword of 'beeb'

now I can go to firefox and type 'beeb HTTPS' to get an direct hit -
so now there is no excuse not to be using Marco's cool new resource :-)




Marco




-afan

Marco Tabini wrote:



IIRC, if you're using Apache you can check

If (isset ($_SERVER['HTTPS']))

You can also check this thread:

http://beeblex.com/lists/index.php/php.general/190410?h=%24_SERVER%5B%27HTTP 


S%27%5D

--
BeebleX - The PHP Search Engine
http://beeblex.com

On 8/5/05 2:05 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:





Hi,
I need to check does URL use http or https?

Right now I use this code:

if(preg_match('/https:/', $_SERVER['SCRIPT_URI']) == false)
{
 header('location: [URL]https://www.test.com/test.php[/URL]');
 exit;
}

but I am sure there is much better solution.
:)
 






















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



Re: FW: [PHP] [NEWBIE GUIDE] For the benefit of new members


Rick Emery wrote:

Quoting "Chris W. Parker" <[EMAIL PROTECTED]>:


Rick Emery 
   on Friday, August 05, 2005 4:54 PM said:


Well, as I found out when I Google'd before I posted, it *lists*
plenty of JavaScript mailing lists. But it can hardly "recommend a
good" one, which is what I asked for, can it? I was soliciting
opinions.



Yes I know, but I was hoping you wouldn't notice (because that's what
makes the joke so great)! :)


lol.




Oh, I get it now :-)

There has been a lot mentioned lately about checking Google before 
posting, and I didn't want anyone to think that I hadn't Google'd before 


we have a whole army doing this constantly ;-)

I posted (I've actually joined a mailing list I found that way, but was 
looking for good recommendations). I apologize if I came off a little 
defensive.


Thanks,
Rick


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



Re: [PHP] Average time spent on a page


[EMAIL PROTECTED] wrote:


Hi,

How can i found out the average time users spent on a page. Anyone know a 
tutorial?

Thanks in advance for your help !!!
 



A hello world page will take me around 15 secs I guess...
A full blown website with everything you can imagine a few months orso.

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



[PHP] sorry for asking here,a small apache query

Hi all,
 
I am sorry for asking in php forum.i am subscribed to php and not to apache.but 
i hope many people in this group also the solution to this query.
 
how can i configure apache so that users are  forbidden to see my docroot file 
structure.
for example i have a file at http://localhost/dir1/xyz.html , if the user try 
to access http://localhost, or  http://localhost/dir1 he shud get a message 
forbidden.
 
Thanks
babu.


-
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre.

Re: [PHP] Average time spent on a page


LOL. This got nothing to do with my question . LOL again

- Original Message - 
From: "Frank de Bot" <[EMAIL PROTECTED]>

Cc: 
Sent: Saturday, August 06, 2005 10:20 PM
Subject: Re: [PHP] Average time spent on a page



[EMAIL PROTECTED] wrote:


Hi,

How can i found out the average time users spent on a page. Anyone know a 
tutorial?


Thanks in advance for your help !!!



A hello world page will take me around 15 secs I guess...
A full blown website with everything you can imagine a few months orso.

--
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] Average time spent on a page


Guess what? I've googled for it and nothing

- Original Message - 
From: "Burhan Khalid" <[EMAIL PROTECTED]>

To: <[EMAIL PROTECTED]>
Cc: 
Sent: Saturday, August 06, 2005 5:07 PM
Subject: Re: [PHP] Average time spent on a page



[EMAIL PROTECTED] wrote:

Hi,

How can i found out the average time users spent on a page. Anyone know a 
tutorial?


Thanks in advance for your help !!!


PLEASE ONLY SEND YOUR MESSAGE ONCE!!!

Also, remember that google is your friend. 


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



[PHP] Fast count of recordset in php...


Hello there!

How do i get a fast count of a recordset in php?

Look at this code:

   $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'";

   $querys = mysql_query($sql);

   //Count products in db
   //
   $dbArray = mysql_fetch_array($querys);
   $nrOfProducts = $dbArray["cn"];


It's slow... Why? Any suggestions?

/mr G
@varupiraten.se

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



Re: [PHP] sorry for asking here,a small apache query


babu wrote:


Hi all,

I am sorry for asking in php forum.i am subscribed to php and not to apache.but 
i hope many people in this group also the solution to this query.


If you know you are in wrong place why ask here?

Alan

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



Re: [PHP] Fast count of recordset in php...


$num=mysql_num_rows($sql);

Gustav Wiberg wrote:


Hello there!

How do i get a fast count of a recordset in php?

Look at this code:

   $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'";

   $querys = mysql_query($sql);

   //Count products in db
   //
   $dbArray = mysql_fetch_array($querys);
   $nrOfProducts = $dbArray["cn"];


It's slow... Why? Any suggestions?

/mr G
@varupiraten.se



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



[PHP] Re: [PHP-DEV] Re: [PHP] Exceptions: function x throws Exception

Hello Jochem,

  lookup the archieves. We have long ago decided agains that.

marcus

Friday, August 5, 2005, 2:26:04 PM, you wrote:

> Dear Internals,

> class FooBar { public function foo() throws Exception {} }
> function fooFoo() throws Exception {}

> this came up on php-generals and I wondered if anyone had time/cared
> to comment if it (as it does to me) seems like a good idea and/or whether it 
> is
> technically feasable. My thinking was that one could then use the reflection 
> API
> to determine whether functions/methods are capable of throwing exceptions and 
> or
> what kind - might be quite handy when using third party apps/classes
> (PEAR springs to mind.)

> thanks and regards,
> Jochem


> 

> Torgny Bjers wrote:
>> Norbert Wenzel wrote:
>> 
>>>If there is a class with a function, that might throw exceptions and
>>>does NOT catch them, may I write that like in Java?
>>>
>>>class FooClass {
>>>
>>>public function foo() throws Exception {

> think about this, especially in terms of the Reflection API, it sounds
> like a really good idea (at least to me)

>>>
>>>}
>>>
>>>}
>>>
>>>Or is there another possibility to tell a function throws an exception
>>>and to force the caller to handle that exception?
>>>
>>>thanks in advance,
>>>
>>>Norbert
>>>
>> 
>> 
>> Hello Norbert,
>> 
>> The Java way doesn't work here. The best approach would be to simply run
>> a try/catch/finally around the call to your function/method, and inside
>> the function itself you do the following:
>> 
>> if (...) { throw new Exception("My message."); } }
>> 

> indeed - bottom line is you have to know that a function/method/extension may
> throw. mostly you do know because:

> 1. you wrote the code,
> 2. or it's documented in the extension manual pages
> 3. and/ro you hit an unacaught exception whilst developing.

> my approach to cover any oversights is to wrap every thing in a main 
> try/catch block
> just in case - keeping in mind that the idea is that this 'main' catch block 
> is never run
> is al goes well.

>> Regards,
>> Torgny
>> 




Best regards,
 Marcus

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



Re: [PHP] Fast count of recordset in php...

you'd be suprized how fast an index can be.. you should read the manual 
on indexes,

http://dev.mysql.com/doc/mysql/en/mysql-indexes.html

"If a table has 1,000 rows, this is at least 100 times faster than 
reading sequentially"


while you may not get 100x faster, it will be faster than having no 
index.. also try using mysql_num_rows()


$sql = mysql_query("SELECT col FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'");

// record count
echo mysql_num_rows($sql);


PS, 'reply all' to list.

Gustav Wiberg wrote:


Hi there!

There are about 300 records.
You're right, I can add an index, but Is that the only way to get a 
faster solution?


/mr G
@varupiraten.se

- Original Message - From: "Sebastian" 
<[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Sent: Saturday, August 06, 2005 11:08 PM
Subject: Re: [PHP] Fast count of recordset in php...


how many records in the table? its going to be slow no matter what, 
especially if you have a lot of records.. your searching each record 
then counting them.. do you have any indexes? judging by your query 
you can add index on Varunamn and it should be more speedy..


Gustav Wiberg wrote:


Hello there!

How do i get a fast count of a recordset in php?

Look at this code:

   $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'";

   $querys = mysql_query($sql);

   //Count products in db
   //
   $dbArray = mysql_fetch_array($querys);
   $nrOfProducts = $dbArray["cn"];


It's slow... Why? Any suggestions?

/mr G
@varupiraten.se




--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.1/64 - Release Date: 8/4/2005



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.0/63 - Release Date: 
2005-08-03











--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.1/64 - Release Date: 8/4/2005

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



Re: [PHP] Re: PHP 5.0.4 on AMD64

that chcon did the trick, thanks.

Joe

Joseph Oaks ([EMAIL PROTECTED]) wrote:
>
> Thanks, I will give that a try, and let you know.
>
> Joe
>
> Holografix ([EMAIL PROTECTED]) wrote:
> >
> > Hi
> >
> > Take a look here: http://forums.fedoraforum.org/showthread.php?t=59163
> >
> > I had that problem too.
> >
> > Regards
> > holografix
> >
> >
> > ""Joseph Oaks"" <[EMAIL PROTECTED]> escreveu na mensagem
> > news:[EMAIL PROTECTED]
> > > So, heres the deal, I'm running Fedora Core 3 on an dual proc AMD64
> > > system.
> > >
> > > I have compiled Apache 2.0.54, and PHP 5.0.4, when I try to start apache
> > > I am given an error. The error is as follows...
> > >
> > > [EMAIL PROTECTED] conf]# /etc/rc.d/init.d/httpd start
> > > Starting httpd: Syntax error on line 24 of
> > > /opt/apache-2.0.54/conf/httpd.conf:
> > > Cannot load /opt/apache-2.0.54/modules/libphp5.so into server:
> > > /opt/apache-2.0.54/modules/libphp5.so: cannot restore segment prot after
> > > reloc:
> > > Permission denied
> > >
> > > The only thing I'm finding on google is about /usr/lib64 well I don't have
> > > a
> > > /usr/lib64, its just /usr/lib so that can't be the issue.
> > >
> > > Any suggestion would be appreciated.
> > > thanks
> > >
> > > Joe
> > >
> > > --
> > > "Computers are like air conditioners - they stop working properly when you
> > > open Windows"
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> --
> "Computers are like air conditioners - they stop working properly when you
> open Windows"
>
>
>
>

-- 
"Computers are like air conditioners - they stop working properly when you
open Windows"

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



Re: [PHP] PHP 4.3.9 - Undefined variable: authed in


Trevor Tregoweth wrote:

Hi There




point 1: you started a new thread by replying to an existing thread - BAD.
point 2: the errors (notices) are telling you something. read them.
if you don't understand them, try google first, then php.net

hint: your php config has changed - error reporting has been set
to also show E_NOTICE level errors. change it back and you won't see
them any more (they were alway there btw). e.g.

error_reporting( error_reporting() & ^E_NOTICE ); // don't show notices


or set display_errors ini directive in php.ini


I am trying to run a simple password /php / mysql script for a web page and
get the following errors, it works fine on a earlier versions of php / mysql


PHP Notice: Undefined variable: help_out_uid in
/var/www/html/lcc/secure/secure.php on line 87, 


PHP Notice: Undefined variable: authed in
/var/www/html/lcc/secure/secure.php on line 34

mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386)

PHP 4.3.9 (cgi) (built: Oct 20 2004 14:52:04)

 

Thanks for you help 


Trevor



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



[PHP] PHP 4.3.9 - Undefined variable: authed in

Hi There


I am trying to run a simple password /php / mysql script for a web page and
get the following errors, it works fine on a earlier versions of php / mysql


PHP Notice: Undefined variable: help_out_uid in
/var/www/html/lcc/secure/secure.php on line 87, 

PHP Notice: Undefined variable: authed in
/var/www/html/lcc/secure/secure.php on line 34

mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386)

PHP 4.3.9 (cgi) (built: Oct 20 2004 14:52:04)

 

Thanks for you help 

Trevor

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



[PHP] Re: [PHP-DEV] Re: [PHP] Exceptions: function x throws Exception


Marcus Boerger wrote:

Hello Jochem,

  lookup the archieves. We have long ago decided agains that.


I'll take your word on it. :-) (shame on me for not searching harder
before asking)

thanks for replying.



marcus

Friday, August 5, 2005, 2:26:04 PM, you wrote:



Dear Internals,




class FooBar { public function foo() throws Exception {} }
function fooFoo() throws Exception {}




   this came up on php-generals and I wondered if anyone had time/cared
to comment if it (as it does to me) seems like a good idea and/or whether it is
technically feasable. My thinking was that one could then use the reflection API
to determine whether functions/methods are capable of throwing exceptions and or
what kind - might be quite handy when using third party apps/classes
(PEAR springs to mind.)




thanks and regards,
Jochem










Torgny Bjers wrote:


Norbert Wenzel wrote:



If there is a class with a function, that might throw exceptions and
does NOT catch them, may I write that like in Java?

class FooClass {

  public function foo() throws Exception {




think about this, especially in terms of the Reflection API, it sounds
like a really good idea (at least to me)




  }

}

Or is there another possibility to tell a function throws an exception
and to force the caller to handle that exception?

thanks in advance,

Norbert




Hello Norbert,

The Java way doesn't work here. The best approach would be to simply run
a try/catch/finally around the call to your function/method, and inside
the function itself you do the following:

if (...) { throw new Exception("My message."); } }





indeed - bottom line is you have to know that a function/method/extension may
throw. mostly you do know because:




1. you wrote the code,
2. or it's documented in the extension manual pages
3. and/ro you hit an unacaught exception whilst developing.




my approach to cover any oversights is to wrap every thing in a main try/catch 
block
just in case - keeping in mind that the idea is that this 'main' catch block is 
never run
is al goes well.




Regards,
Torgny







Best regards,
 Marcus



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



Re: [PHP] varibles defination

[EMAIL PROTECTED] wrote:
>>>How can we define and display the varibles by using for loop
>>>function ?
>>
>>>for ($x=0;$x<10;$x++){
>>  $func[$x]=$x;
>>}
>>print_r($func);
>>?>
> 
> 
> If I want to define a set of varibles ( two dimension array, eg : $func[0,0] )

$func[0,0] is not valid syntax. you mean $func[0][0]

> and via the varibles of form tag ( format, eg : $_GET["varname"] or
> $_POST["varname"] )...
> How about the example ?

watch what happen to $_POST when you stick these fields in your form
and submit it:









> 
> Edward.
> 

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



Re: [PHP] Average time spent on a page

Try using one of the log reader/analysis packages available for Apache or
try doing it urself. 
 Are you looking for the algorithm? let me know.

 On 8/6/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: 
> 
> LOL. This got nothing to do with my question . LOL again
> 
> - Original Message -
> From: "Frank de Bot" <[EMAIL PROTECTED]>
> Cc: 
> Sent: Saturday, August 06, 2005 10:20 PM
> Subject: Re: [PHP] Average time spent on a page
> 
> 
> > [EMAIL PROTECTED] wrote:
> >
> >>Hi,
> >>
> >>How can i found out the average time users spent on a page. Anyone know 
> a
> >>tutorial?
> >>
> >>Thanks in advance for your help !!!
> >>
> >
> > A hello world page will take me around 15 secs I guess...
> > A full blown website with everything you can imagine a few months orso.
> >
> > --
> > 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
> 
> 


-- 
M.Saleh.E.G
97150-4779817


[PHP] mkdir, Shared Hosting?

Hi,

I'm using Shared Hosting and I was told - then I learned from  trial and  
error - that you can't use mkdir on Shared Hosting... is  this *100%* true? 
is  
there a way around it?

I  get:

Warning:  mkdir(/home/***/public_html/test/): Permission denied  in  
/home/***/public_html/test.php on line 3 

So, again, is  there any possible way around this? I've Googled,  read the 
manual but  it seems that If I don't get an Error - I get nothing at  all,  
including the directory.

Thanks for any help!

-  Clint



RE: [PHP] mkdir, Shared Hosting?

As far as I know, it's not a shared hosting issue, but a permission issue.
The site admin has not given the user under which your php scripts run
permission to create directories and most likely files and other file system
operations.  It's a security issue.

Robbert

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 06, 2005 8:53 PM
To: php-general@lists.php.net
Subject: [PHP] mkdir, Shared Hosting?

Hi,

I'm using Shared Hosting and I was told - then I learned from  trial and  
error - that you can't use mkdir on Shared Hosting... is  this *100%* true? 
is  
there a way around it?

I  get:

Warning:  mkdir(/home/***/public_html/test/): Permission denied  in  
/home/***/public_html/test.php on line 3 

So, again, is  there any possible way around this? I've Googled,  read the 
manual but  it seems that If I don't get an Error - I get nothing at  all,  
including the directory.

Thanks for any help!

-  Clint

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



Re: [PHP] Fast count of recordset in php...


if you just wana get count of recordset,
don't do this:
$sql = mysql_query("SELECT col FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'");

// record count
echo mysql_num_rows($sql);

be coz this way is slow and costs more overload.

   $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'";

   $querys = mysql_query($sql);

   //Count products in db
   //
   $dbArray = mysql_fetch_row($querys);
   $nrOfProducts = $dbArray[0];

Sebastian wrote:
you'd be suprized how fast an index can be.. you should read the manual 
on indexes,

http://dev.mysql.com/doc/mysql/en/mysql-indexes.html

"If a table has 1,000 rows, this is at least 100 times faster than 
reading sequentially"


while you may not get 100x faster, it will be faster than having no 
index.. also try using mysql_num_rows()


$sql = mysql_query("SELECT col FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'");

// record count
echo mysql_num_rows($sql);


PS, 'reply all' to list.

Gustav Wiberg wrote:


Hi there!

There are about 300 records.
You're right, I can add an index, but Is that the only way to get a 
faster solution?


/mr G
@varupiraten.se

- Original Message - From: "Sebastian" 
<[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Sent: Saturday, August 06, 2005 11:08 PM
Subject: Re: [PHP] Fast count of recordset in php...


how many records in the table? its going to be slow no matter what, 
especially if you have a lot of records.. your searching each record 
then counting them.. do you have any indexes? judging by your query 
you can add index on Varunamn and it should be more speedy..


Gustav Wiberg wrote:


Hello there!

How do i get a fast count of a recordset in php?

Look at this code:

   $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'";

   $querys = mysql_query($sql);

   //Count products in db
   //
   $dbArray = mysql_fetch_array($querys);
   $nrOfProducts = $dbArray["cn"];


It's slow... Why? Any suggestions?

/mr G
@varupiraten.se


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



Re: [PHP] mkdir, Shared Hosting?

 
In a message dated 8/6/2005 10:59:44 P.M. Central Standard Time,  
[EMAIL PROTECTED] writes:

As far  as I know, it's not a shared hosting issue, but a permission issue.
The  site admin has not given the user under which your php scripts  run
permission to create directories and most likely files and other file  system
operations.  It's a security  issue.

Robbert


 
I see... I guess I could ask to see if I could get permission to do so  then? 
lol never hurts to ask :)
 
Thanks,
 
Clint



Re: [PHP] mkdir, Shared Hosting?


[EMAIL PROTECTED] wrote:
 
In a message dated 8/6/2005 10:59:44 P.M. Central Standard Time,  
[EMAIL PROTECTED] writes:


As far  as I know, it's not a shared hosting issue, but a permission issue.
The  site admin has not given the user under which your php scripts  run
permission to create directories and most likely files and other file  system
operations.  It's a security  issue.

Robbert


 
I see... I guess I could ask to see if I could get permission to do so  then? 
lol never hurts to ask :)


Open up your FTP client and log into your website, then change the 
permissions on your folder so that the apache process has write access 
to it.  Its really hit and miss depending on your setup.


The sure fire way (but highly insecure) way is to change the permissions 
to the directory in question to 777.


A better solution would be 755, but it may not work.

Try it, and see what you get.

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



Re: [PHP] Fast count of recordset in php...


Hi again!

Thanx!!! I think this will help a lot!!!

/mr G
@varupiraten.se


- Original Message - 
From: "TalkativeDoggy" <[EMAIL PROTECTED]>

To: "Sebastian" <[EMAIL PROTECTED]>
Cc: "Gustav Wiberg" <[EMAIL PROTECTED]>; 
Sent: Sunday, August 07, 2005 6:04 AM
Subject: Re: [PHP] Fast count of recordset in php...



if you just wana get count of recordset,
don't do this:
$sql = mysql_query("SELECT col FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'");

// record count
echo mysql_num_rows($sql);

be coz this way is slow and costs more overload.

   $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'";

   $querys = mysql_query($sql);

   //Count products in db
   //
   $dbArray = mysql_fetch_row($querys);
   $nrOfProducts = $dbArray[0];

Sebastian wrote:
you'd be suprized how fast an index can be.. you should read the manual 
on indexes,

http://dev.mysql.com/doc/mysql/en/mysql-indexes.html

"If a table has 1,000 rows, this is at least 100 times faster than 
reading sequentially"


while you may not get 100x faster, it will be faster than having no 
index.. also try using mysql_num_rows()


$sql = mysql_query("SELECT col FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'");

// record count
echo mysql_num_rows($sql);


PS, 'reply all' to list.

Gustav Wiberg wrote:


Hi there!

There are about 300 records.
You're right, I can add an index, but Is that the only way to get a 
faster solution?


/mr G
@varupiraten.se

- Original Message - From: "Sebastian" 
<[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Sent: Saturday, August 06, 2005 11:08 PM
Subject: Re: [PHP] Fast count of recordset in php...


how many records in the table? its going to be slow no matter what, 
especially if you have a lot of records.. your searching each record 
then counting them.. do you have any indexes? judging by your query 
you can add index on Varunamn and it should be more speedy..


Gustav Wiberg wrote:


Hello there!

How do i get a fast count of a recordset in php?

Look at this code:

   $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE 
'$checkLev%'";

   $querys = mysql_query($sql);

   //Count products in db
   //
   $dbArray = mysql_fetch_array($querys);
   $nrOfProducts = $dbArray["cn"];


It's slow... Why? Any suggestions?

/mr G
@varupiraten.se


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



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.0/63 - Release Date: 2005-08-03




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