Re: [PHP] One last try at this!

2007-01-18 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-17 17:02:12 -0800:
 Beauford wrote:
  if(!preg_match(/^[-A-Za-z0-9_.' ]+$/, $string)) {
  return Invalid Characters;
 }

 In your regex you have a .  this will match anything
 
 try this:
 
 plaintext?php
 
 function ValidateString($string) {
   if ( preg_match(/[^a-zA-Z0-9\_\.\' -]+/, $string) ) {
   return Invalid Characters;
   }
   return false;
 }

That . is inside a character class where it is a literal character
(matches only .).  Why are you backslashing the underscore is beyond
me.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] Scope of include

2007-01-18 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-17 21:49:05 -0800:
 Hello php list:
 If I include a php script inside a php function definition and then
 call the function in another script. What is the scope of variables in
 the included script? Are they local to the function that calls include
 with the file name?

Yes.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] is there another way ??

2007-01-18 Thread clive

Ali Nasser wrote:

can you please check these out and  tell me if there another way without
installing externsions??


no sorry I cant check for you!



http://groups-beta.google.com/group/cpdevgroup/web/how-easy-is-these-project?_done=%2Fgroup%2Fcpdevgroup%2Fweb%2Fhow-easy-is-these-project%3Fmsg%3Dns 





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



Re: [PHP] $_SESSION variable gets lost on FORM action

2007-01-18 Thread Nuno Vaz Oliveira

Roman:
[...]
You don't need to know your IP. See the grammar for AbsoluteURI:
ftp://ftp.rfc-editor.org/in-notes/rfc2396.txt


I'm asking this because my IP is dynamic and I'm using a free
redirection
service. My site is at 'http://something.no-ip.org/sitename' can I
use
'http://something.no-ip.org/sitename/index.php?vaz=value' on the
Locarion header?

Actually you *must* use it instead of just the index... part.



Thank you Roman, I'm now working with absolute paths! :)

I Never thought that HTML had those specs...
With the relative link it worked and so it was OK for me...

Bye

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



Re: [PHP] Php coding help - Newbie question

2007-01-18 Thread Ramdas

On 1/17/07, Jochem Maas [EMAIL PROTECTED] wrote:

Ramdas wrote:
 Hi Group,

 A very newbie question. Might be discussed earlier, please forgive.

Are so much of a noob that STFW is not within your capabilities?
(just thought I'd ask, given that you admit to realising the info *might*
be out there already)


 I am having a site in PHP ( not very great design ) which I need to
 convert/modify to use functions. Such the code for connecting /
 binding to Ldap is not repeated  scripts are more readable.

 The site deals with modifying / adding / deleting entries in a LDAP dir.

 In each of the pages following is done:

 ?php

 require 'validate.php' ;// validate.php checks if the user is loged in

 $connect = ldap_connect(ldapserver);
 if ($connect) {

 bind ...
 do the things

 }else { echo erro..}

 ?


 Also please advice what is a correct method of checking the user's
 session. Currenlty I use a HTTP_SESSION_VARS variable to store the

recommended to use the $_SESSION superglobal instead and stuff values
directly into (after having called session_start()) instead of using 
session_register()
et al.

 user's login  passwd . Each time the user hits the page these vars

you only need to store *whether* they are logged in - and set that value when 
you
actually handle a login attempt (obviously storing their username could be 
handy)

I don't see any reason to store the passwd and validate against ldap on
every request ... in fact I believe that storing the pwd in such a way is 
essentially less
secure.

 are checked with the existing values in the LDAP (this is done by
 validate.php).

 Please suggest me some good starting point where I can start a fresh
 with more compact/cleaner Code.

that question is about as vague as 'how long is a chinaman?'
(the answer to that question being 'yes he is')

here are some very vague ideas/functions:

an include file ...
=== 8 =
?php
function sessionCheck()
{
   if (!isset($_SESSION['loggedin']) || !$_SESSION['loggedin']) {
   /* show login page then .. */
   exit;
   }
}

function doLogin($username, $passwd)
{
   $_SESSION['loggedin'] = false;
   if (/* given $username+$passwd check outs in ldap*/)
   $_SESSION['loggedin'] = true;

   return $_SESSION['loggedin'];
}
?

an 'init' include file
=== 8 =
?php

require 'your-include-file.php'; // see above


session_start();

if (isset($_POST['uname'], $_POST['pwd'])) {
   doLogin($_POST['uname'], $_POST['pwd']);
}

sessionCheck();

?

any other file (other than the login 'page')
=== 8 =
?php

require 'your-init-file.php';

// we are logged in - it's magic

// do some shit

// the end, congrats go get laid :-)

?



Thanx for the all responses.

Regards
Ram

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



Re: [PHP] $_SESSION variable gets lost on FORM action

2007-01-18 Thread pub


On Jan 18, 2007, at 12:59 AM, Nuno Vaz Oliveira wrote:


Roman:
[...]
You don't need to know your IP. See the grammar for AbsoluteURI:
ftp://ftp.rfc-editor.org/in-notes/rfc2396.txt

I'm asking this because my IP is dynamic and I'm using a free
redirection
service. My site is at 'http://something.no-ip.org/sitename' can I
use
'http://something.no-ip.org/sitename/index.php?vaz=value' on the
Locarion header?

Actually you *must* use it instead of just the index... part.


Thank you Roman, I'm now working with absolute paths! :)

I Never thought that HTML had those specs...
With the relative link it worked and so it was OK for me...

Bye

--
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] Newbie - help with a foreach

2007-01-18 Thread pub
Could someone please help me figure out how to hide the info in the  
right bottom part of my page unless the corresponding link is  
selected in the top left.


The company names and job types at the top left need to show at all  
time. But the corresponding picture at the bottom left and the web  
address/info at the bottom right should appear only when selected.


I have the same query repeating twice once for the top left part and  
once for the bottom right part because I can't figure out how else to  
do it!


Thank you.

http://www.squareinch.net/single_page_t2.php?art=btw_logo.jpg

Re: [PHP] Newbie - help with a foreach

2007-01-18 Thread Németh Zoltán
I can't really understand what your problem is, because it seems to me
that the site is working like you want it to work. Or not?

And if there is a problem with the code then please show us the code
somehow, not the resulting webpage

greets
Zoltán Németh

On cs, 2007-01-18 at 01:31 -0800, pub wrote:
 Could someone please help me figure out how to hide the info in the  
 right bottom part of my page unless the corresponding link is  
 selected in the top left.
 
 The company names and job types at the top left need to show at all  
 time. But the corresponding picture at the bottom left and the web  
 address/info at the bottom right should appear only when selected.
 
 I have the same query repeating twice once for the top left part and  
 once for the bottom right part because I can't figure out how else to  
 do it!
 
 Thank you.
 
 http://www.squareinch.net/single_page_t2.php?art=btw_logo.jpg

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



Re: [PHP] One last try at this!

2007-01-18 Thread Jim Lucas

Roman Neuhauser wrote:

# [EMAIL PROTECTED] / 2007-01-17 17:02:12 -0800:

Beauford wrote:

if(!preg_match(/^[-A-Za-z0-9_.' ]+$/, $string)) {
return Invalid Characters;
}   



In your regex you have a .  this will match anything

try this:

plaintext?php

function ValidateString($string) {
if ( preg_match(/[^a-zA-Z0-9\_\.\' -]+/, $string) ) {
return Invalid Characters;
}
return false;
}


That . is inside a character class where it is a literal character
(matches only .).  Why are you backslashing the underscore is beyond
me.


This is fine, is there any harm in escaping them?
The match will work either way right?

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



Re: [PHP] One last try at this!

2007-01-18 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-18 01:48:25 -0800:
 Roman Neuhauser wrote:
 # [EMAIL PROTECTED] / 2007-01-17 17:02:12 -0800:
 Beauford wrote:
if(!preg_match(/^[-A-Za-z0-9_.' ]+$/, $string)) {
return Invalid Characters;
 }  
 
 In your regex you have a .  this will match anything
 
 try this:
 
 plaintext?php
 
 function ValidateString($string) {
 if ( preg_match(/[^a-zA-Z0-9\_\.\' -]+/, $string) ) {
 return Invalid Characters;
 }
 return false;
 }
 
 That . is inside a character class where it is a literal character
 (matches only .).  Why are you backslashing the underscore is beyond
 me.
 
 This is fine, is there any harm in escaping them?
 The match will work either way right?

It's misleading.  I don't want to be confronted with another legacy
program full of almost-reular expressions whose author didn't understand
the syntax at all, but was so stubborn that he eventually (using the
hit-and-miss method) found whatever garbage worked for him for
completely accidental reasons.

Know your tools.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] Newbie - help with a foreach

2007-01-18 Thread pub

Thank you for your reply.

My problem is that the web addresses on the bottom right show at all  
times as is instead of appearing only when active or selected on the  
left top navigation!


Does that make sense?

On Jan 18, 2007, at 1:43 AM, Németh Zoltán wrote:


I can't really understand what your problem is, because it seems to me
that the site is working like you want it to work. Or not?

And if there is a problem with the code then please show us the code
somehow, not the resulting webpage

greets
Zoltán Németh

On cs, 2007-01-18 at 01:31 -0800, pub wrote:

Could someone please help me figure out how to hide the info in the
right bottom part of my page unless the corresponding link is
selected in the top left.

The company names and job types at the top left need to show at all
time. But the corresponding picture at the bottom left and the web
address/info at the bottom right should appear only when selected.

I have the same query repeating twice once for the top left part and
once for the bottom right part because I can't figure out how else to
do it!

Thank you.

http://www.squareinch.net/single_page_t2.php?art=btw_logo.jpg


--
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] Newbie - help with a foreach

2007-01-18 Thread Németh Zoltán
ok, but how could anyone help without seeing your code?

greets
Zoltán Németh

On cs, 2007-01-18 at 01:54 -0800, pub wrote:
 Thank you for your reply.
 
 My problem is that the web addresses on the bottom right show at all  
 times as is instead of appearing only when active or selected on the  
 left top navigation!
 
 Does that make sense?
 
 On Jan 18, 2007, at 1:43 AM, Németh Zoltán wrote:
 
  I can't really understand what your problem is, because it seems to me
  that the site is working like you want it to work. Or not?
 
  And if there is a problem with the code then please show us the code
  somehow, not the resulting webpage
 
  greets
  Zoltán Németh
 
  On cs, 2007-01-18 at 01:31 -0800, pub wrote:
  Could someone please help me figure out how to hide the info in the
  right bottom part of my page unless the corresponding link is
  selected in the top left.
 
  The company names and job types at the top left need to show at all
  time. But the corresponding picture at the bottom left and the web
  address/info at the bottom right should appear only when selected.
 
  I have the same query repeating twice once for the top left part and
  once for the bottom right part because I can't figure out how else to
  do it!
 
  Thank you.
 
  http://www.squareinch.net/single_page_t2.php?art=btw_logo.jpg
 
  -- 
  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] $_SESSION variable gets lost on FORM action

2007-01-18 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-18 08:59:11 +:
 Roman:
 [...]
 You don't need to know your IP. See the grammar for AbsoluteURI:
 ftp://ftp.rfc-editor.org/in-notes/rfc2396.txt
 
 I'm asking this because my IP is dynamic and I'm using a free
 redirection service. My site is at
 'http://something.no-ip.org/sitename' can I use
 'http://something.no-ip.org/sitename/index.php?vaz=value' on the
 Locarion header?
 Actually you *must* use it instead of just the index... part.
 
 
 Thank you Roman, I'm now working with absolute paths! :)
 
 I Never thought that HTML had those specs...

It's not HTML, that's a completely different animal! HTTP is a transport
protocol, HTML is a document format.  HTML documents are but one type
of things you can transport using HTTP.

 With the relative link it worked and so it was OK for me...

Don't rely on browser bugs and features present to work around popular
bugs in server-side scripts.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] Newbie - help with a foreach

2007-01-18 Thread pub


On Jan 18, 2007, at 2:00 AM, Németh Zoltán wrote:


ok, but how could anyone help without seeing your code?

greets
Zoltán Németh


Here is the code:

Here is the entire page:

!-- nav/box 1 starts here --



?php
  include(../include/etc_inc.php);

  $connection = mysql_connect($host,$user,$password)
or die (couldn't connect to server);

// connect to database  
  $db = mysql_select_db($database,$connection)
or die (Couldn't select database);

// query a from client  
  $query = SELECT * FROM client
where status='active' or status='old'
order by companyName;

$result = mysql_query($query)
or die (Couldn't execute query);

  while ($aaa = mysql_fetch_array($result,MYSQL_ASSOC))
  { 
  echo span class='navCompany'{$aaa['companyName']}/spanspan  
class='navArrow'   /span\n;


// query b from job
$query = SELECT * FROM job
WHERE companyId='{$aaa['companyId']}';
$result2 = mysql_query($query)
or die (Couldn't execute query b);

foreach($aaa as $jobType)
{
$bbb = mysql_fetch_array($result2,MYSQL_ASSOC);
			echo span class='navText'a href='single_page_t2.php?art=.$bbb 
['pix'].'{$bbb['jobType']}/a/span\n;


}   

echo br;
}   
?



!-- nav/box 1 ends here --



/div
div class=navbox2img src=images/sq_logo_137.gif alt=Square  
Inch logo width=137 height=137/div


div class=navbox3?php $image = $_GET['art']; ?
			img src=images/?php print ($image) ?  alt=Portfolio Item  
border=0 width=285 height=285/div




div class=navbox4




!-- info/box 4 starts here --
?php
/* query 1 from client */
$query = SELECT * FROM client
where status='active' or status='old'
order by companyName;

$result = mysql_query($query)
or die (Couldn't execute query);

while   ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{   

/* query 2 from job */
$query = SELECT * FROM job
WHERE companyId='{$row['companyId']}';
$result2 = mysql_query($query)
or die (Couldn't execute query2);
$url = mysql_query($result2);

foreach($row as $url)
{
$row = mysql_fetch_array($result2,MYSQL_ASSOC);
if (url={$row['url']})  
		echo span class='navText'a href='{$row['url']}'{$row['web']}/ 
a/span;			

}

echo br;
}
?


!-- info/box 4 ends here --






On cs, 2007-01-18 at 01:54 -0800, pub wrote:

Thank you for your reply.

My problem is that the web addresses on the bottom right show at all
times as is instead of appearing only when active or selected on the
left top navigation!

Does that make sense?

On Jan 18, 2007, at 1:43 AM, Németh Zoltán wrote:

I can't really understand what your problem is, because it seems  
to me

that the site is working like you want it to work. Or not?

And if there is a problem with the code then please show us the code
somehow, not the resulting webpage

greets
Zoltán Németh

On cs, 2007-01-18 at 01:31 -0800, pub wrote:

Could someone please help me figure out how to hide the info in the
right bottom part of my page unless the corresponding link is
selected in the top left.

The company names and job types at the top left need to show at all
time. But the corresponding picture at the bottom left and the web
address/info at the bottom right should appear only when selected.

I have the same query repeating twice once for the top left part  
and
once for the bottom right part because I can't figure out how  
else to

do it!

Thank you.

http://www.squareinch.net/single_page_t2.php?art=btw_logo.jpg


--
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] phpmyadmin mysql extensions

2007-01-18 Thread Ross
 did the following...

-installed apache
-installed php (C:\PHP) with the windows installer
-moved my websites to the htdocs folder..so far so good can access pages
- downlaoded php my admin to htdocs
-downloaded the FULL php version
-copied the extensions folder (C:\PHP\ext)
-changd the line in php.ini

extension_dir = C:\PHP\ext


- the extensions in .ini look like this


;extension=php_mbstring.dll
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
extension=php_mssql.dll
extension=php_msql.dll
extension=php_mysql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll

The .dll file is  in C:\PHP\ext\mysql


Phpmyadmin cannot load I get the error  Cannot load mysql extension. 

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



[PHP] regular expression help!

2007-01-18 Thread William Stokes
Hello,

Can someone here give me a glue how to do the following. I guess I need to 
use regular expressions here. I have absolutely zero experience with regular 
expressions. (if there's another way to do this I don't mind. I jus need to 
get this done somehow :)

I need to strip all characters from the following text string exept the 
image path...

img width=\99\ height=\120\ border=\0\ 
src=\../../images/new/thumps/4123141112007590373240.jpg\ /...and then 
store the path to DB. Image path lengh can vary so I guess that I need to 
extract all characters after scr=\until next\or somethig 
similar.

Thanks for your advise!
-Will

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



Re: [PHP] Newbie - help with a foreach

2007-01-18 Thread Németh Zoltán
On cs, 2007-01-18 at 02:04 -0800, pub wrote:
 On Jan 18, 2007, at 2:00 AM, Németh Zoltán wrote:
 
  ok, but how could anyone help without seeing your code?
 
  greets
  Zoltán Németh
 
 Here is the code:
 
 Here is the entire page:
 
 !-- nav/box 1 starts here --
 
 
 
 ?php
include(../include/etc_inc.php);
 
$connection = mysql_connect($host,$user,$password)
   or die (couldn't connect to server);
   
 // connect to database
$db = mysql_select_db($database,$connection)
   or die (Couldn't select database);
 
 // query a from client
$query = SELECT * FROM client
   where status='active' or status='old'
   order by companyName;
   
   $result = mysql_query($query)
   or die (Couldn't execute query);
   
while  ($aaa = mysql_fetch_array($result,MYSQL_ASSOC))
{  
echo span class='navCompany'{$aaa['companyName']}/spanspan  
 class='navArrow'   /span\n;
 
 // query b from job
   $query = SELECT * FROM job
   WHERE companyId='{$aaa['companyId']}';
   $result2 = mysql_query($query)
   or die (Couldn't execute query b);
 
   foreach($aaa as $jobType)
   {
   $bbb = mysql_fetch_array($result2,MYSQL_ASSOC);
   echo span class='navText'a 
 href='single_page_t2.php?art=.$bbb 
 ['pix'].'{$bbb['jobType']}/a/span\n;
 
   }   

first, do you want to allow several jobs for the same company to be
stored in the DB and appear on the page, right? (if not, then why are
you storing them in separate tables?)

second, you should do it with one query I think

something like SELECT t1.*, t2.* FROM client t1, job t2 WHERE
t1.companyId=t2.companyId ORDER BY t1.companyId

and then you can do all stuff in one loop

 while ($aaa = mysql_fetch_array($result))

and you don't need that foreach stuff at all (which also seems to be
screwed up...)


   
 
   echo br;
   }   
   ?
   
 
 
 !-- nav/box 1 ends here --
 
 
 
 /div
 div class=navbox2img src=images/sq_logo_137.gif alt=Square  
 Inch logo width=137 height=137/div
 
 div class=navbox3?php $image = $_GET['art']; ?
   img src=images/?php print ($image) ?  
 alt=Portfolio Item  
 border=0 width=285 height=285/div
 
 
 
 div class=navbox4
 
 
 
 
 !-- info/box 4 starts here --
 ?php
 /* query 1 from client */

and here you should not run the whole query again

you should specifically query the one which should appear

maybe you should use a parameter for it, place it into the link in the
first query loop, get it here and query based on it

like SELECT * FROM job WHERE id={$_GET['job_id']} or whatever

and just echo the data from that record

hope that helps
Zoltán Németh

 

 $query = SELECT * FROM client
   where status='active' or status='old'
   order by companyName;
   
   $result = mysql_query($query)
   or die (Couldn't execute query);
 
 while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
 { 
   
 /* query 2 from job */
 $query = SELECT * FROM job
   WHERE companyId='{$row['companyId']}';
   $result2 = mysql_query($query)
   or die (Couldn't execute query2);
   $url = mysql_query($result2);
   
   foreach($row as $url)
   {
   $row = mysql_fetch_array($result2,MYSQL_ASSOC);
   if (url={$row['url']})
   
   echo span class='navText'a 
 href='{$row['url']}'{$row['web']}/ 
 a/span;   
   }
 
   echo br;
   }
   ?
 
 
 !-- info/box 4 ends here --
 
 
 
 
 
  On cs, 2007-01-18 at 01:54 -0800, pub wrote:
  Thank you for your reply.
 
  My problem is that the web addresses on the bottom right show at all
  times as is instead of appearing only when active or selected on the
  left top navigation!
 
  Does that make sense?
 
  On Jan 18, 2007, at 1:43 AM, Németh Zoltán wrote:
 
  I can't really understand what your problem is, because it seems  
  to me
  that the site is working like you want it to work. Or not?
 
  And if there is a problem with the code then please show us the code
  somehow, not the resulting webpage
 
  greets
  Zoltán Németh
 
  On cs, 2007-01-18 at 01:31 -0800, pub wrote:
  Could someone please help me figure out how to hide the info in the
  right bottom part of my page unless the corresponding link is
  selected in the top left.
 
  The company names and job types at the top left need to show at all
  time. But the corresponding picture at the bottom left and the web
  

Re: [PHP] phpmyadmin mysql extensions

2007-01-18 Thread T . Lensselink
Move your dll's to C:\PHP\ext and restart apache... 

On Thu, 18 Jan 2007 10:20:23 -, Ross [EMAIL PROTECTED] wrote:
  did the following...
 
 -installed apache
 -installed php (C:\PHP) with the windows installer
 -moved my websites to the htdocs folder..so far so good can access pages
 - downlaoded php my admin to htdocs
 -downloaded the FULL php version
 -copied the extensions folder (C:\PHP\ext)
 -changd the line in php.ini
 
 extension_dir = C:\PHP\ext
 
 
 - the extensions in .ini look like this
 
 
 ;extension=php_mbstring.dll
 ;extension=php_bz2.dll
 ;extension=php_curl.dll
 ;extension=php_dba.dll
 ;extension=php_dbase.dll
 ;extension=php_exif.dll
 ;extension=php_fdf.dll
 ;extension=php_filepro.dll
 ;extension=php_gd2.dll
 ;extension=php_gettext.dll
 ;extension=php_ifx.dll
 ;extension=php_imap.dll
 ;extension=php_interbase.dll
 ;extension=php_ldap.dll
 ;extension=php_mcrypt.dll
 ;extension=php_mhash.dll
 ;extension=php_mime_magic.dll
 ;extension=php_ming.dll
 extension=php_mssql.dll
 extension=php_msql.dll
 extension=php_mysql.dll
 ;extension=php_oci8.dll
 ;extension=php_openssl.dll
 ;extension=php_oracle.dll
 ;extension=php_pgsql.dll
 ;extension=php_shmop.dll
 ;extension=php_snmp.dll
 ;extension=php_sockets.dll
 ;extension=php_sqlite.dll
 ;extension=php_sybase_ct.dll
 ;extension=php_tidy.dll
 ;extension=php_xmlrpc.dll
 ;extension=php_xsl.dll
 
 The .dll file is  in C:\PHP\ext\mysql
 
 
 Phpmyadmin cannot load I get the error  Cannot load mysql extension. 
 
 --
 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] regular expression help!

2007-01-18 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-18 12:34:36 +0200:
 I need to strip all characters from the following text string exept the 
 image path...
 
 img width=\99\ height=\120\ border=\0\ 
 src=\../../images/new/thumps/4123141112007590373240.jpg\ /...and then 
 store the path to DB. Image path lengh can vary so I guess that I need to 
 extract all characters after scr=\until next\or somethig 
 similar.

This passes with 5.2:

class ImgSrcTest extends Tence_TestCase
{
private $src, $str, $xml;
function setUp()
{
$this-src = 'fubar.jpg';
$this-str = sprintf(
'img width=99 height=120 border=0 src=%s /',
$this-src
);
$this-xml = new SimpleXmlElement($this-str);
}
function testReturnsAttributeAsSimpleXMLElements()
{
return $this-assertEquals('SimpleXMLElement', 
get_class($this-xml['src']));
}
function testCastToStringYieldsTheAttributeValue()
{
return $this-assertEquals($this-src, strval($this-xml['src']));
}
}

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] regular expression help!

2007-01-18 Thread William Stokes
Hello Roman,

Could you specify the functionality of your script a bit please. (How it 
works)

I forgot to mention that this part:

img width=99 height=120 border=0 src=%s /',

is not always the same. The image properties can vary.

Thanks
-Will




Roman Neuhauser [EMAIL PROTECTED] kirjoitti 
viestissä:[EMAIL PROTECTED]
# [EMAIL PROTECTED] / 2007-01-18 12:34:36 +0200:
 I need to strip all characters from the following text string exept the
 image path...

 img width=\99\ height=\120\ border=\0\
 src=\../../images/new/thumps/4123141112007590373240.jpg\ /...and then
 store the path to DB. Image path lengh can vary so I guess that I need to
 extract all characters after scr=\until next\or 
 somethig
 similar.

 This passes with 5.2:

 class ImgSrcTest extends Tence_TestCase
 {
private $src, $str, $xml;
function setUp()
{
$this-src = 'fubar.jpg';
$this-str = sprintf(
'img width=99 height=120 border=0 src=%s /',
$this-src
);
$this-xml = new SimpleXmlElement($this-str);
}
function testReturnsAttributeAsSimpleXMLElements()
{
return $this-assertEquals('SimpleXMLElement', 
 get_class($this-xml['src']));
}
function testCastToStringYieldsTheAttributeValue()
{
return $this-assertEquals($this-src, strval($this-xml['src']));
}
 }

 -- 
 How many Vietnam vets does it take to screw in a light bulb?
 You don't know, man.  You don't KNOW.
 Cause you weren't THERE. http://bash.org/?255991 

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



[PHP] Broken compatibility with escaping { in php 5.2

2007-01-18 Thread Bogdan Ribic

Hi all,

Try this:

$a = '';
echo \{$a};

from php 4, it outputs {}, from php 5.2 (one that comes with Zend 5.5) 
it outputs \{}, thus breaking existing scripts.


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



Re: [PHP] Broken compatibility with escaping { in php 5.2

2007-01-18 Thread Jochem Maas
Bogdan Ribic wrote:
 Hi all,
 
 Try this:
 
 $a = '';
 echo \{$a};
 
 from php 4, it outputs {}, from php 5.2 (one that comes with Zend 5.5)

no-one here supports Zend.

 it outputs \{}, thus breaking existing scripts.

AFAICT the escaping in that string is wrong - the fact that it did work
the way you want it to is probably sheer luck.

lastly I ran your tests and determined at the least that the 'break'
occur *prior* to 5.2. at a guess it probably changed in 5.0, here are my 
results:

# php -r 'echo php,phpversion(),:\n; $a = ; var_dump(\{$s});'  ;
  php5 -r 'echo php,phpversion(),:\n; $a = ; var_dump(\{$s});'

OUTPUT:

php4.3.10-18:
string(2) {}
php5.1.2:
string(3) \{}

 

be pragmatic - fix your script :-)

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



Re: [PHP] Broken compatibility with escaping { in php 5.2

2007-01-18 Thread Németh Zoltán
On cs, 2007-01-18 at 14:19 +0100, Jochem Maas wrote:
 Bogdan Ribic wrote:
  Hi all,
  
  Try this:
  
  $a = '';
  echo \{$a};
  
  from php 4, it outputs {}, from php 5.2 (one that comes with Zend 5.5)
 
 no-one here supports Zend.
 
  it outputs \{}, thus breaking existing scripts.
 
 AFAICT the escaping in that string is wrong - the fact that it did work
 the way you want it to is probably sheer luck.
 
 lastly I ran your tests and determined at the least that the 'break'
 occur *prior* to 5.2. at a guess it probably changed in 5.0, here are my 
 results:
 
 # php -r 'echo php,phpversion(),:\n; $a = ; var_dump(\{$s});'  ;
   php5 -r 'echo php,phpversion(),:\n; $a = ; var_dump(\{$s});'
 
 OUTPUT:
 
 php4.3.10-18:
 string(2) {}
 php5.1.2:
 string(3) \{}
 
  
 
 be pragmatic - fix your script :-)

is this the correct form:

$a = '';
echo \{$a\};

if I want to get {} a result?

(I think it is)

greets
Zoltán Németh

 

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



[PHP] What makes a PHP expert

2007-01-18 Thread h
Dear All



I often see job ads asking for a PHP expert and was wandering what you all 
thought makes a PHP programmer into an expert.



what would you mark out as the key skills that distinguishes an expert from the 
ordinary i.e. OOP mastery, regular expressions etc.



p.s. I am not an expert but am intersted to see if i could become one!


RE: [PHP] What makes a PHP expert

2007-01-18 Thread Jay Blanchard
[snip]
I often see job ads asking for a PHP expert and was wandering what you
all thought makes a PHP programmer into an expert.

what would you mark out as the key skills that distinguishes an expert
from the ordinary i.e. OOP mastery, regular expressions etc.
[/snip]

First I would consider number of years of programming experience
including how many years a programmer had been using PHP. I would
examine some code and look for organization, documentation, and
consistency. Is the programmer published (articles, books, etc) which
may not count against expertise?

An expert encompasses so much more than skills. For instance, I could be
an expert on football because I understand history of the game, have
been published, understand game planning and execution, and have played
at the wide receiver position. Only the last 2 items really require
skills.

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



Re: [PHP] Broken compatibility with escaping { in php 5.2

2007-01-18 Thread Jochem Maas
Németh Zoltán wrote:
 On cs, 2007-01-18 at 14:19 +0100, Jochem Maas wrote:
 Bogdan Ribic wrote:
 Hi all,

 Try this:

 $a = '';
 echo \{$a};

 from php 4, it outputs {}, from php 5.2 (one that comes with Zend 5.5)
 no-one here supports Zend.

 it outputs \{}, thus breaking existing scripts.
 AFAICT the escaping in that string is wrong - the fact that it did work
 the way you want it to is probably sheer luck.

 lastly I ran your tests and determined at the least that the 'break'
 occur *prior* to 5.2. at a guess it probably changed in 5.0, here are my 
 results:

 # php -r 'echo php,phpversion(),:\n; $a = ; var_dump(\{$s});'  ;
   php5 -r 'echo php,phpversion(),:\n; $a = ; var_dump(\{$s});'

 OUTPUT:

 php4.3.10-18:
 string(2) {}
 php5.1.2:
 string(3) \{}

 be pragmatic - fix your script :-)
 
 is this the correct form:
 
 $a = '';
 echo \{$a\};
 
 if I want to get {} a result?
 
 (I think it is)

testing would given you certainty.

I tested it and, although I would have thought it was correct,
it did not given the desired result, the following 2 do give what
your looking for:

echo {{$s}},  , '{'.$s.')';

 
 greets
 Zoltán Németh
 
 

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



[PHP] Is there a wordwrap for multibyte/unicode/utf8?

2007-01-18 Thread Mathijs

Hello there,

I have a multibyte string which i need to wordwrap.
Now wordwrap splits multibyte chars also.

Is there a way to fix this??

Thx in advance.

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



[PHP] Re: How to prevent DomDocument from adding a !DOCTYPE.

2007-01-18 Thread Mathijs

Rob Richards wrote:

Mathijs wrote:


I have some HTML content:
div id=test1
  div id=test2 class=testClass
span style=font-color: #900; class=secondTestClass
  Testingbr
/span
ØøÅå_^{}\[~]|[EMAIL PROTECTED]#¤%'()*+,ÖÑܧ¿äöñüà-./:;=?¡Ä
  /div
/div


Now i need to parse the HTML by getting all the class and id 
attributes and replace them with something else, and after that return 
the modified HTML.


If this were XHTML or you were working with complete HTML documents, 
then you would have a shot. Being HTML snippets, you are going to run 
into problems (different encodings, possibility of entities, etc..) - 
all of which need to be handled. You could probably hack the snippet a 
bit to create a full HTML document, but there's still no guarantee it 
will work correctly between different snippets.


On top of that, unlike working with XML, there is no way to output a 
subtree of HTML. You would need to use the XML serialization routines, 
which would most likely change the structure of your document (it would 
be XHTML compliant now).


Rob


I have it fixed now.
You need to have a meta tag with the right content-type in the parsed 
HTML. If you don't do this, the parser doesn't know the right content-type.


Also, there was something wrong with my own post/get handling.
So that caused some problems also.

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



Re: [PHP] Broken compatibility with escaping { in php 5.2

2007-01-18 Thread Bogdan Ribic




be pragmatic - fix your script :-)


I did :)

It was a part of code generator, and I had something like :
$res .= function $this-insert_prefix() \{$this-_global_db\n;

and replaced it with

$res .= function $this-insert_prefix() {{$this-_global_db}\n;

... in about 20 locations.

But the complaint is that whichever is correct version, it cannot be 
much more correct than the other, and certainly not worth breaking 
existing functionality. Mine was easy to fix, but this might introduce 
weird bugs somewhere else.


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



[PHP] Re: What makes a PHP expert

2007-01-18 Thread Colin Guthrie
Answer, nothing, PHP doesn't need Makefiles as it's an interpreted
language :p

hahahaha


Sorry, I'll get my coat.

Col.

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



Re: [PHP] $_SESSION variable gets lost on FORM action

2007-01-18 Thread Nuno Vaz Oliveira

From Roman:


Roman:
[...]
You don't need to know your IP. See the grammar for AbsoluteURI:
ftp://ftp.rfc-editor.org/in-notes/rfc2396.txt

I'm asking this because my IP is dynamic and I'm using a free
redirection service. My site is at
'http://something.no-ip.org/sitename' can I use
'http://something.no-ip.org/sitename/index.php?vaz=value' on the
Locarion header?


Actually you *must* use it instead of just the index... part.


Thank you Roman, I'm now working with absolute paths! :)

I Never thought that HTML had those specs...


It's not HTML, that's a completely different animal! HTTP is a
transport
protocol, HTML is a document format.  HTML documents are but one type
of things you can transport using HTTP.

With the relative link it worked and so it was OK for me...


Don't rely on browser bugs and features present to work around popular
bugs in server-side scripts.



Sorry, that was my BUG!!

Your totally right and I know that. I was with my head at some other place
when I wrote that (probably).

I don't know that much of HTTP (or other protocols) but my knowladge
of (X)HTML (used by its semantic) is very good. Also, I use headers to
send files, images and document types and that's got nothing to do
with HTML.

Glad that you reminded me, thanks,
Nuno

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



Re: [PHP] Re: What makes a PHP expert

2007-01-18 Thread Robert Cummings
On Thu, 2007-01-18 at 14:25 +, Colin Guthrie wrote:
 Answer, nothing, PHP doesn't need Makefiles as it's an interpreted
 language :p

Ummm, I build PHP from source. There is definitely a makefile :)

 hahahaha

 Sorry, I'll get my coat.

Don't let the door hit you on the way out ;)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



RE: [PHP] One last try at this!

2007-01-18 Thread Beauford
 

 -Original Message-
 From: Jim Lucas [mailto:[EMAIL PROTECTED] 
 Sent: January 17, 2007 8:10 PM
 To: Jim Lucas
 Cc: Beauford; 'PHP'
 Subject: Re: [PHP] One last try at this!
 
 Jim Lucas wrote:
  Beauford wrote:
  This is what I am trying to do, and for the most part it 
 works, but 
  it also may be causing some of my other problems.
 
  If $event contains invalid characters, I am returning a 
 string that 
  says Invalid Characters So $result now contains the 
 value 'Invalid 
  Characters'.
  Then $formerror['event'] = $result - is self explanatory.
 
  If there are no errors nothing is returned and $result 
 should contain 
  anything. But this doesn't always seem to be the case. 
 This is one of 
  the problems I am having.
 
  This is the code in a nutshell.
 
  if($result = ValidateString($event)) { $formerror['event'] 
 = $result; 
  function ValidateString($string) {
 
  if(!preg_match(/^[-A-Za-z0-9_.' ]+$/, $string)) {
  return Invalid Characters;
  }   
   
  Thanks
 

  In your regex you have a .  this will match anything
 
  try this:
 
  plaintext?php
 
  function ValidateString($string) {
  if ( preg_match(/[^a-zA-Z0-9\_\.\' -]+/, $string) ) {
  return Invalid Characters;
  }
  return false;
  }
 
  $formerror = array();
 forgot to say that all you need to do to get rid of the 
 default values is remove the following two lines
 
  $formerror['firstAttempt'] = 'first attempt'; 
  $formerror['secondAttempt'] = 'second attempt';
 
  $event = A-Z and a-z plus 0-9 and an '_' are allowed.; if ( ( 
  $result = ValidateString($event) ) !== false ) {
  $formerror['firstAttempt'] = $result; }
 
  $event = But bad chars like  [EMAIL PROTECTED] and %^* are not 
 allowed.; if ( ( 
  $result = ValidateString($event) ) !== false ) {
  $formerror['secondAttempt'] = $result; }
 
  var_dump($formerror);
 
  ?
 
  Jim Lucas
 

The regex itself was not really the problem, although I appreciate the help
on that, but I'm not sure I follow the rest of what your saying. I tried
your line below, and whether or not there were errors, an error was always
returned. So ABC or @#$ would give me the same result.

if ( ($result = ValidateString($event) ) !== false ) {
$formerror['firstAttempt'] = $result; }

Thanks

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



[PHP] Include files beneath pointed directory

2007-01-18 Thread Wikus Moller

Hi.

I have a windows server and I know this issue has been dealt with
before but I can't find it, I want to include a file from a directory
beneath or aside my home directory.

Can I use the C:\directory\anotherdirectory\file.php in the include
function like include C:\directory\anotherdirectory\file.php; or do
I need more code to make it work? I am sure I do. The directory would
be aside my home directory.

Thanks

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



RE: [PHP] What makes a PHP expert

2007-01-18 Thread Miles Thompson

At 09:55 AM 1/18/2007, Jay Blanchard wrote:


snip

First I would consider number of years of programming experience
including how many years a programmer had been using PHP. I would
examine some code and look for organization, documentation, and
consistency. Is the programmer published (articles, books, etc) which
may not count against expertise?

An expert encompasses so much more than skills. For instance, I could be
an expert on football because I understand history of the game, have
been published, understand game planning and execution, and have played
at the wide receiver position. Only the last 2 items really require
skills.

--


Good answer Jay.

Whenever someone refers to me as an expert I raise the shields. I've been 
humbled too many times, and a remark like that is usually a precursor to 
getting bitten by.


A harbour pilot received a fawningl ompliment, from a quite gorgeous 
tourist, that he must know where all the deep water channels were. No 
ma'm he replied, but I know where the rocks are.


Yep.

Cheers - Miles


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.410 / Virus Database: 268.16.14/636 - Release Date: 1/18/2007

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



Re: [PHP] dynamic lists

2007-01-18 Thread tedd

At 2:33 PM -0800 1/17/07, Kevin Murphy wrote:
Not saying I disagree with you. which is why i tossed it out 
there as an FYI rather than anything else. But its something that 
you should be aware of when designing a site and weighing your 
options. For me, working for a governmental institution, I really 
don't have a choice. I can't throw anything into the website that 
has a negative ADA impact unless of course I have an alternate 
way of accomplishing the same thing.


Not only working for the government (which has enough sites that fail 
compliance anyway), but if you're a company who wishes to do business 
with the US Government, then web site compliance is required (Section 
508).



At 11:54 PM + 1/17/07, Roman Neuhauser wrote:
-snip- [support for the disabled]

Good for you -- but re your sig, I take it that your support for 
disability issues exclude disabled Vietnam vets?


tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



RE: [PHP] What makes a PHP expert

2007-01-18 Thread bruce
hi...

for my $0.02 worth... sometimes it's as simple as someone who can qucikly
grasp the issue(s) and nuances/intracacies of the issues/problems, and who
can then utilize php to solve the problem, as well as craft an elegant
solution that will scale into the future.

peace...


-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 18, 2007 5:56 AM
To: h; php-general@lists.php.net
Subject: RE: [PHP] What makes a PHP expert


[snip]
I often see job ads asking for a PHP expert and was wandering what you
all thought makes a PHP programmer into an expert.

what would you mark out as the key skills that distinguishes an expert
from the ordinary i.e. OOP mastery, regular expressions etc.
[/snip]

First I would consider number of years of programming experience
including how many years a programmer had been using PHP. I would
examine some code and look for organization, documentation, and
consistency. Is the programmer published (articles, books, etc) which
may not count against expertise?

An expert encompasses so much more than skills. For instance, I could be
an expert on football because I understand history of the game, have
been published, understand game planning and execution, and have played
at the wide receiver position. Only the last 2 items really require
skills.

-- 
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] Scope of include

2007-01-18 Thread tedd

At 9:49 PM -0800 1/17/07, jekillen wrote:

Hello php list:
If I include a php script inside a php function definition and then call the
function in another script. What is the scope of variables in the included
script? Are they local to the function that calls include with the file name?
Thanks in advance;
I'm not sure where to look for this answer;
JK



JK:

Whenever I have a question about an include, I just cut/paste (i.e., 
replace) the include statement with the include script. That way I 
know exactly what it does.


hth's

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] dynamic lists

2007-01-18 Thread Scripter47

Hey!

I got the same problem with a php chat.. look at 
http://wsd.riddergarn.dk?p=chat


Here is a link to a AJAX site:
http://javascript.internet.com/ajax/

Here is the tutorial that helped my...:
http://javascript.internet.com/ajax/ajax-navigation2.html


[FONT=23]Scripter47[/FONT]


Don skrev:

I'm a noob.

 


My question is whether PHP can produce dynamic drop lists and if so what the
tags are so that I can look them up.

 


By dynamic drop list I mean the type where the options contained in the
subsequent list depend on what was picked in the previous list without
clicking submit. 

 


For instance: say the first list is of the states, then the second list
updates to contain cities within that state as options.

 


Thanks,

Don

 





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



[PHP] PHP5 Cross Compilation

2007-01-18 Thread Kiran Malla

Hello,

I am trying to cross compile PHP-5.2.0 for arm linux.

# export CC=/usr/local/arm/3.3.2/bin/arm-linux-gcc
# export AR=/usr/local/arm/3.3.2/bin/arm-linux-ar
# export LD=/usr/local/arm/3.3.2/bin/arm-linux-ld
# export NM=/usr/local/arm/3.3.2/bin/arm-linux-nm
# export RANLIB=/usr/local/arm/3.3.2/bin/arm-linux-ranlib
# export STRIP=/usr/local/arm/3.3.2/bin/arm-linux-strip

# ./configure --host=arm-linux --sysconfdir=/etc/appWeb
--with-exec-dir=/etc/appWeb/exec

Result of this configure is,

Checking for iconv support... yes
checking for iconv... no
checking for libiconv... no
checking for libiconv in -liconv... no
checking for iconv in -liconv... no
configure: error: Please reinstall the iconv library.

I have installed libiconv-1.11 on my system. The command 'which iconv' shows
'/usr/local/bin/iconv'. I have no clue why configure is failing due to
missing iconv.

Somebody please throw some light on this issue.

Regards,
Kiran


Re: [PHP] Storing values in arrays

2007-01-18 Thread tedd

At 1:55 PM -0500 1/17/07, Robert Cummings wrote:

On Wed, 2007-01-17 at 13:14 -0500, tedd wrote:

 At 7:15 AM -0800 1/17/07, Ryan A wrote:
 True, but thats not the most important part... I guess I wrote it
 wrong, I meant that it should not write to disk before 1 minute...
 anyway... about the array saving any ideas?
 

 Why?


Why not?

Cheers,
Rob.


:-)

Yes, but my point is -- if I better understand what he is trying to 
do, then I may be able to provide an answer.


tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Scope of include

2007-01-18 Thread Robert Cummings
On Thu, 2007-01-18 at 10:29 -0500, tedd wrote:
 At 9:49 PM -0800 1/17/07, jekillen wrote:
 Hello php list:
 If I include a php script inside a php function definition and then call the
 function in another script. What is the scope of variables in the included
 script? Are they local to the function that calls include with the file name?
 Thanks in advance;
 I'm not sure where to look for this answer;
 JK
 
 
 JK:
 
 Whenever I have a question about an include, I just cut/paste (i.e., 
 replace) the include statement with the include script. That way I 
 know exactly what it does.

Sounds like a maintenance nightmare :|

To answer his question though, variables not declared via the global
keyword and not accessed via the super global variables ($GLOBALS,
$_SESSION, etc) inherit the scope in which the include statement occurs.
Therefore, if in the included file all you have is:

$foo = 'foo';

Then it's scope is the function including the file.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] dynamic lists

2007-01-18 Thread Jochem Maas
tedd wrote:
 At 2:33 PM -0800 1/17/07, Kevin Murphy wrote:
 Not saying I disagree with you. which is why i tossed it out there
 as an FYI rather than anything else. But its something that you should
 be aware of when designing a site and weighing your options. For me,
 working for a governmental institution, I really don't have a choice.
 I can't throw anything into the website that has a negative ADA
 impact unless of course I have an alternate way of accomplishing
 the same thing.
 
 Not only working for the government (which has enough sites that fail
 compliance anyway), but if you're a company who wishes to do business
 with the US Government, then web site compliance is required (Section 508).
 

do business with the US Government? I'd rather be flipping burger for a major
US Corporation :-/ (no doubt if you dig deep enough the US Corp is owned by some
Japanese or Middle Eastern conglomerate.

http://en.wikipedia.org/wiki/Oligarchy (and that applies to just about every
'democracy' if you ask me.)

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



Re: [PHP] Storing values in arrays

2007-01-18 Thread Robert Cummings
On Thu, 2007-01-18 at 10:33 -0500, tedd wrote:
 At 1:55 PM -0500 1/17/07, Robert Cummings wrote:
 On Wed, 2007-01-17 at 13:14 -0500, tedd wrote:
   At 7:15 AM -0800 1/17/07, Ryan A wrote:
   True, but thats not the most important part... I guess I wrote it
   wrong, I meant that it should not write to disk before 1 minute...
   anyway... about the array saving any ideas?
   
 
   Why?
 
 Why not?
 
 Cheers,
 Rob.
 
 :-)
 
 Yes, but my point is -- if I better understand what he is trying to 
 do, then I may be able to provide an answer.

Ahh, but a lone Why? sounds like a challenge, you might have been
better to have asked, I don't understand your question, could you
explain it more?. :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] still trying to setup phpmyadin

2007-01-18 Thread Ross
I am still setting up phpmyadmin and am still getting the error.

I have put

libmysql in the sysyem 32 folder

I have a copy of the php_mysql folder in the c:\PHP\ext folder

my .ini points to

extension_dir = C:\PHP
and the extemsion is uncommented.
extension=php_mysql.dll


What else cold be the problem? Mysql runs fine I can connect with 
phpmyadmin.


Ross

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



Re: [PHP] Broken compatibility with escaping { in php 5.2

2007-01-18 Thread Jochem Maas
Bogdan Ribic wrote:
 

 be pragmatic - fix your script :-)
 
 I did :)
 
 It was a part of code generator, and I had something like :
 $res .= function $this-insert_prefix() \{$this-_global_db\n;
 
 and replaced it with
 
 $res .= function $this-insert_prefix() {{$this-_global_db}\n;
 
 ... in about 20 locations.
 
 But the complaint is that whichever is correct version, it cannot be
 much more correct than the other, and certainly not worth breaking
 existing functionality. Mine was easy to fix, but this might introduce
 weird bugs somewhere else.

I'm not the authority that could comment on that one way or the other,
no doubt there is a good  complicated explanation as to why this changed
- you might try asking the internals list (don't tell them I sent you :-).


 

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



[PHP] Re: regular expression help!

2007-01-18 Thread Al

First stripslashes() and all newlines [\n\r*]. It makes the regex much easier.

$pattern= %img\x20[\w\d\=\x20]+(src=\x20*\)([/\w\d\.]+)[\\x20]*/%i;

preg_match($pattern, $string, $match); If more than one in the string, use 
preg_match_all().


Now print_r($match); so you can see the result.

Now, read the doc and see why each term is used. Note, I assumed your string can 
have some variation and still be W3C compatible e.g., src=. and

src= , etc. You may need to be able to handle additional variations.

Al

William Stokes wrote:

Hello,

Can someone here give me a glue how to do the following. I guess I need to 
use regular expressions here. I have absolutely zero experience with regular 
expressions. (if there's another way to do this I don't mind. I jus need to 
get this done somehow :)


I need to strip all characters from the following text string exept the 
image path...


img width=\99\ height=\120\ border=\0\ 
src=\../../images/new/thumps/4123141112007590373240.jpg\ /...and then 
store the path to DB. Image path lengh can vary so I guess that I need to 
extract all characters after scr=\until next\or somethig 
similar.


Thanks for your advise!
-Will


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



Re: [PHP] PHP5 Cross Compilation

2007-01-18 Thread Jochem Maas
Kiran Malla wrote:
 Hello,
 
 I am trying to cross compile PHP-5.2.0 for arm linux.
 
 # export CC=/usr/local/arm/3.3.2/bin/arm-linux-gcc
 # export AR=/usr/local/arm/3.3.2/bin/arm-linux-ar
 # export LD=/usr/local/arm/3.3.2/bin/arm-linux-ld
 # export NM=/usr/local/arm/3.3.2/bin/arm-linux-nm
 # export RANLIB=/usr/local/arm/3.3.2/bin/arm-linux-ranlib
 # export STRIP=/usr/local/arm/3.3.2/bin/arm-linux-strip
 
 # ./configure --host=arm-linux --sysconfdir=/etc/appWeb
 --with-exec-dir=/etc/appWeb/exec
 
 Result of this configure is,
 
 Checking for iconv support... yes
 checking for iconv... no
 checking for libiconv... no
 checking for libiconv in -liconv... no
 checking for iconv in -liconv... no
 configure: error: Please reinstall the iconv library.
 
 I have installed libiconv-1.11 on my system. The command 'which iconv'
 shows
 '/usr/local/bin/iconv'. I have no clue why configure is failing due to
 missing iconv.
 
 Somebody please throw some light on this issue.

maybe some*thing* will do:

./configure --help

I'm guessing it'll tell you how to instruct configure on where iconv is
living.

 
 Regards,
 Kiran
 

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



[PHP] Re: still trying to setup phpmyadin

2007-01-18 Thread Ross
cracked it. think the libmysql was an old one! 

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



[PHP] Exporting from Multiple mySQL Tables into One

2007-01-18 Thread Rahul S. Johari
Ave,

I¹m not sure how to execute this. I can easily write a long, tedious code to
handle each table separately, but I¹m sure there is an Array/For Each way to
do this. 

I¹ve got 6 mySQL tables. I¹ve written a code that dumps data from each table
into one corresponding DBF table. While writing to the DBF, I also add a
field  a value to it identifying the table.
I need to dump data from all the mySQL tables into one DBF table, and also
have that added field  identifier value added to each table¹s data.

Here¹s my code to export from 1 mySQL table into 1 DBF table.
($tChoice  $bx are Table Name  Identifier Value that are passed on from a
previous page):

// database definition
$def = array(
  array(phone,C, 10),
  array(comments,C, 254),
  array(starttime,C, 10),
  array(endtime,C, 10),
  array(dispo,C, 80),
  array(lo, C, 50),
  array(verifier, C, 50),
  array(branch,C,3)
);

// creation
if (!dbase_create('dbf/'.$bx.'.dbf', $def)) {
  echo BRBRError, can't create the databaseBRBR;
}
   
// open in read-write mode
$db2 = dbase_open(dbf/.$bx..dbf, 2);
if ($db2) {
  
mysql_select_db($database_imslead_transfer, $imslead_transfer);
$query_loDispo = SELECT * FROM $tChoice;
$loDispo = mysql_query($query_loDispo, $imslead_transfer) or
die(mysql_error());
$row_loDispo = mysql_fetch_assoc($loDispo);
$totalRows_loDispo = mysql_num_rows($loDispo);

  // write mySql data to Dbf
  do {
 dbase_add_record($db2, array(
 $row_loDispo['phone'],
 $row_loDispo['comments'],
 $row_loDispo['starttime'],
 $row_loDispo['endtime'],
 $row_loDispo['dispo'],
 $row_loDispo['loanofficer'],
 $row_loDispo['verifier'],
 $bx));
 } while ($row_loDispo = mysql_fetch_assoc($loDispo));
 
dbase_close($db2);
}

mysql_free_result($loDispo);
header(Location: dbf/$bx.dbf);

Now I just need to write a code which takes data from each table, one by
one, and appends it to the DBF, alongwith adding a field that carries the
Identifier Value for each table.

Any suggestions?

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com





[PHP] Daylight Savings Time in PHP4

2007-01-18 Thread mike caplin

Does anyone know if the change in Daylight Savings Time (March this year)
affects PHP v4.x?  I looked around www.php.net and all I could find was a
reference to v5 (http://bugs.php.net/bug.php?id=35296).  Is there a v4
release which is compatible with the DST change?  Or even a patch could be
applied?

Thanks.

Mike


[PHP] Displaying Results on different rows in tables

2007-01-18 Thread Dan Shirah

Hello all,

I am trying to pull data and then loop through the multiple results display
in seperate rows.
My database contains several tables which are all tied together by the
credit_card_id.  After running the query, it ties the unique record together
by matching the credit_card_id in both tables.  How would I go about
displaying the results of this query in a table with a single row for each
unique record?

Each row of the result will have 5 columns: Request ID, Date/Time Entered,
Status, Payment Type, Last Processed By.

If I assign the results of the query to variables (Such as $id =
$row['credit_card_id'];) how would I display that data?

Would it be something like this:

foreach($row as $data)
{
echo table
   tr
tda href=$item-link$id/a/td
   /tr;
 echo tr
td$dateTime/td
   /tr
 /table;
 echo tr  td$Status/td
   /tr
 /table;

 }
Below is the code I have so far.

?php
$database = database;
$host = host;
$user = username;
$pass = password;
 // Connect to the datbase
 $connection = mssql_connect($host, $user, $pass) or die ('server
connection failed');
 $database = mssql_select_db($database, $connection) or die ('DB
selection failed');
 // Query the table and load all of the records into an array.
 $sql = SELECT
child_support_payment_request.credit_card_id,
  credit_card_payment_request.credit_card_id,
  date_request_received
   FROM child_support_payment_request,
credit_card_payment_request
 WHERE child_support_payment_request.credit_card_id =
credit_card_payment_request.credit_card_id;
 $result = mssql_query($sql) or die(mssql_error());
 while ($row=mssql_fetch_array($result));
 $id = $row['credit_card_id'];
 $dateTime = $row['date_request_received'];

?


[PHP] Oracle Execute Function

2007-01-18 Thread Brad Bonkoski

Hello All,

I have this Oracle function, and within my code I call it like this:

$sql = BEGIN :result := my_funtion_name('$parm1', $parm2, null, null, 
null); END;;

   $stmt = $db-parse($sql);
   $rc = null;
   ocibindbyname($stmt, :result, $rc);
   $db-execute($stmt, $sql);

The problem is that the execute function spits back an error/warning 
message, but the Oracle function properly executes and the data is in 
the Database.

The execute function looks like this:
(This function enters the conditional where ii executes the die() function)

public function execute($stmt, $query = ) {
   if( $this-trans)
   $result = @ociexecute($stmt, OCI_DEFAULT);
   else
   $result = @ociexecute($stmt);
   if (!$result ) {
   $error = ocierror($this-link);
   $this-report('Invalid Statement: ' . $stmt 
.'('.$query.')'. '  '

   . htmlentities($error['message']));
   die('Invalid Statement: ' . $stmt 
.'('.$query.')'. '  ' . htmlentities($error['message']));

   }
   return $result;
   }

I use this wrapper class for many things, and the execute function for 
many things, without any problems.

Now, this is an initial run at calling Oracle functions within PHP.
Any words of wisdom as to what could be causing this problem, or any 
other insight?


TIA
-Brad

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



Re: [PHP] Exporting from Multiple mySQL Tables into One - SOLVED!

2007-01-18 Thread Rahul S. Johari

Ave,

I was fiddling my way around with foreach and found a solution to my
problem. Here's my code:

// define the array
$tChoice = array(
   lodispo_osma = ATL,
   lodispo_osmh = HOU,
   lodispo_osmj = JAX,
   lodispo_osmt = TPA,
   lodispo = VB,
   lodispo_hfd = HFD
);

// database definition
$def = array(
  array(phone,C, 10),
  array(comments,C, 254),
  array(starttime,C, 10),
  array(endtime,C, 10),
  array(dispo,C, 80),
  array(lo, C, 50),
  array(verifier, C, 50),
  array(branch,C,3)
);

// creation
if (!dbase_create('dbf/ALL.dbf', $def)) {
  echo BRBRError, can't create the databaseBRBR;
}

   
// open in read-write mode
$db2 = dbase_open(dbf/ALL.dbf, 2);
if ($db2) {

// Let's Run Array Loops!
foreach ($tChoice as $tblQ = $bxQ) {

// connect to mySQL table
mysql_select_db($database_imslead_transfer, $imslead_transfer);
$query_loDispo = SELECT * FROM $tblQ;
$loDispo = mysql_query($query_loDispo, $imslead_transfer) or
die(mysql_error());
$row_loDispo = mysql_fetch_assoc($loDispo);
$totalRows_loDispo = mysql_num_rows($loDispo);
  
// write mySql data to Dbf
do {
 dbase_add_record($db2, array(
 $row_loDispo['phone'],
 $row_loDispo['comments'],
 $row_loDispo['starttime'],
 $row_loDispo['endtime'],
 $row_loDispo['dispo'],
 $row_loDispo['loanofficer'],
 $row_loDispo['verifier'],
 $bxQ));
 } while ($row_loDispo = mysql_fetch_assoc($loDispo));
}
 
 
dbase_close($db2);
}

mysql_free_result($loDispo);
header(Location: dbf/ALL.dbf);

Works like a charm!

Thanks!

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com



On 1/18/07 11:14 AM, Rahul S. Johari [EMAIL PROTECTED] wrote:

 Ave,
 
 I¹m not sure how to execute this. I can easily write a long, tedious code to
 handle each table separately, but I¹m sure there is an Array/For Each way to
 do this. 
 
 I¹ve got 6 mySQL tables. I¹ve written a code that dumps data from each table
 into one corresponding DBF table. While writing to the DBF, I also add a
 field  a value to it identifying the table.
 I need to dump data from all the mySQL tables into one DBF table, and also
 have that added field  identifier value added to each table¹s data.
 
 Here¹s my code to export from 1 mySQL table into 1 DBF table.
 ($tChoice  $bx are Table Name  Identifier Value that are passed on from a
 previous page):
 
 // database definition
 $def = array(
   array(phone,C, 10),
   array(comments,C, 254),
   array(starttime,C, 10),
   array(endtime,C, 10),
   array(dispo,C, 80),
   array(lo, C, 50),
   array(verifier, C, 50),
   array(branch,C,3)
 );
 
 // creation
 if (!dbase_create('dbf/'.$bx.'.dbf', $def)) {
   echo BRBRError, can't create the databaseBRBR;
 }
  
 // open in read-write mode
 $db2 = dbase_open(dbf/.$bx..dbf, 2);
 if ($db2) {
   
 mysql_select_db($database_imslead_transfer, $imslead_transfer);
 $query_loDispo = SELECT * FROM $tChoice;
 $loDispo = mysql_query($query_loDispo, $imslead_transfer) or
 die(mysql_error());
 $row_loDispo = mysql_fetch_assoc($loDispo);
 $totalRows_loDispo = mysql_num_rows($loDispo);
 
   // write mySql data to Dbf
   do {
  dbase_add_record($db2, array(
  $row_loDispo['phone'],
  $row_loDispo['comments'],
  $row_loDispo['starttime'],
  $row_loDispo['endtime'],
  $row_loDispo['dispo'],
  $row_loDispo['loanofficer'],
  $row_loDispo['verifier'],
  $bx));
  } while ($row_loDispo = mysql_fetch_assoc($loDispo));
  
 dbase_close($db2);
 }
 
 mysql_free_result($loDispo);
 header(Location: dbf/$bx.dbf);
 
 Now I just need to write a code which takes data from each table, one by
 one, and appends it to the DBF, alongwith adding a field that carries the
 Identifier Value for each table.
 
 Any suggestions?
 
 Rahul S. Johari
 Supervisor, Internet  Administration
 Informed Marketing Services Inc.
 500 Federal Street, Suite 201
 Troy NY 12180
 
 Tel: (518) 687-6700 x154
 Fax: (518) 687-6799
 Email: [EMAIL PROTECTED]
 http://www.informed-sources.com
 
 
 

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



Re: [PHP] Displaying Results on different rows in tables

2007-01-18 Thread Brad Bonkoski

Dan Shirah wrote:

Hello all,

I am trying to pull data and then loop through the multiple results 
display

in seperate rows.
My database contains several tables which are all tied together by the
credit_card_id.  After running the query, it ties the unique record 
together

by matching the credit_card_id in both tables.  How would I go about
displaying the results of this query in a table with a single row for 
each

unique record?

Each row of the result will have 5 columns: Request ID, Date/Time 
Entered,

Status, Payment Type, Last Processed By.

If I assign the results of the query to variables (Such as $id =
$row['credit_card_id'];) how would I display that data?

Would it be something like this:

foreach($row as $data)
{
echo table
   tr
tda href=$item-link$id/a/td
   /tr;
 echo tr
td$dateTime/td
   /tr
 /table;
 echo tr  td$Status/td
   /tr
 /table;

 }
Below is the code I have so far.

?php
$database = database;
$host = host;
$user = username;
$pass = password;
 // Connect to the datbase
 $connection = mssql_connect($host, $user, $pass) or die ('server
connection failed');
 $database = mssql_select_db($database, $connection) or die ('DB
selection failed');
 // Query the table and load all of the records into an array.
 $sql = SELECT
child_support_payment_request.credit_card_id,
  credit_card_payment_request.credit_card_id,
  date_request_received
   FROM child_support_payment_request,
credit_card_payment_request
 WHERE child_support_payment_request.credit_card_id =
credit_card_payment_request.credit_card_id;
First of all, if you are joining on the credit_card_id, you only need to 
select one of them.  So your query would be:
select child_support_payment_request.credit_card_id, 
table_name.date_request_received

from child_support_payment_request, credit_card_payment_request
where child_support_payment_request.credit_card_id = 
credit_card_payment_request.credit_card_id

 $result = mssql_query($sql) or die(mssql_error());
 while ($row=mssql_fetch_array($result));

echo table;
while ($row = mssql_fetch_array($result)) {
   $id = $row['credit_card_id'];
   $dateTime = $row['date_request_received'];
   echo trtd$id/tdtd$dateTime/td/tr;
}
echo /table;

 $id = $row['credit_card_id'];
 $dateTime = $row['date_request_received'];

?



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



Re: [PHP] regular expression help!

2007-01-18 Thread Jochem Maas
William Stokes wrote:
 Hello Roman,
 
 Could you specify the functionality of your script a bit please. (How it 
 works)

it's a hint as to how you might use simpleXML to extract the values of a src
attribute from the definition of an img tag.

 
 I forgot to mention that this part:
 
 img width=99 height=120 border=0 src=%s /',
 
 is not always the same. The image properties can vary.
 
 Thanks
 -Will
 
 
 
 
 Roman Neuhauser [EMAIL PROTECTED] kirjoitti 
 viestissä:[EMAIL PROTECTED]
 # [EMAIL PROTECTED] / 2007-01-18 12:34:36 +0200:
 I need to strip all characters from the following text string exept the
 image path...

 img width=\99\ height=\120\ border=\0\
 src=\../../images/new/thumps/4123141112007590373240.jpg\ /...and then
 store the path to DB. Image path lengh can vary so I guess that I need to
 extract all characters after scr=\until next\or 
 somethig
 similar.
 This passes with 5.2:

 class ImgSrcTest extends Tence_TestCase
 {
private $src, $str, $xml;
function setUp()
{
$this-src = 'fubar.jpg';
$this-str = sprintf(
'img width=99 height=120 border=0 src=%s /',
$this-src
);
$this-xml = new SimpleXmlElement($this-str);
}
function testReturnsAttributeAsSimpleXMLElements()
{
return $this-assertEquals('SimpleXMLElement', 
 get_class($this-xml['src']));
}
function testCastToStringYieldsTheAttributeValue()
{
return $this-assertEquals($this-src, strval($this-xml['src']));
}
 }

 -- 
 How many Vietnam vets does it take to screw in a light bulb?
 You don't know, man.  You don't KNOW.
 Cause you weren't THERE. http://bash.org/?255991 
 

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



Re: [PHP] Oracle Execute Function

2007-01-18 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-18 11:46:10 -0500:
 Hello All,
 
 I have this Oracle function, and within my code I call it like this:
 
 $sql = BEGIN :result := my_funtion_name('$parm1', $parm2, null, null, 
 null); END;;
$stmt = $db-parse($sql);
$rc = null;
ocibindbyname($stmt, :result, $rc);
$db-execute($stmt, $sql);
 
 The problem is that the execute function spits back an error/warning 
 message, but the Oracle function properly executes and the data is in 
 the Database.

And the warning is...?

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] Oracle Execute Function

2007-01-18 Thread Brad Bonkoski

Roman Neuhauser wrote:

# [EMAIL PROTECTED] / 2007-01-18 11:46:10 -0500:
  

Hello All,

I have this Oracle function, and within my code I call it like this:

$sql = BEGIN :result := my_funtion_name('$parm1', $parm2, null, null, 
null); END;;

   $stmt = $db-parse($sql);
   $rc = null;
   ocibindbyname($stmt, :result, $rc);
   $db-execute($stmt, $sql);

The problem is that the execute function spits back an error/warning 
message, but the Oracle function properly executes and the data is in 
the Database.



And the warning is...?

  

Nothing of real use from what I can see..
It falls into this statement:
die('Invalid Statement: ' . $stmt .'('.$query.')'. '  ' . 
htmlentities($error['message']));


So, I get this message back (and the error['message'] part is blank.

It gets there from this:
$result = @ociexecute($stmt);
if(!$result) {
   ...
}
so the return from ociexecute appears to be FALSE.

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



Re: [PHP] Oracle Execute Function

2007-01-18 Thread Brad Bonkoski

Brad Bonkoski wrote:

Roman Neuhauser wrote:

# [EMAIL PROTECTED] / 2007-01-18 11:46:10 -0500:
 

Hello All,

I have this Oracle function, and within my code I call it like this:

$sql = BEGIN :result := my_funtion_name('$parm1', $parm2, null, 
null, null); END;;

   $stmt = $db-parse($sql);
   $rc = null;
   ocibindbyname($stmt, :result, $rc);
   $db-execute($stmt, $sql);

The problem is that the execute function spits back an error/warning 
message, but the Oracle function properly executes and the data is 
in the Database.



And the warning is...?

  

Nothing of real use from what I can see..
It falls into this statement:
die('Invalid Statement: ' . $stmt .'('.$query.')'. '  ' . 
htmlentities($error['message']));


So, I get this message back (and the error['message'] part is blank.

It gets there from this:
$result = @ociexecute($stmt);
if(!$result) {
   ...
}
so the return from ociexecute appears to be FALSE.


After removing the '@' from the ociexecute ... I get this:
PL/SQL: numeric or value error: character string buffer too small
Does this trigger any ideas?

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



Re: [PHP] regular expression help!

2007-01-18 Thread Roman Neuhauser
(Haven't received William's email yet = scavenging Jochem's reply.)

# [EMAIL PROTECTED] / 2007-01-18 18:01:19 +0100:
 William Stokes wrote:
  Roman Neuhauser [EMAIL PROTECTED] kirjoitti 
  This passes with 5.2:
 
  class ImgSrcTest extends Tence_TestCase
  {
 private $src, $str, $xml;
 function setUp()
 {
 $this-src = 'fubar.jpg';
 $this-str = sprintf(
 'img width=99 height=120 border=0 src=%s /',
 $this-src
 );
 $this-xml = new SimpleXmlElement($this-str);
 }
 function testReturnsAttributeAsSimpleXMLElements()
 {
 return $this-assertEquals(
 'SimpleXMLElement', 
 get_class($this-xml['src'])
 );
 }
 function testCastToStringYieldsTheAttributeValue()
 {
 return $this-assertEquals($this-src, strval($this-xml['src']));
 }
  }
  
  Could you specify the functionality of your script a bit please. (How it 
  works)

It's a unit test showing how you can use SimpleXML to do what you want.
It's written for Testilence out of sheer laziness, but any unit testing
tool would do (after cosmetic changes to the code).

The test case contains two pretty obvious tests, just read the
function names, their bodies should be pretty obvious. On thing that
might be a little non-obvious is the strval(): that was the only way I
found to get the string out of the very uncommunicative
SimpleXMLElement.

  I forgot to mention that this part:
  
  img width=99 height=120 border=0 src=%s /',
  
  is not always the same. The image properties can vary.

That's one of the reasons I didn't go the regexp route.
Don't treat XML as text, it's not.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] Going back with multiple submits to the same page

2007-01-18 Thread Otto Wyss

Paul Novitski wrote:

At 1/15/2007 01:52 PM, Otto Wyss wrote:
When values are entered on one of my page I submit the result back 
to the same page (form action=same_page). Unfortunately each submit

adds an entry into the history, so history back doesn't work in a
single step. Yet if the count of submits were known I could use
goto(n). What's the best way to get this count? PHP or Javascript?



What you're suggesting doesn't sound easy.


I know, but what's a better way to to go back?


If you're going to programmatically take the user to a previous page,
 say for example if they click a form button within your page, then 
using JavaScript you could simply walk backward through the 
window.history() array until you came to an URL that doesn't match 
with the current page.  Of course such a solution would break if 
JavaScript were disabled so you'd need to build a redundant system 
server-side to make sure your site didn't break.



My site already heavily depends on Javascript in many places and my
users can be required to have Javascript enabled.

Just looping through history.back() until a different page is reached
could do the trick. Yet is it possible to have a Javascript value across
multiple pages? Has anybody coded something like this?

Since I already store the last different page, I wounder if I could code 
a loop sever side in PHP which issues Javascript history.back.


Of course PHP isn't naturally aware of browser history but you could 
store in the session or cookie the name of the last page in the


I already do and currently I just jump to that page but it would be nice
to go backwards so the user doesn't have to enter the same values all
the time.

functioning of the browser, you could simply let it do its thing and 
take steps server-side to prevent the user from re-submitting the 
current form or whatever your goal is.


I thought that too albeit it means to implement XMLHttpRequests instead 
of submits to get results from the database. Yet for me this seems to be 
more complicated than just going back through the history. My data is 
rather large and complicate structured.


O. Wyss

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



Re: [PHP] Newbie - help with a foreach

2007-01-18 Thread Jochem Maas
Németh Zoltán wrote:
 On cs, 2007-01-18 at 02:04 -0800, pub wrote:
 On Jan 18, 2007, at 2:00 AM, Németh Zoltán wrote:



...

 maybe you should use a parameter for it, place it into the link in the
 first query loop, get it here and query based on it
 
 like SELECT * FROM job WHERE id={$_GET['job_id']} or whatever

SQL INJECTION WAITING TO HAPPEN.


...

  foreach($row as $url)
  {
  $row = mysql_fetch_array($result2,MYSQL_ASSOC);
  if (url={$row['url']})

what is this IF statement supposed to be doing???
because it will always evaluate to true

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



Re: [PHP] Daylight Savings Time in PHP4

2007-01-18 Thread Andrew Kreps

On 1/18/07, mike caplin [EMAIL PROTECTED] wrote:

Does anyone know if the change in Daylight Savings Time (March this year)
affects PHP v4.x?  I looked around www.php.net and all I could find was a
reference to v5 (http://bugs.php.net/bug.php?id=35296).  Is there a v4
release which is compatible with the DST change?  Or even a patch could be
applied?



I've been using PHP for a lot of years, and I've never had a
time-change issue.  I don't think PHP cares what time it is.  When the
time changes, your logs might look a little funny, but it will keep on
chugging.

Now, that doesn't mean that all of your *code* is time-change safe.
Nor does it mean that your system handles the time change properly.  I
can't imagine that PHP itself would cause any issues.

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



Re: [PHP] Displaying Results on different rows in tables

2007-01-18 Thread Dan Shirah

The code above displays no information at all.

What I want to do is:

1. Retrieve my information
2. Assign it to a variable
3. Output the data into a table with each unique record in a seperate row


On 1/18/07, Brad Bonkoski [EMAIL PROTECTED] wrote:


Dan Shirah wrote:
 Hello all,

 I am trying to pull data and then loop through the multiple results
 display
 in seperate rows.
 My database contains several tables which are all tied together by the
 credit_card_id.  After running the query, it ties the unique record
 together
 by matching the credit_card_id in both tables.  How would I go about
 displaying the results of this query in a table with a single row for
 each
 unique record?

 Each row of the result will have 5 columns: Request ID, Date/Time
 Entered,
 Status, Payment Type, Last Processed By.

 If I assign the results of the query to variables (Such as $id =
 $row['credit_card_id'];) how would I display that data?

 Would it be something like this:

 foreach($row as $data)
 {
 echo table
tr
 tda href=$item-link$id/a/td
/tr;
  echo tr
 td$dateTime/td
/tr
  /table;
  echo tr  td$Status/td
/tr
  /table;

  }
 Below is the code I have so far.

 ?php
 $database = database;
 $host = host;
 $user = username;
 $pass = password;
  // Connect to the datbase
  $connection = mssql_connect($host, $user, $pass) or die ('server
 connection failed');
  $database = mssql_select_db($database, $connection) or die ('DB
 selection failed');
  // Query the table and load all of the records into an array.
  $sql = SELECT
 child_support_payment_request.credit_card_id,
   credit_card_payment_request.credit_card_id,
   date_request_received
FROM child_support_payment_request,
 credit_card_payment_request
  WHERE child_support_payment_request.credit_card_id =
 credit_card_payment_request.credit_card_id;
First of all, if you are joining on the credit_card_id, you only need to
select one of them.  So your query would be:
select child_support_payment_request.credit_card_id,
table_name.date_request_received
from child_support_payment_request, credit_card_payment_request
where child_support_payment_request.credit_card_id =
credit_card_payment_request.credit_card_id
  $result = mssql_query($sql) or die(mssql_error());
  while ($row=mssql_fetch_array($result));
echo table;
while ($row = mssql_fetch_array($result)) {
   $id = $row['credit_card_id'];
   $dateTime = $row['date_request_received'];
   echo trtd$id/tdtd$dateTime/td/tr;
}
echo /table;
  $id = $row['credit_card_id'];
  $dateTime = $row['date_request_received'];

 ?





Re: [PHP] Going back with multiple submits to the same page

2007-01-18 Thread Nick Stinemates
 I already do and currently I just jump to that page but it would be nice  

 to go backwards so the user doesn't have to enter the same values all 

 the time.

If that is the case, you can also store their values in the session and load 
them each time.

Just a thought ;)

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



[PHP] email validation string.

2007-01-18 Thread Don
I'm trying to get this line to validate an email address from a form and it
isn't working.

if (ereg([EMAIL PROTECTED],$submittedEmail))

 

The book I'm referencing has this line

if (ereg([EMAIL PROTECTED],$submittedEmail))

 

Anyway.. I welcome any advice as long as it doesn't morph into a political
debate on ADA standards and poverty in Africa. :-)

 

Thanks

 

Don



Re: [PHP] email validation string.

2007-01-18 Thread Nick Stinemates
I just got this from: http://php.net/preg_match

?php
if(eregi (^[[:alnum:[EMAIL PROTECTED],6}$, stripslashes(trim($someVar
{
  echo good;
}
else
{
  echo bad;
}
?


Hope it works out for you.
 - Nick Stinemates

On Thu, Jan 18, 2007 at 01:40:36PM -0700, Don wrote:
 I'm trying to get this line to validate an email address from a form and it
 isn't working.
 
 if (ereg([EMAIL PROTECTED],$submittedEmail))
 
  
 
 The book I'm referencing has this line
 
 if (ereg([EMAIL PROTECTED],$submittedEmail))
 
  
 
 Anyway.. I welcome any advice as long as it doesn't morph into a political
 debate on ADA standards and poverty in Africa. :-)
 
  
 
 Thanks
 
  
 
 Don
 

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



Re: [PHP] Scope of include

2007-01-18 Thread Stut

Robert Cummings wrote:

To answer his question though, variables not declared via the global
keyword and not accessed via the super global variables ($GLOBALS,
$_SESSION, etc) inherit the scope in which the include statement occurs.
Therefore, if in the included file all you have is:

$foo = 'foo';

Then it's scope is the function including the file.


It's important to have this clear in your head when dealing with 
included files, so I wrote an example that will hopefully demonstrate it 
for the OP...


http://dev.stut.net/php/scope/

-Stut

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



RE: [PHP] What makes a PHP expert

2007-01-18 Thread Ligaya A. Turmelle
 
Other reading -
http://phpthinktank.com/archives/47-What-Makes-An-Expert.html

Respectfully,
Ligaya Turmelle

-Original Message-
From: h [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 18, 2007 11:27 PM
To: php-general@lists.php.net
Subject: [PHP] What makes a PHP expert

Dear All



I often see job ads asking for a PHP expert and was wandering what you
all thought makes a PHP programmer into an expert.



what would you mark out as the key skills that distinguishes an expert
from the ordinary i.e. OOP mastery, regular expressions etc.



p.s. I am not an expert but am intersted to see if i could become one!

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



Re: [PHP] Include files beneath pointed directory

2007-01-18 Thread Chris

Wikus Moller wrote:

Hi.

I have a windows server and I know this issue has been dealt with
before but I can't find it, I want to include a file from a directory
beneath or aside my home directory.

Can I use the C:\directory\anotherdirectory\file.php in the include
function like include C:\directory\anotherdirectory\file.php; or do
I need more code to make it work? I am sure I do. The directory would
be aside my home directory.


That should work fine in theory.

I'd suggest using the constant 'DIRECTORY_SEPARATOR' instead:

$path = 'c:' . DIRECTORY_SEPARATOR . 'directory' .

so you don't have to worry about escaping backslashes, otherwise you 
have to write it as:


c:\\directory\\ ...

or

c:/directory/

Both of those should work ok but using the constant you shouldn't have 
any problems with forgetting about escaping a \ .


--
Postgresql  php tutorials
http://www.designmagick.com/

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



[PHP] Storing dynamic attribute data in a db

2007-01-18 Thread Chris W. Parker
Hello,

This is now my 3rd attempt at writing this email. :) The first two were
pretty long...
 
I'm currently working on trying to find a solution that is both simple
and flexible for storing the data of a complicated set of dynamic
options for some of our products. My current thinking is that I will use
Modified Preorder Tree Traversal to organize the data. Each record will
have the following:
 
id (auto-number)
sku (related product's sku)
lft (hierarchy data)
rgt (hierarchy data)
attribute (like: Size, Color, Style)
option (like: Blue, Large, Plain)
pricemodifier (-$20, +$20)

This kind of data is not difficult to handle if every combination that
is available through the different options is actually available from
the manufacturer. However, some combinations are not possible so the
data needs to represent itself that way. For example, all t-shirts come
in Red, Green, or Blue but only Green shirts come in Large. All other
colors have only Small and Medium.

Is there a standard way to handle this kind of thing if not, how would
you handle it?

(On a side note, when the solution is found, could it be called a
pattern?)



Thanks,
Chris.

p.s. Yes this is the short email.

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



Re: [PHP] Displaying Results on different rows in tables

2007-01-18 Thread Chris

Dan Shirah wrote:

The code above displays no information at all.

What I want to do is:

1. Retrieve my information
2. Assign it to a variable
3. Output the data into a table with each unique record in a seperate row



As Brad posted:

echo table;
while ($row = mssql_fetch_array($result)) {
   $id = $row['credit_card_id'];
   $dateTime = $row['date_request_received'];
   echo trtd$id/tdtd$dateTime/td/tr;
}
echo /table;


If that doesn't work, try a print_r($row) inside the loop:

while ($row = mssql_fetch_array($result)) {
  print_r($row);
}

and make sure you are using the right id's / elements from that array.

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] email validation string.

2007-01-18 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-18 06:07:24 -0800:
 I just got this from: http://php.net/preg_match
 
 ?php
 if(eregi (^[[:alnum:[EMAIL PROTECTED],6}$, stripslashes(trim($someVar

That would reject many of my email addresses.  This is more in line with
the standards:

http://marc.theaimsgroup.com/?l=postgresql-generalm=112612299412819w=2

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] Storing values in arrays

2007-01-18 Thread Ryan A


tedd [EMAIL PROTECTED] wrote: At 7:15 AM -0800 1/17/07, Ryan A wrote:
True, but thats not the most important part... I guess I wrote it 
wrong, I meant that it should not write to disk before 1 minute...
anyway... about the array saving any ideas?

Thanks!
R

Why?

 Hey Tedd,

Aww, nothing serious... just had a few ideas running in my head that needs 
something like this... and was wondering if it would save on server processing 
time and resources if done like this rather than writing to disk on every 
login...

Cheers!
R


--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
 
-
Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.

Re: [PHP] Storing values in arrays

2007-01-18 Thread Ryan A


Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2007-01-17 at 07:15 -0800, 
Ryan A wrote:
  Hey!
  Thanks for replying.
  
  Instead of CRON i was thinking of having a file created and check the
  creation time everytime someone logged in... if its less than 1 min
  then don't do anything, if  1 min or more old... write file...
 
 But then it wouldn't be written to disk every one minute if someone
 didn't log in for 3 minutes ;)
 
 True, but thats not the most important part... I guess I wrote it wrong, I 
 meant that it should not write to disk before 1 minute...
 anyway... about the array saving any ideas?


// untested

if( ($fptr = fopen( '/tmp/mySavedArray.dat', 'wb' )) !== false )
{
fwrite( $fptr, serialize( $myArray ) );
fclose( $fptr );
}

?

There's also file_put_contents() but I generally go with backward
compatible methods.
Thanks, will give it a go!

Cheers!
R


--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
 
-
Need a quick answer? Get one in minutes from people who know. Ask your question 
on Yahoo! Answers.

[PHP] problems with sessions variables and virtual domains in apache

2007-01-18 Thread esteban
I have a windows 2000 server with apache 2.0 and php 5.1.2. I use session
variables to validate users, each page have something like this:

if($_SESSION[validated]==0){
  header(Location: index.php);
  exit;
 }

This worked fine when i had only one domain, but when i began to use virtual
domains, sometimes, not always, the session variable lost the value or the
session variable is distroyed, i don't know what really happens.  I add this
lines to httpd.conf for each domain and the main domain is first:

VirtualHost *:80
ServerAdmin [EMAIL PROTECTED]
DocumentRoot C:/Program Files/Apache Group/Apache2/htdocs/domain
ServerName www.domain.com
ErrorLog logs/domain.com-error_log
CustomLog logs/domain.com-access_log common
php_admin_value upload_tmp_dir C:/Program Files/Apache
Group/Apache2/htdocs/domain/tmp
php_admin_value session.save_path C:/Program Files/Apache
Group/Apache2/htdocs/domain/session
/VirtualHost

At the beginning i didn't use the two last lines with php_admin_value, i add
the lines for trying to solve the problem but it doesn't work.

I have an application made with phpmaker and SquierreMail v.1.4.7 too, and i
have the same problem in both. In both case sometimes, when i want to go to
other page, the server ask me for the username and the password, it is not
always.

Please help me

Thanks.

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



Re: [PHP] Storing dynamic attribute data in a db

2007-01-18 Thread Chris

Chris W. Parker wrote:

Hello,

This is now my 3rd attempt at writing this email. :) The first two were
pretty long...
 
I'm currently working on trying to find a solution that is both simple

and flexible for storing the data of a complicated set of dynamic
options for some of our products. My current thinking is that I will use
Modified Preorder Tree Traversal to organize the data. Each record will
have the following:
 
id (auto-number)

sku (related product's sku)
lft (hierarchy data)
rgt (hierarchy data)
attribute (like: Size, Color, Style)
option (like: Blue, Large, Plain)
pricemodifier (-$20, +$20)

This kind of data is not difficult to handle if every combination that
is available through the different options is actually available from
the manufacturer. However, some combinations are not possible so the
data needs to represent itself that way. For example, all t-shirts come
in Red, Green, or Blue but only Green shirts come in Large. All other
colors have only Small and Medium.

Is there a standard way to handle this kind of thing if not, how would
you handle it?


I don't think there's a standard way, just whatever works best at the 
time and most importantly what you understand.


If you have to write a 6 page document to explain what's going on, 
that's probably bad.. because in 6 months time if you need to revisit 
it, you're going to have issues.


Why do you think you need to use a tree? I'm sure it's just a case of me 
not understanding something..


Anyway I'd move the attributes to another table (pseudo-sql):

create table attributes (
  attributeid auto increment,
  attributename ('color'),
  attributevalue ('blue'),
  productid references products(id)
);

No idea what price modifier is or if it applies to specific attributes 
but if it does, move it as well.


Then you can get all attributes easily:

select * from attributes where productid='X';

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] problems with sessions variables and virtual domains in apache

2007-01-18 Thread Chris

esteban wrote:

I have a windows 2000 server with apache 2.0 and php 5.1.2. I use session
variables to validate users, each page have something like this:

if($_SESSION[validated]==0){
  header(Location: index.php);
  exit;
 }

This worked fine when i had only one domain, but when i began to use virtual
domains, sometimes, not always, the session variable lost the value or the
session variable is distroyed, i don't know what really happens.  I add this
lines to httpd.conf for each domain and the main domain is first:

VirtualHost *:80
ServerAdmin [EMAIL PROTECTED]
DocumentRoot C:/Program Files/Apache Group/Apache2/htdocs/domain
ServerName www.domain.com
ErrorLog logs/domain.com-error_log
CustomLog logs/domain.com-access_log common
php_admin_value upload_tmp_dir C:/Program Files/Apache
Group/Apache2/htdocs/domain/tmp
php_admin_value session.save_path C:/Program Files/Apache
Group/Apache2/htdocs/domain/session
/VirtualHost

At the beginning i didn't use the two last lines with php_admin_value, i add
the lines for trying to solve the problem but it doesn't work.

I have an application made with phpmaker and SquierreMail v.1.4.7 too, and i
have the same problem in both. In both case sometimes, when i want to go to
other page, the server ask me for the username and the password, it is not
always.


If you are going across domains (page 1 is on domain 'a' and page 2 is 
on domain 'b'), you need to explicitly pass the session across in the 
query string.


Even them I'm not sure it will work for security reasons.

--
Postgresql  php tutorials
http://www.designmagick.com/

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



RE: [PHP] Storing dynamic attribute data in a db

2007-01-18 Thread Chris W. Parker
On Thursday, January 18, 2007 3:51 PM Chris mailto:[EMAIL PROTECTED]
said:

Hey Chris,

 If you have to write a 6 page document to explain what's going on,
 that's probably bad.. because in 6 months time if you need to revisit
 it, you're going to have issues.

hehe I wouldn't say that my other emails were 6 pages(!) but I tend to
ramble on sometimes. And not only that, sometimes complicated problems
are difficult to explain simply. As I think we've discovered. :P

 Why do you think you need to use a tree? I'm sure it's just a case of
 me not understanding something..

 Anyway I'd move the attributes to another table (pseudo-sql):
[snip]
 Then you can get all attributes easily:
 
 select * from attributes where productid='X';

Consider this. You have three attributes: Color, Size, Collar.

Colors:

Red
Green
Blue

Sizes:

Small
Medium
Large

Collars:

V-Neck
Plain
Turtleneck

If the manufacturer allowed me to order any combination of the above
attributes (and their options) I would need to create only three tables
to organize it: products, products_attributes, and
products_attributes_options. This would allow me to do basically what
your SQL from above does.

1. Give me all the attributes for product 'X'.
2. Then give me all the options for all the attributes returned in Step
1.
3. Display three dropdown boxes.

But the complication comes when the manufacturer says:

1. You can only order a turtleneck if the shirt is green.
2. You can only order red shirts in small and medium.

At this point there is a breakdown in the data.

With the three table setup how can I indicate these requirements in the
data? I don't think I can, but I'm not positive.

On the other hand, if I use a hierarchical dataset I can make the
following tree:

(Copy and paste this into Notepad if it doesn't appear aligned
properly.)
Root
|-Red
| |-Small
| | |-V-Neck
| | |-Plain
| |-Medium
|   |-V-Neck
|   |-Plain
|-Green
| |-Small
| | |-V-Neck
| | |-Plain
| | |-Turtleneck
| |-Medium
| | |-V-Neck
| | |-Plain
| | |-Turtleneck
| |-Large
|   |-V-Neck
|   |-Plain
|   |-Turtleneck
|-Blue
  |-Small
  | |-V-Neck
  | |-Plain
  |-Medium
  | |-V-Neck
  | |-Plain
  |-Large
|-V-Neck
|-Plain

The reason I am writing to the list is to see if there is an easier way
to do this or if I'm heading in the right direction.

 No idea what price modifier is or if it applies to specific attributes
 but if it does, move it as well.

I should have left this part out... It's just the amount the price of a
product will change for that option. Example: Large green shirts are +$5
while all small shirts are -$2.



Chris.

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



Re: [PHP] problems with sessions variables and virtual domains in apache

2007-01-18 Thread Andre Dubuc
On Thursday 18 January 2007 06:26 pm, esteban wrote:
 I have a windows 2000 server with apache 2.0 and php 5.1.2. I use session
 variables to validate users, each page have something like this:

 if($_SESSION[validated]==0){
   header(Location: index.php);
   exit;
  }

 This worked fine when i had only one domain, but when i began to use
 virtual domains, sometimes, not always, the session variable lost the value
 or the session variable is distroyed, i don't know what really happens.  I
 add this lines to httpd.conf for each domain and the main domain is first:

 VirtualHost *:80
 ServerAdmin [EMAIL PROTECTED]
 DocumentRoot C:/Program Files/Apache Group/Apache2/htdocs/domain
 ServerName www.domain.com
 ErrorLog logs/domain.com-error_log
 CustomLog logs/domain.com-access_log common
 php_admin_value upload_tmp_dir C:/Program Files/Apache
 Group/Apache2/htdocs/domain/tmp
 php_admin_value session.save_path C:/Program Files/Apache
 Group/Apache2/htdocs/domain/session
 /VirtualHost

 At the beginning i didn't use the two last lines with php_admin_value, i
 add the lines for trying to solve the problem but it doesn't work.

 I have an application made with phpmaker and SquierreMail v.1.4.7 too, and
 i have the same problem in both. In both case sometimes, when i want to go
 to other page, the server ask me for the username and the password, it is
 not always.

 Please help me

 Thanks.

Following Chris' idea - going from http to https - try this simple technique - 
works for me:

?php session_start(); ob_start(); ?
?php if ($_SERVER['HTTPS'] != on){
header(Location: https://your_domain/the_page_you_want_at_https;);
exit;}
?

Saves you having to explicitly set the page for https

Hth,
Andre

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



Re: [PHP] Storing dynamic attribute data in a db

2007-01-18 Thread Paul Novitski

At 1/18/2007 02:56 PM, Chris W. Parker wrote:

I'm currently working on trying to find a solution that is both simple
and flexible for storing the data of a complicated set of dynamic
options for some of our products. My current thinking is that I will use
Modified Preorder Tree Traversal to organize the data.



Are you considering keeping all the levels of your data tree in a 
single table because you can't predict how many levels there will 
be?  If you CAN predict its depth, wouldn't it be simpler and easier 
to conceive, code, and debug with N tables chained in parent-child 
relationships?


I'm not asking rhetorically but seriously, for discussion.  How are 
you weighing the pros  cons of using MPTT?


Regards,
Paul 


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



RE: [PHP] Storing dynamic attribute data in a db

2007-01-18 Thread Chris W. Parker
On Thursday, January 18, 2007 5:09 PM Paul Novitski
mailto:[EMAIL PROTECTED] said:

 Are you considering keeping all the levels of your data tree in a
 single table because you can't predict how many levels there will
 be?  If you CAN predict its depth, wouldn't it be simpler and easier
 to conceive, code, and debug with N tables chained in parent-child
 relationships?
 
 I'm not asking rhetorically but seriously, for discussion.  How are
 you weighing the pros  cons of using MPTT?

Good question.

In my case it is not possible to determine the depth of each product's
attributes. We deal with many different manufacturers and they all set
their products up differently. Some have (maybe) one attribute while
others can have four or five. I wouldn't doubt that sometime in the
future I will see six or more.

Also, I personally prefer not to hard code values and to instead make
everything flexible. I've done that in the past and it kicks my butt
when requirements change and I have to go through and fix things. I
prefer a slightly higher learning curve in the beginning for greater
flexibility in the future.

Lastly, I don't know if you're familiar with MPTT but it's actually
quite easy to work with once you have a stable set of functions to
manipulate the tree. (I got mine from the Sitepoint article where I
learned about it a few years ago.)

Hope that answers your question.


Chris.

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



[PHP] nuSoap -method '' not defined in service

2007-01-18 Thread blackwater dev

I have the following code but when I hit the page, I get the xml error of
method '' not defined in service.  I don't have a wsdl or anything defined.
Is there more I need to do to get the SOAP service set up?

Thanks!

include(nusoap/nusoap.php);

$server=new soap_server();
$server-register('getColumns');

function getColumns(){

   $search= new carSearch();

   return $search-getSearchColumns();

}
$server-service($HTTP_RAW_POST_DATA);


Re: [PHP] nuSoap -method '' not defined in service

2007-01-18 Thread Chris

blackwater dev wrote:

I have the following code but when I hit the page, I get the xml error of
method '' not defined in service.  I don't have a wsdl or anything defined.
Is there more I need to do to get the SOAP service set up?


Try the nusoap mailing list. They would have a lot more experience with 
it than the people on this list.


http://sourceforge.net/mail/?group_id=57663

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] Oracle Execute Function

2007-01-18 Thread Chris

Brad Bonkoski wrote:

Brad Bonkoski wrote:

Roman Neuhauser wrote:

# [EMAIL PROTECTED] / 2007-01-18 11:46:10 -0500:
 

Hello All,

I have this Oracle function, and within my code I call it like this:

$sql = BEGIN :result := my_funtion_name('$parm1', $parm2, null, 
null, null); END;;

   $stmt = $db-parse($sql);
   $rc = null;
   ocibindbyname($stmt, :result, $rc);
   $db-execute($stmt, $sql);

The problem is that the execute function spits back an error/warning 
message, but the Oracle function properly executes and the data is 
in the Database.



And the warning is...?

  

Nothing of real use from what I can see..
It falls into this statement:
die('Invalid Statement: ' . $stmt .'('.$query.')'. '  ' . 
htmlentities($error['message']));


So, I get this message back (and the error['message'] part is blank.

It gets there from this:
$result = @ociexecute($stmt);
if(!$result) {
   ...
}
so the return from ociexecute appears to be FALSE.


After removing the '@' from the ociexecute ... I get this:
PL/SQL: numeric or value error: character string buffer too small
Does this trigger any ideas?



Sounds like an issue with your function. Does it work ok outside of php?

--
Postgresql  php tutorials
http://www.designmagick.com/

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



[PHP] what do i need to disable

2007-01-18 Thread Don
Ok,

 

You have been very helpful with my questions so far and I thank you for
that.

 

My next task is disable harmful tags/scripts in a full text field.

 

I want to store a bio type field and I am considering allowing html (to
allow a myspace type of customization to the page), but I am really new to
this so I really don't know what kind of trouble I am asking for. 

 

I'm sure that I need to block JavaScript, but are there other things (tags,
scripting, etc.)  that can be input into my DB that will cause problems
either being stored as such or when accessed?

 

Again, thanks for the advice in advance.

 

Don