Re: [PHP] What did I do wrong to cause a parse error?

2003-07-10 Thread Phil Powell
Thanx I got it to work, however, I have no idea why it works now considering
I did nothing different:

$singleProfileHTML .= "\n";

Beats the heck out of me!

Phil
- Original Message -
From: "David Otton" <[EMAIL PROTECTED]>
To: "Phil Powell" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, July 11, 2003 2:48 AM
Subject: Re: [PHP] What did I do wrong to cause a parse error?


> On Fri, 11 Jul 2003 00:53:32 -0400, you wrote:
>
> >foreach ($profileArray[$i][attributes] as $key => $val) {
> > $singleProfileHTML .= $key . "=\"" . str_replace("'", ''',
str_replace('"', '"', $val)) . "\"\n";
> >}
> >
> >The parsing error occurs in the "$singleProfileHTML.." line.  I'm
completely don't get it; I see absolutely nothing wrong with this, what did
I miss?
>
> Line 1 - attributes should have a $ in front of it, or be a string
literal.
>
> BTW, that's a really nasty line. Maybe it would be easier to read as :
>
> foreach ($profileArray[$i][$attributes] as $key => $val) {
> $val = str_replace('"', '"', $val);
> $val = str_replace("'", ''', $val);
> $singleProfileHTML .= "$key=\"$val\"\n";
> }
>


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



Re: [PHP] Variable Functions...

2003-07-10 Thread Burhan Khalid
On Friday, July 11, 2003, 3:11:51 AM, Michael wrote:

MS> Smarty has a class method where it calls:

$this->$some_var("somevalue");

Are you sure about that syntax? I'm not too familiar with Smarty, only
used it once, but I think its $this->some_var("value");

MS> and this throws errors on Windows versions of php that i've tried. why 
MS> is that?

Does it error out on l/unix?



-- 
Regards,
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com


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



Re: [PHP] regexp problem

2003-07-10 Thread Burhan Khalid
On Thursday, July 10, 2003, 9:25:31 PM, Taylor wrote:

TY> First,
TY> I need the code to replace the link in a string, like

TY>  with 

TY> ereg_replace("''", "''",
TY> $old);

TY> That was the closest i got, but (.*) makes it take the first BASE HREF, and
the last ">>, which sucks.
TY> Can anyone help?

I'm not a regex guru by any means, but I think your problem here is
that your expression is "greedy". Try (.?) ... I think.

TY> Second,
TY> I hate asking for help on Regexps...I would like a tutorial online that
TY> steps me through one method of them at a time, and then lets me move
TY> on...kindof like math. You have to know the basics befor you can get
TY> advanced.  Any help there either?

I have found that the best people to ask for regex questions are PERL
programmers. They seem to have the insider knowledge on this stuff.

There are a few online tutorials that I've seen, but none that I could
recommend with any confidence. They are simply "this expression does
this, and put it together ... wow it works! Regexs are great!"

There is a #perl channel on freenode (IRC) that I have found to be
extremely helpful in this regard.

If you do find any good tutorials, I would appreciate an offline.


-- 
Regards,
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com


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



Re: [PHP] What did I do wrong to cause a parse error?

2003-07-10 Thread David Otton
On Fri, 11 Jul 2003 00:53:32 -0400, you wrote:

>foreach ($profileArray[$i][attributes] as $key => $val) {
> $singleProfileHTML .= $key . "=\"" . str_replace("'", ''', str_replace('"', 
> '"', $val)) . "\"\n";
>}
>
>The parsing error occurs in the "$singleProfileHTML.." line.  I'm completely don't 
>get it; I see absolutely nothing wrong with this, what did I miss?

Line 1 - attributes should have a $ in front of it, or be a string literal.

BTW, that's a really nasty line. Maybe it would be easier to read as :

foreach ($profileArray[$i][$attributes] as $key => $val) {
$val = str_replace('"', '"', $val);
$val = str_replace("'", ''', $val);
$singleProfileHTML .= "$key=\"$val\"\n";
}


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



Re: [PHP] What did I do wrong to cause a parse error?

2003-07-10 Thread Lars Torben Wilson
Hi there,

On Thu, 2003-07-10 at 21:53, Phil Powell wrote:
> foreach ($profileArray[$i][attributes] as $key => $val) {
 ^^
You should quote the word 'attributes':

http://www.php.net/manual/en/language.types.array.php#language.types.array.donts

Sorry...that link might wrap. Anyway, I doubt that's the problem...

>  $singleProfileHTML .= $key . "=\"" . str_replace("'", ''', 
> str_replace('"', '"', $val)) . "\"\n";
> }

No idea. All I did was copy-paste your code and add a test definition
for the other vars, and I just got this:

[Script]
 
  array('attributes' =>
array('height' => '"168" cm',
  'weight' => '\'65\' kg')));

$singleProfileHTML = '';
$i = 1;

foreach ($profileArray[$i][attributes] as $key => $val) {
$singleProfileHTML .= $key . "=\"" . str_replace("'", ''',
str_replace('"', '"', $val)) . "\"\n";
}

print_r($singleProfileHTML);
?>

[Output]
Notice:  Use of undefined constant attributes - assumed 'attributes' in 
/home/torben/public_html/phptest/__phplist.html on line 36

height=""168" cm"
weight="'65' kg"

> The parsing error occurs in the "$singleProfileHTML.." line.  I'm
>  completely don't get it; I see absolutely nothing wrong with this,
>  what did I miss?
>
> Phil

I don't see anything wrong. Perhaps you have a non-printable control
character embedded in your code? Try copy-pasting the above code (but
quote that array key) and see if that helps. Also, check the code
before that line for unclosed quotes and braces/parens or other
problems; some parse errors can show up far from where they actually
occurred.

Other than that, without knowing anything else, it's hard to say off the
top of my head.


-- 
 Torben Wilson <[EMAIL PROTECTED]>+1.604.709.0506
 http://www.thebuttlesschaps.com  http://www.inflatableeye.com
 http://www.hybrid17.com  http://www.themainonmain.com
 - Boycott Starbucks!  http://www.haidabuckscafe.com -




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



Re: [PHP] How to hide url on a php link NOT post...

2003-07-10 Thread Jeff Harris
On Jul 10, 2003, "Joey" claimed that:

|How can I hide this link so value can't be changed?
|I don't want to change anything at the server level, and its not from a
|form so I cant do a post -vs- a get.
|
|http://www.abcd.com/popup_SearchRepSet.php?searchby=cust_no&search=1&value=WOR032
|
|Thanks !
|

#1) [Not PHP] Make it a post that looks like a link. See previous posting
at http://marc.theaimsgroup.com/?l=php-general&m=105597453308214&w=2

#2) [Not PHP] If the values will never change, try http://tinyurl.com. If
you're keeping track of referrals, it might mess up your statistics.

#3) [Not PHP] Make that link inside a frame. One frameset would be
invisible, the other would be the link.

-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



[PHP] Re: pdf file error?

2003-07-10 Thread Micah Montoy
Never mind.  I found the error.

thanks

"Micah Montoy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I did my research.  We'll, searched the net anyway without a solution.  I
am
> getting the error:
>
> Fatal error: PDFlib error: function 'PDF_set_info' must not be called in
> 'object' scope in
> c:\inetpub\wwwroot\webpage10\example\utilities\pdf_maker\act_p_makePDF.php
> on line 4
>
> I read that this is because file write permissions are not set on the
> directory where the file is to be written, so I set write permissions and
> still the exact same thing. I even set write permissions for the whole
> directory and restarted IIS with the same results.  Now when I use the
exact
> same script in a completely different directory on the webserver, it
creates
> the PDF just fine.  The permissions are the same, just a different
> directory.  Here is the PDF script I'm testing out:
>
>  $pdf = pdf_new();
> pdf_open_file($pdf, "test.pdf");
> pdf_set_info($pdf, "Author", "Uwe Steinmann");  //line 4
> pdf_set_info($pdf, "Title", "Test for PHP wrapper of PDFlib 2.0");
> pdf_set_info($pdf, "Creator", "See Author");
> pdf_set_info($pdf, "Subject", "Testing");
> pdf_begin_page($pdf, 595, 842);
> pdf_add_outline($pdf, "Page 5");
> $font = pdf_findfont($pdf, "Times New Roman", "winansi", 1);
> pdf_setfont($pdf, $font, 10);
> pdf_set_value($pdf, "textrendering", 1);
> pdf_show_xy($pdf, "Times Roman outlined", 50, 750);
> pdf_moveto($pdf, 50, 740);
> pdf_lineto($pdf, 530, 740);
> pdf_stroke($pdf);
> pdf_end_page($pdf);
> pdf_close($pdf);
> pdf_delete($pdf);
> echo "finished";
> ?>
>
> Anyone encounter such a thing and have a possible solution for this?
>
> thanks
>
>



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



RE: [PHP] dump $_POST into variables????

2003-07-10 Thread Joe Harman
Ah... Jason Man Of Few Words! THANKs... You have saved me time and
lines in my code :-)

Cheers!
Joe

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 11, 2003 1:13 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] dump $_POST into variables


On Friday 11 July 2003 13:01, Joe Harman wrote:
> Okay, curious if there is an easier way to do this... here is what I 
> do
>
>   $ZipCode = $_POST['zip'];
>  $Distance = $_POST['distance'];
> ?>
>
> can't I just dump these into an array and and assign it to a 
> variable... maybe that doesn't make sense... basically I just want to 
> have one command that retrives all the "POST" variables... then list 
> my variables ie $ZipCode, $Distance, $Blah - have them dump in to 
> each!!!

extract()

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I THINK THEY SHOULD CONTINUE the policy of not giving a Nobel Prize for
paneling.
-- Jack Handley, The New Mexican, 1988.
*/


-- 
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] dump $_POST into variables????

2003-07-10 Thread Jason Wong
On Friday 11 July 2003 13:01, Joe Harman wrote:
> Okay, curious if there is an easier way to do this... here is what I do
>
>   $ZipCode = $_POST['zip'];
>  $Distance = $_POST['distance'];
> ?>
>
> can't I just dump these into an array and and assign it to a variable...
> maybe that doesn't make sense... basically I just want to have one
> command that retrives all the "POST" variables... then list my variables
> ie $ZipCode, $Distance, $Blah - have them dump in to each!!!

extract()

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I THINK THEY SHOULD CONTINUE the policy of not giving a Nobel Prize for
paneling.
-- Jack Handley, The New Mexican, 1988.
*/


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



[PHP] just wondering

2003-07-10 Thread Artoo
Just wondering if there's a clear screen function in PHP like the clrscr()
in 'C'.

Thanks



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



[PHP] dump $_POST into variables????

2003-07-10 Thread Joe Harman
Okay, curious if there is an easier way to do this... here is what I do
 

 
can't I just dump these into an array and and assign it to a variable...
maybe that doesn't make sense... basically I just want to have one
command that retrives all the "POST" variables... then list my variables
ie $ZipCode, $Distance, $Blah - have them dump in to each!!!
 
thanks
 
Joe Harman

http://www.HarmanMedia.com

You will never be happy if you continue to search for what happiness
consists of. You will never live if you are looking for the meaning of
life. - Albert Camus 
 


[PHP] What did I do wrong to cause a parse error?

2003-07-10 Thread Phil Powell
foreach ($profileArray[$i][attributes] as $key => $val) {
 $singleProfileHTML .= $key . "=\"" . str_replace("'", ''', str_replace('"', 
'"', $val)) . "\"\n";
}

The parsing error occurs in the "$singleProfileHTML.." line.  I'm completely don't get 
it; I see absolutely nothing wrong with this, what did I miss?

Phil


Re: [PHP] Excel Parser

2003-07-10 Thread Tom Rogers
Hi,

Friday, July 11, 2003, 4:27:13 AM, you wrote:
JM> Hi all,
JM> Does anyone know of any free Excel parsing non-COM code available on the
JM> net? Just straight php driven?

JM> I've found a couple commercial solutions but would like to try this myself
JM> or save money. Thanks for any help.

JM> Johnny

I have started an exel reader class that outputs a table and a style
sheet that may help get you started. still needs quite a bit of work
but the basics are there. Let me know and I'll email you the files.

-- 
regards,
Tom


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



[PHP] pdf file error?

2003-07-10 Thread Micah Montoy
I did my research.  We'll, searched the net anyway without a solution.  I am
getting the error:

Fatal error: PDFlib error: function 'PDF_set_info' must not be called in
'object' scope in
c:\inetpub\wwwroot\webpage10\example\utilities\pdf_maker\act_p_makePDF.php
on line 4

I read that this is because file write permissions are not set on the
directory where the file is to be written, so I set write permissions and
still the exact same thing. I even set write permissions for the whole
directory and restarted IIS with the same results.  Now when I use the exact
same script in a completely different directory on the webserver, it creates
the PDF just fine.  The permissions are the same, just a different
directory.  Here is the PDF script I'm testing out:

finished";
?>

Anyone encounter such a thing and have a possible solution for this?

thanks



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



Re[2]: [PHP] /etc/passwd

2003-07-10 Thread Mantas Kriauciunas
Hello Wendell,

Thursday, July 10, 2003, 6:59:25 AM, you wrote:

>>>  So how to make sure that no one can access other people files and
>>>  server files? and is there any way that nobody would be able to
>>>  download php files or how to make them look like code when they are
>>>  downloaded. Thanks!

WB> I think he means "How do I keep people who have access to upload their
WB> OWN php scripts to my server from accessing files outside their
WB> directory?"  :)

WB> Check out the following:

>> http://www.php.net/manual/en/features.safe-mode.php#ini.open-basedir

>> http://www.php.net/manual/en/security.php
>> http://www.php.net/manual/en/features.safe-mode.php#ini.safe-mode




Thanks a lot! that helped :)

-- 
Best regards,
 Mantasmailto:[EMAIL PROTECTED]



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



RE: [PHP] Blatant newbie question - killing a session

2003-07-10 Thread Bruce Bruen
Thanks,

That did the trick.  Nicely encapsualable too, so I can easily remove
it.

Regards
Bruce

-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 10 July 2003 8:23 PM
To: Bruce Bruen
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Blatant newbie question - killing a session


You mean killing the session cookie?
setcookie (session_name(), "", time() - 3600);
session_unset(); // or $_SESSION = array();
session_destroy();

Bruce Bruen wrote:

> Hi, this is my first question to the list and ... Yes I'm a newbie, 
> verrry wet behind the ears.
> 
> I am trying to set up a secured site under IIS.  I have done pretty 
> well by my standard to get to where I have.  Authoursed users can 
> access the site, unauthorised ones get sent elsewhere.  So, I am now 
> up to testing the various security combinations and its driving me mad

> that the session persists when I'm testing bad logins.
> 
> How or where does one set up a "session extuinguisher"?  After one two

> or n attempts I want to kill the entire session and start afresh - 
> note this is in testig only, the way it works now is great for live.
> 
> Tia
> Bruce
> 
> 


-- 
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[5]: [PHP] Object assignment

2003-07-10 Thread Tom Rogers
Hi,

Did some more tweaking and if we create a new element for each node
ther is no need to clone, saves a few lines of code :)

function parseBranch($branch, &$doc, &$parent)
{
foreach ($branch as $key => $val) { 
switch ($key) { 
// parent attributes 
case ('ATTRIBUTES'): 
foreach ($val as $attrName => $attrVal) {
switch ($attrName){
case 'VALUE':
$nodeValue  = 
$doc->create_text_node($attrVal);
$parentValue = 
$parent->append_child($nodeValue); 
break;
default:

$parent->set_attribute($attrName, $attrVal);
break;
}
} 
break; 
// parent value 
case ('VALUE'): 
$nodeValue  = $doc->create_text_node($val); 
$parentValue = $parent->append_child($nodeValue); 
break; 
default: 
// parse children of this node 
foreach ($val as $children) {
//create node
$node = $doc->create_element($key);
$child = $parent->append_child($node);
//set is elements
parseBranch($children, $doc, $child); 
} 
break; 
} 
} 
}





-- 
regards,
Tom


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



Re: [PHP] Need hep with mysql function

2003-07-10 Thread Robert Cummings
This has been discussed a lot on many of the PHP forums in the past few
weeks. Mysql is not longer bundled with PHP. You need to use the
configuration option and set the location of your mysql base directory.

Cheers,
Rob.

On Thu, 2003-07-10 at 21:30, zlut arch wrote:
> Hi,
> 
> I encountered a problem that I have never seen in my 3 years of using php 
> and mysql. Yesterday, I installed MySql, php5, and apache2 on my new laptop. 
> php5 worked fine with apache2, and MySql was working fine on its own. But 
> when I tried to connect to MySql database, I get a strange error message: 
> "Fatal error: Call to undefined function: mysql_connect()". I thought this 
> is very strange since mysql_connect() is a built-in function in php5. How 
> can it be an undefined function? Does anyone know what is going on?
> 
> Thanks,
> 
> Zlutarch
> 
> _
> Add photos to your messages with MSN 8. Get 2 months FREE*.  
> http://join.msn.com/?page=features/featuredemail
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



[PHP] Need hep with mysql function

2003-07-10 Thread zlut arch
Hi,

I encountered a problem that I have never seen in my 3 years of using php 
and mysql. Yesterday, I installed MySql, php5, and apache2 on my new laptop. 
php5 worked fine with apache2, and MySql was working fine on its own. But 
when I tried to connect to MySql database, I get a strange error message: 
"Fatal error: Call to undefined function: mysql_connect()". I thought this 
is very strange since mysql_connect() is a built-in function in php5. How 
can it be an undefined function? Does anyone know what is going on?

Thanks,

Zlutarch

_
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail

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


RE: [PHP] Storing HTML string in database

2003-07-10 Thread Aaron Axelsen
 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I had forgotten about that, thanks alot

- ---
Aaron Axelsen
AIM: AAAK2
Email: [EMAIL PROTECTED]

Want reliable web hosting at affordable prices?
www.modevia.com
 
Web Dev/Design Community/Zine
www.developercube.com



- -Original Message-
From: Jacob C [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 10, 2003 8:18 PM
To: Aaron Axelsen
Subject: Re: [PHP] Storing HTML string in database


Have a look at:

http://www.php.net/addslashes


Quoting Aaron Axelsen <[EMAIL PROTECTED]>:

>  
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> I have a php script set up for a user to upload a word document,
> which  is then coverted to html form, which I would then lke to
> store in a  database.
> 
> Howver, when I run the following command:
> 
> INSERT into sermons (data) VALUE ('$output');
> 
> It failes to work, because the $output strings contains "", which 
> messes things up.  Is there some way that this can be ignored while
>  entering into the databse?
> 
> Or am I better of replace all the "" with ''?
> 
> Thanks for the assistance.
> 
> - ---
> Aaron Axelsen
> AIM: AAAK2
> Email: [EMAIL PROTECTED]
> 
> Want reliable web hosting at affordable prices? www.modevia.com
>  
> Web Dev/Design Community/Zine
> www.developercube.com
> 
> 
> -BEGIN PGP SIGNATURE-
> Version: PGPfreeware 7.0.3 for non-commercial use
>   
> 
> iQA/AwUBPw4PI7rnDjSLw9ADEQLL5QCg6rxSs/roIiGyxC6nN3XNiuONg00AoK/T
> PSAAAbM+O7+e6iVNMMnpK5AC
> =phqJ
> -END PGP SIGNATURE-
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


- -- 
"If there's a World War III, World War IV will be fought with sticks
and 
stones."

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBPw4S7rrnDjSLw9ADEQIQXACfYZfZ7CAp0q2tbwC0cpZQthcfS3wAn2XM
0vltmGXLCHmFaUFAx5paU8ya
=TYDm
-END PGP SIGNATURE-



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



Re[4]: [PHP] Object assignment

2003-07-10 Thread Tom Rogers
Hi,

Friday, July 11, 2003, 4:30:41 AM, you wrote:
MG> Well I've made a signifigant improvement to this function, and it's now the
MG> parsing operation is only something like 26 lines.  It works flawlessly (so
MG> far) for XML that does not have repeat element names on the same level.
MG> Which seems to be bad form anyway, using similar element names and
MG> distinguishing them with attributes.

MG> I'd still like the code to work with XML that did have similarly named
MG> elements in the same node level.. can you see anything in my DOMXML calls
MG> that might indicate the problem?

I rearranged the way you did your parsing and came up with this:

function parseBranch($branch, &$doc, &$parent)
{
static $elements = array();
foreach ($branch as $key => $val) { 
switch ($key) { 
// parent attributes 
case ('ATTRIBUTES'): 
foreach ($val as $attrName => $attrVal) {
switch ($attrName){
case 'VALUE':
$nodeValue  = 
$doc->create_text_node($attrVal);
$parentValue = 
$parent->append_child($nodeValue); 
break;
default:

$parent->set_attribute($attrName, $attrVal);
break;
}
} 
break; 
// parent value 
case ('VALUE'): 
$nodeValue  = $doc->create_text_node($val); 
$parentValue = $parent->append_child($nodeValue); 
break; 
default: 
// add child element
if(!isset($elements[$key])){
$elements[$key] = $doc->create_element($key);
}
// parse children of this node 
foreach ($val as $children) {
//create node
$child = 
$parent->append_child($elements[$key]->clone_node());
//set its elements
parseBranch($children, $doc, $child); 
} 
break; 
} 
} 
}

which gives



  Value 1
  Value 2


-- 
regards,
Tom


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



RE: [PHP] download php

2003-07-10 Thread Ow Mun Heng
I'm not sure about FreeBSD but on Redhat, the /etc/passwd 'IS' meant to be
world readable. But fortunately it's only stores usernames and Real names
and etc.. whereas /etc/shadow is only root readable and it's the file that
stores user's passwords.

I think that's pretty secure.

Why are you parsing through /etc/passwd anyway?

Anyway, I might have gotten your question wrongly or something. I still need
to figure out how to "JAIL" apache or 'ensure that you put files like
/etc/passwd OUTSIDE your web root.' That;s something which I've not know how
to do YET.

Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168


-Original Message-
From: Daniel J. Rychlik [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 1:46 AM
To: Marek Kilimajer; Mantas Kriauciunas
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] download php


You should also store passwords in a non-readable to the world directory.  

-Dan

- Original Message - 
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
To: "Mantas Kriauciunas" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, July 10, 2003 5:01 AM
Subject: Re: [PHP] download php


> Do you use secure connection? Well, you should.
> 
> Mantas Kriauciunas wrote:
> 
> > Hello php-general,
> > 
> >   some hacker just tries his luck everyday to get me pissed, is it
> >   possible to make php files not downloadable? or coded? or something?
> >   because some dude knows my passwords every time, and with them
> >   passes the shity security to main user, thank god not root.
> > 
> >   So is there any way?
> > 
> >   if anyone knows any links or resources, please reply, i'll check
> >   them, i need to put this to end
> > 
> >   P.S system is freebsd.
> > 
> >   Thank you!!!
> > 
> >   there are even more and more kids that want to be named haker,
> >   lookin at their age, could be even my son:)
> > 
> 
> 
> -- 
> 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] Storing HTML string in database

2003-07-10 Thread Jacob C

Have a look at:

http://www.php.net/addslashes


Quoting Aaron Axelsen <[EMAIL PROTECTED]>:

>  
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> I have a php script set up for a user to upload a word document,
> which is then coverted to html form, which I would then lke to store
> in a database.
> 
> Howver, when I run the following command:
> 
> INSERT into sermons (data) VALUE ('$output');
> 
> It failes to work, because the $output strings contains "", which
> messes things up.  Is there some way that this can be ignored while
> entering into the databse?
> 
> Or am I better of replace all the "" with ''?
> 
> Thanks for the assistance.
> 
> - ---
> Aaron Axelsen
> AIM: AAAK2
> Email: [EMAIL PROTECTED]
> 
> Want reliable web hosting at affordable prices?
> www.modevia.com
>  
> Web Dev/Design Community/Zine
> www.developercube.com
> 
> 
> -BEGIN PGP SIGNATURE-
> Version: PGPfreeware 7.0.3 for non-commercial use 
> 
> iQA/AwUBPw4PI7rnDjSLw9ADEQLL5QCg6rxSs/roIiGyxC6nN3XNiuONg00AoK/T
> PSAAAbM+O7+e6iVNMMnpK5AC
> =phqJ
> -END PGP SIGNATURE-
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
"If there's a World War III, World War IV will be fought with sticks and 
stones."

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



[PHP] RE: Blatant newbie question - killing a session

2003-07-10 Thread Ow Mun Heng
session_destroy()??

Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168


-Original Message-
From: Bruce Bruen [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 10, 2003 2:48 PM
To: [EMAIL PROTECTED]
Subject: Blatant newbie question - killing a session


Hi, this is my first question to the list and ... Yes I'm a newbie,
verrry wet behind the ears.

I am trying to set up a secured site under IIS.  I have done pretty well
by my standard to get to where I have.  Authoursed users can access the
site, unauthorised ones get sent elsewhere.  So, I am now up to testing
the various security combinations and its driving me mad that the
session persists when I'm testing bad logins.

How or where does one set up a "session extuinguisher"?  After one two
or n attempts I want to kill the entire session and start afresh - note
this is in testig only, the way it works now is great for live.

Tia
Bruce


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



[PHP] Storing HTML string in database

2003-07-10 Thread Aaron Axelsen
 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I have a php script set up for a user to upload a word document,
which is then coverted to html form, which I would then lke to store
in a database.

Howver, when I run the following command:

INSERT into sermons (data) VALUE ('$output');

It failes to work, because the $output strings contains "", which
messes things up.  Is there some way that this can be ignored while
entering into the databse?

Or am I better of replace all the "" with ''?

Thanks for the assistance.

- ---
Aaron Axelsen
AIM: AAAK2
Email: [EMAIL PROTECTED]

Want reliable web hosting at affordable prices?
www.modevia.com
 
Web Dev/Design Community/Zine
www.developercube.com


-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBPw4PI7rnDjSLw9ADEQLL5QCg6rxSs/roIiGyxC6nN3XNiuONg00AoK/T
PSAAAbM+O7+e6iVNMMnpK5AC
=phqJ
-END PGP SIGNATURE-



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



[PHP] Storing SQL Queries for Reuse in Apps

2003-07-10 Thread Jacob C
Hello All,

I just want to survey the list and see what kind of solutions people are using 
for the storage and reuse of SQL queries.

Right now I am working on an application that has native SQL queries as well 
as custom queries that can be added by developers as they build on the 
framework.

In the past I have done several things to store large sets of SQL queries. 
Some are better than others and some just shouldn't be used (hardcoded):

- Hardcoded into the application (written into classes or procedural code as 
needed).
- Stored in a delimited text file.
- Placed into a function or class method using switch to iterate by category 
and ID.
- Stored in an XML file.

I am kind of leaning towards the XML solution since the native queries can 
then easily be updated for people using the application. Of course using XML 
adds execution time and complexity to the app.

Anybody have any other solutions I haven't thought of or trick/tweaks to the 
ones I have listed?

Thanks!
Jacob

-- 
"If there's a World War III, World War IV will be fought with sticks and 
stones."

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



[PHP] Re: How to hide url on a php link NOT post...

2003-07-10 Thread Shena Delian O'Brien
http://www.tinyurl.com

Joey wrote:
How can I hide this link so value can't be changed?
I don't want to change anything at the server level, and its not from a 
form so I cant do a post -vs- a get.

http://www.abcd.com/popup_SearchRepSet.php?searchby=cust_no&search=1&value=WOR032 

Thanks !



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


[PHP] Variable Functions...

2003-07-10 Thread Michael Smith
Smarty has a class method where it calls:

$this->$some_var("somevalue");

and this throws errors on Windows versions of php that i've tried. why 
is that?

-Michael
--
Pratt Museum IT Intern
All programmers are playwrights and all computers are lousy actors.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] How to hide url on a php link NOT post...

2003-07-10 Thread Joey
How can I hide this link so value can't be changed?
I don't want to change anything at the server level, and its not from a 
form so I cant do a post -vs- a get.

http://www.abcd.com/popup_SearchRepSet.php?searchby=cust_no&search=1&value=WOR032

Thanks !

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


[PHP] Re: Using DOMXML with homogenous elements

2003-07-10 Thread Matt Grimm
I failed to show the output XML in my last message.  It's outputting like
so:

[xml]

Value1Value2

[/xml]

--
Matt Grimm


"Matt Grimm" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have a final kink to work out of an array to XML parser I've been
writing.
> The array structure is below, along with the example XML it came from.  A
> link to the source I'm working on is at bottom.  The only problem this
> script runs into is when there are multiple elements with the same name on
> the same node level.  It crams all the values into a single element with
> that name, and uses only the final element's attributes.  It seemed like
> clone_node() was the answer, but it isn't working correctly in this
> context -- anyone see why?  I sure don't.
>
> [xml]
> 
> 
>   Value 1
>   Value 2
> 
> [/xml]
>
> [array]
> Array
> (
> [rootElement] => Array
> (
> [0] => Array
> (
> [record] => Array
> (
> [0] => Array
> (
> [ATTRIBUTES] => Array
> (
> [id] => 1
> )
>
> [VALUE] => Value 1
> )
>
> [1] => Array
> (
> [ATTRIBUTES] => Array
> (
> [id] => 2
> )
>
> [VALUE] => Value 2
> )
>
> )
>
> )
>
> )
>
> )
> [/array]
>
> Source:
> http://www.healthtvchannel.org/test/php2xml.phps
>
> Thanks,
> --
> Matt Grimm
> Web Developer
> The Health TV Channel, Inc.
> (a non - profit organization)
> 3820 Lake Otis Parkway
> Anchorage, AK 99508
> 907.770.6200 ext. 686
> 907.336.6205 (fax)
> E-mail: [EMAIL PROTECTED]
> Web: www.healthtvchannel.org
>
>



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



RE: [PHP] nlist

2003-07-10 Thread Johnny Martinez
This is it. Thanks guys!

J

-Original Message-
From: Robert C. [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 10, 2003 4:24 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] nlist


http://www.php.net/readdir

 Original Message 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED], 
Subject: RE: [PHP] nlist
Date: Thu, 10 Jul 2003 16:17:30 -0700

>Hi all,
>Is there a local filesystem-based function comparable to the 
>ftp-based
>'nlist' that lists files in a directory?
>
>Johnny
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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

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



Re: [PHP] nlist

2003-07-10 Thread David Nicholson
Hello,


This is a reply to an e-mail that you wrote on Fri, 11 Jul 2003 at 00:17,
lines prefixed by '>' were originally written by you.
> Is there a local filesystem-based function comparable to the ftp-based
> 'nlist' that lists files in a directory?
> Johnny

In PHP 5 you can use scandir()
http://uk.php.net/manual/en/function.scandir.php

In lower versions AFAIK you will have to use the system function to call
either ls (on *nix) or dir (on windows).

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

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



RE: [PHP] nlist

2003-07-10 Thread Robert C.
http://www.php.net/readdir

 Original Message 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED], 
Subject: RE: [PHP] nlist
Date: Thu, 10 Jul 2003 16:17:30 -0700

>Hi all,
>Is there a local filesystem-based function comparable to the 
>ftp-based
>'nlist' that lists files in a directory?
>
>Johnny
>
>-- 
>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] nlist

2003-07-10 Thread Johnny Martinez
Hi all,
Is there a local filesystem-based function comparable to the ftp-based
'nlist' that lists files in a directory?

Johnny

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



[PHP] Using DOMXML with homogenous elements

2003-07-10 Thread Matt Grimm
I have a final kink to work out of an array to XML parser I've been writing.
The array structure is below, along with the example XML it came from.  A
link to the source I'm working on is at bottom.  The only problem this
script runs into is when there are multiple elements with the same name on
the same node level.  It crams all the values into a single element with
that name, and uses only the final element's attributes.  It seemed like
clone_node() was the answer, but it isn't working correctly in this
context -- anyone see why?  I sure don't.

[xml]


  Value 1
  Value 2

[/xml]

[array]
Array
(
[rootElement] => Array
(
[0] => Array
(
[record] => Array
(
[0] => Array
(
[ATTRIBUTES] => Array
(
[id] => 1
)

[VALUE] => Value 1
)

[1] => Array
(
[ATTRIBUTES] => Array
(
[id] => 2
)

[VALUE] => Value 2
)

)

)

)

)
[/array]

Source:
http://www.healthtvchannel.org/test/php2xml.phps

Thanks,
--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org



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



[PHP] tcp sockets

2003-07-10 Thread Robert C.
I have a java server running to handle xml requests and send back a
response to the sender.
It runs on one port for tcp and another for udp.
I got the udp version working fine, but I am having problems with the
tcp version.
Watching the debug output on the java server, I can see that it is
receiving the request from the php client and sending the response.
However, the php client hangs up when trying to read the response.
I'm guessing the problem is in the socket read function because when
I comment that part out it executes fine.
Also I am not using a while loop for the reading because I know the
response is only one line and < 1024 bytes.
Code snippet posted below. Any help would be greatly appreciated.

$xml = "blah blah
blah";
$port = 1234;
$address = gethostbyname( "www.mysite.com" );

$socket = socket_create( AF_INET, SOCK_STREAM, getprotobyname( "tcp"
) );
if( $socket == FASLE ) {
//error out...
}

$result = socket_connect( $socket, $address, $port );
if ( $result == FALSE ) {
//error out...
}

if( socket_write( $socket, $xml, strlen ($xml) ) == FALSE ) {
//error out...
}

$response = socket_read( $socket, 1024, PHP_NORMAL_READ );

socket_close($socket);

print "$response";

//now parse the response
$p = xml_parser_create();
xml_parser_set_option( $p, XML_OPTION_CASE_FOLDING, 0 );
xml_parser_set_option( $p, XML_OPTION_SKIP_WHITE, 1 );
xml_parse_into_struct( $p, $response, $vals, $index);
xml_parser_free( $p );

//this will show you whats in the array
print "xml response array: ";
print_r( $vals );


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



RE: [PHP] (REAL TUFFY ) Lat/Long Map Image Manipulation

2003-07-10 Thread Joe Harman
Hey thanks... They are pretty much trying to do what I am working... I
will try to interact a little with them...

Have a great one!
Joe

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 10, 2003 10:35 AM
To: Joe Harman
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] (REAL TUFFY ) Lat/Long Map Image Manipulation


Give this a looksee

http://forums.devshed.com/archive/5/2003/01/3/49795

Quoting Joe Harman <[EMAIL PROTECTED]>:

> Okay this is a tuffy! I am really just looking for someone to point me

> in the right direction, or tutorials or something! maybe ideas
>  
> 1st - I have created a Lat and Long distance calculator... it takes 2 
> user inputed zip codes... accesses the MySQL DB for the Lat and 
> Longs... then figures out the distance between them...
>  
> Now there are 2 things I want to do here... take a map of the US... 
> PNG.. GIF... what ever... and associate the Lat/Long with coordinates 
> on the image... like a image map in HTML (sort of) - the first thing I

> want to do is draw a line from point A to point B (on the map)... the 
> second is draw a circle for a search radius...
>  
> hmmm... it would also be cool if the image could be zoomed in on 
> like... scaled down to 100 mile x 100 miles... and then show the 75 
> mile radius circle
>  
> okay, that's enough for now... hope someone can point me in the right 
> direction
>  
> Joe Harman
>  
> http://www.HarmanMedia.com
>  
> Health nuts are going to feel stupid someday, lying in hospitals dying

> of nothing. - Redd Foxx
>  
> 



-- 
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] (REAL TUFFY ) Lat/Long Map Image Manipulation

2003-07-10 Thread ruusvuu
Give this a looksee

http://forums.devshed.com/archive/5/2003/01/3/49795

Quoting Joe Harman <[EMAIL PROTECTED]>:

> Okay this is a tuffy! I am really just looking for someone to point me
> in the right direction, or tutorials or something! maybe ideas
>  
> 1st - I have created a Lat and Long distance calculator... it takes 2
> user inputed zip codes... accesses the MySQL DB for the Lat and Longs...
> then figures out the distance between them...
>  
> Now there are 2 things I want to do here... take a map of the US...
> PNG.. GIF... what ever... and associate the Lat/Long with coordinates on
> the image... like a image map in HTML (sort of) - the first thing I want
> to do is draw a line from point A to point B (on the map)... the second
> is draw a circle for a search radius... 
>  
> hmmm... it would also be cool if the image could be zoomed in on
> like... scaled down to 100 mile x 100 miles... and then show the 75 mile
> radius circle
>  
> okay, that's enough for now... hope someone can point me in the right
> direction
>  
> Joe Harman
>  
> http://www.HarmanMedia.com
>  
> Health nuts are going to feel stupid someday, lying in hospitals dying
> of nothing. - Redd Foxx 
>  
> 



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



Re: [PHP] download hyperlink

2003-07-10 Thread Mike Migurski
>Does anyone know how I can set a hyperlink to a file so that someone can
>download the file instead of viewing it in the browser?  Please let me
>know.  Thanks.

You want the Content-Disposition header, see the HTTP spec.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html


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



[PHP] download hyperlink

2003-07-10 Thread Matt Palermo
Does anyone know how I can set a hyperlink to a file so that someone can
download the file instead of viewing it in the browser?  Please let me
know.  Thanks.
 
Matt


Re: [PHP] Removing array element by key

2003-07-10 Thread Jason Wong
On Friday 11 July 2003 04:50, jwulff wrote:
> How do i remove an element of an array by its key?  I've tried
> array_s(p)lice to no avail.  Either it chops too much or too little with
> seemingly no logic.  The array is of unkown and variable size if that makes
> a difference.  Thanks, John.

unset()

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Sometimes, too long is too long.
-- Joe Crowe
*/


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



[PHP] Removing array element by key

2003-07-10 Thread jwulff
How do i remove an element of an array by its key?  I've tried
array_s(p)lice to no avail.  Either it chops too much or too little with
seemingly no logic.  The array is of unkown and variable size if that makes
a difference.  Thanks, John.



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



Re: [PHP] Open new browser window

2003-07-10 Thread Mark

--- Karina S <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I want to make a php application, which displays different text in
> separate
> windows. I mean for example a new window will open with text "Hello
> 1" and a
> second window opens with text "Hello 2".
> 
> How is it possible with php?
> 

It's not. You'd have to use Javascript. Now, if you wanted to use PHP
pages in those windows, you can call the PHP files from the
Javascript that opens the windows.

window.open(, , )

 can point to a PHP file.


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


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



[PHP] Open new browser window

2003-07-10 Thread Karina S
Hello,

I want to make a php application, which displays different text in separate
windows. I mean for example a new window will open with text "Hello 1" and a
second window opens with text "Hello 2".

How is it possible with php?

Thanks!



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



RE: [PHP] OnClick problem (fwd)

2003-07-10 Thread andu
I may be wrong but to me the behavior is correct: calling a php script with 
echo $_SERVER['PHP_SELF']; should return the name of that script.

-- Forwarded Message --
Date: Thursday, July 10, 2003 16:16:24 -0400
From: Dan Joseph <[EMAIL PROTECTED]>
To: andu <[EMAIL PROTECTED]>, Dan Joseph <[EMAIL PROTECTED]>
Subject: RE: [PHP] OnClick problem
=> Hi,
=>
=>   Wow, you've got me stumped, that shouldn't be printing the previous at
=> all. Could you forward tihs to the php list?  I'm stumped.
=>
=> -Dan Joseph
=>
=>> -Original Message-
=>> From: andu [mailto:[EMAIL PROTECTED]
=>> Sent: Thursday, July 10, 2003 3:58 PM
=>> To: Dan Joseph
=>> Subject: RE: [PHP] OnClick problem
=>>
=>>
=>>
=>>
=>> --On Thursday, July 10, 2003 15:40:16 -0400 Dan Joseph <[EMAIL PROTECTED]>
=>> wrote:
=>>
=>> >  Yeah, it would be:
=>> >
=>> >  
=>> >
=>> >  If that doesn't work, could you paste in a few lines of code?
=>> >
=>> > -Dan Joseph
=>> >
=>> Thanks for helping me Dan. Here's the html created from bits and pieces
=>> with php. The  simply inserts the name
=>> of previous page I came from, makes sense.
=>>
=>> 
=>> 
=>> Entries list
=>> 
=>> 
=>> 
=>> address
=>>   book 
=>> > > 
=>> 
=>> 
=>>
=>>
=>>
=>> 
=>> > href="show_me.php?firstname=andu&lastname=novac">andu novac
=>>   
=>>
=>>
=>> 
=>> > href="show_me.php?firstname=roberto&lastname=busto">roberto
=>> busto 
=>>   
=>>
=>> 
=>>   
=>> 
=>>   login
=>>   new
=>> account
=>>   add
=>> address
=>>   
=>>
=>> 
=>> delete
=>> address
=>> 
=>>
=>>   show
=>> addresses
=>>
=>>   lost
=>> password
=>> 
=>>   
=>> 
=>> 
=>> 
=>>
=>> Regards, Andu Novac
=>>
=>
=>
-- End Forwarded Message --



Regards, Andu Novac

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


Re: [PHP] Password + login from the AND Basic-Authenticate form

2003-07-10 Thread Philip Olson
On Thu, 10 Jul 2003, Seigo wrote:

> Please tell me can users login with the html-page form and
> Basic-authentication?

  Chapter 16. HTTP authentication with PHP
  
  http://www.php.net/features.http-auth

Regards,
Philip


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



Re: [PHP] HELP can someone tell me whats wrong here? (newbie)

2003-07-10 Thread Jason Wong
On Friday 11 July 2003 02:28, Mark Clarkstone wrote:

> - Original Message -
> From: "Burhan Khalid" <[EMAIL PROTECTED]>
> To: "Mark Clarkstone" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Thursday, July 10, 2003 7:26 PM
> Subject: Re: [PHP] HELP can someone tell me
> whats wrong here? (newbie)
>
> > Please use more intelligent and descriptive subjects for your posts.
> > This HELP!!! nonsense is stupid.

> Oh well I am sorry your royal majesty

If you don't know the proper way to ask questions on a mailing list then I 
suggest that you do some background reading on how mailing lists work.

Responding sarcastically to a perfectly reasonable suggestion will make people 
think twice about helping you. Your Royal Highness.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Premature optimization is the root of all evil.
-- D.E. Knuth
*/


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



[PHP] wqeqw

2003-07-10 Thread Seigo
wqewqe



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



[PHP] Test

2003-07-10 Thread Seigo
Testing ,,,



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



[PHP] wqe

2003-07-10 Thread Seigo
wqeqwe



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



[PHP] Password + login from the AND Basic-Authenticate form

2003-07-10 Thread Seigo
Please tell me can users login with the html-page form and
Basic-authentication?

I so, how?



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



[PHP] test

2003-07-10 Thread Seigo
testing ..



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



Re: [PHP] function is_executable

2003-07-10 Thread Mark
>From the manual:

"is_executable() became available with Windows in PHP version 5.0.0."
Not sure what the problem might be if you're using linux.

--- "Gilberto Garcia Jr." <[EMAIL PROTECTED]> wrote:
> Hey guys,
> 
> I made a class to work with file upload.
> 
> I used the php function is_executable. and in php 4.2.x it works
> ok, on linux and on windows.
> 
> Last week I update my php to 4.3.x and this function stop work. In
> fact I got this error. undefinied function.
> 
> Does anyone can help?
> 
> 
> thanks


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: [PHP] Please assist - been on this for hours - Permissions onserver

2003-07-10 Thread Brad Pauly
Steve Jackson wrote:
I don't particularly need to *write* to the root directory. I do need to move the file to the root directory though as it's part of a CMS system. I can write the file to a directory which is adequately protected, but there has to be a way to move the file after it is written (to the root from said protected directory). The file is designed to be generated by another user. There are easier ways to design a CMS system I realise but this is my goal, to allow a user to simply generate a file which then is placed in the webroot after it has been written. I thought that this would be the easy part. Any more ideas? Thanks for your help Jason I appreciate it.  
Writing and moving require the same permissions. Also, there is a big 
difference between root and webroot. Which one are you talking about?

- Brad



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


RE: [PHP] OnClick problem

2003-07-10 Thread Dan Joseph
Hi,

> > Are you using the variable $_SERVER['PHP_SELF'] for your 
> link target?
> 
> I'm not, I'm a total newbie and don't quite understand, you mean 
> instead of 
> href="#" use href=$_SERVER['PHP_SELF']?
> Please bare with me and explain.

Yeah, it would be:



If that doesn't work, could you paste in a few lines of code?

-Dan Joseph

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



RE: [PHP] Please assist - been on this for hours - Permissions on server

2003-07-10 Thread Steve Jackson
> The root of the problem (pun intended)


Oh dear! ;o)

> is that you're trying to 
> write to the 
> root (/) directory which is usually only possible if you're the root user.
> 
> Again, the question is _why_ do you need to write to the root directory? 
> Wouldn't your file function if it wasn't in the root directory?

I don't particularly need to *write* to the root directory. I do need to move the file 
to the root directory though as it's part of a CMS system. I can write the file to a 
directory which is adequately protected, but there has to be a way to move the file 
after it is written (to the root from said protected directory). The file is designed 
to be generated by another user. There are easier ways to design a CMS system I 
realise but this is my goal, to allow a user to simply generate a file which then is 
placed in the webroot after it has been written. I thought that this would be the easy 
part. Any more ideas? Thanks for your help Jason I appreciate it.  


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



Re: [PHP] What's this talk about ASP to PHP?

2003-07-10 Thread Philip Olson
On 10 Jul 2003, Jonathan Villa wrote:

> I've read somewhere about some asptophp convertor/tool/methodology...?? 
> Don't know what it is, that's why I'm asking.
> 
> I've been asked to help out on a project which might include some
> already developed basic ASP code.  I would rather do it in PHP.

  2. Is there an ASP to PHP converter?
  http://www.php.net/manual/en/faq.languages.php

Regards,
Philip


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



RE: [PHP] OnClick problem

2003-07-10 Thread Dan Joseph
Hi,

> Here's something I cant explain:
> I have a page with a form on it (checkboxes) and a hyperlink which is 
> supposed to send the form to the server using:
> 
>  Trouble is that the link always points to the name of the 
> previous page I 
> came from. All pages are php generated on-the-fly.
> Is this a php problem? Anyone has a clue?
> I really don't want to use a submit button in this case.

Are you using the variable $_SERVER['PHP_SELF'] for your link target?

-Dan Joseph

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



[PHP] OnClick problem

2003-07-10 Thread andu
Here's something I cant explain:
I have a page with a form on it (checkboxes) and a hyperlink which is 
supposed to send the form to the server using:

Trouble is that the link always points to the name of the previous page I 
came from. All pages are php generated on-the-fly.
Is this a php problem? Anyone has a clue?
I really don't want to use a submit button in this case.

Regards, Andu Novac

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


[PHP] What's this talk about ASP to PHP?

2003-07-10 Thread Jonathan Villa
I've read somewhere about some asptophp convertor/tool/methodology...?? 
Don't know what it is, that's why I'm asking.

I've been asked to help out on a project which might include some
already developed basic ASP code.  I would rather do it in PHP.


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



RE: [PHP] Re: Excel Parser

2003-07-10 Thread Johnny Martinez
I've got a user that gets an Excel spreadsheet generated by a web app and I
want to be able to import the data from the xls into our local database then
work with it.

-Original Message-
From: Mark McCulligh [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 10, 2003 11:32 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Excel Parser


There is a PEAR package called Spreadsheet_Excel_Writer, that is non-COM. It
works great, only one problem. The max string length is 255 characters. For
it you are not export any fields greater then 255 it works great.

There is also an other excel class on www.phpclasses.org. Called  php2excel
I think, that works too.

The PEAR one does formulas too.

Mark.


"Johnny Martinez" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
> Does anyone know of any free Excel parsing non-COM code available on the
> net? Just straight php driven?
>
> I've found a couple commercial solutions but would like to try this myself
> or save money. Thanks for any help.
>
> Johnny



-- 
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] Re: Excel Parser

2003-07-10 Thread Mark McCulligh
There is a PEAR package called Spreadsheet_Excel_Writer, that is non-COM. It
works great, only one problem. The max string length is 255 characters. For
it you are not export any fields greater then 255 it works great.

There is also an other excel class on www.phpclasses.org. Called  php2excel
I think, that works too.

The PEAR one does formulas too.

Mark.


"Johnny Martinez" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
> Does anyone know of any free Excel parsing non-COM code available on the
> net? Just straight php driven?
>
> I've found a couple commercial solutions but would like to try this myself
> or save money. Thanks for any help.
>
> Johnny



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



Re: [PHP] Excel Parser

2003-07-10 Thread Matt Matijevich

Does anyone know of any free Excel parsing non-COM code available on
the
net? Just straight php driven?


I have not tried any of these but there might be something in here you
can use.
http://www.phpclasses.org/search.html?words=Excel&go_search=1



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



[PHP] Re: Continuing with HELP can someone tell me whats wrong here? (newbie)

2003-07-10 Thread Shena Delian O'Brien


Mark Clarkstone wrote:
yes

Well since that's what you said happens, isn't that where you should 
look for the problem? My guess is that install isn't changing to 1. I 
would change your line to:

if ( ($install == "0") && (!$check) ) {

instead of just:

if ($install=="0") {


"Shena Delian O'Brien" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Well you realize don't you that unless, on submit, install changes to 1,
whenever you submit your form it's going to go right back to the initial
page.
Mark Clarkstone wrote:

Its in cpconf.php


?>



"Shena Delian O'Brien" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

Where are you passing the variable "install"? I can't see it in your
form. Perhaps look for $check instead of $install?
Mark Clarkstone wrote:


now the script works but won't write to the file just returns to the

form.


 Control Panel


if ($install=="0") {

print "Welcome to The Control

Panel


Installer

This will install the control Panel

Please enter your site domain e.g.
freesite.cjb.com (without a www or a dot please) leave as localhost

if

you


are
using it as a local testing server.

value=\"localhost\">


Please enter a Username &

password to


access the
area
Username

Password


";
}
else if ($action=="check") {
if (!$csiteex) {
echo "Please enter your domain";
}
else if (!$user) {
echo "Please enter a username";
}
else if (!$pass) {
echo "Please enter a password";
}
else {
$data = "
?>";
$fp = fopen("cpconf.php",'w');
$fw = fwrite($fp,$data);
fclose($fp);
echo "Done!";
}
}
else if ($install =="1") {
echo "Welcome to The Control
Panel

Please enter a Username &

password to


access the
area
Username

Password


";
}
else if ($login=="check") {
if (!$userlogin && !$passlogin) {
echo "Sorry but No Username or password was found";
}
else if ($userlogin && $userpass == $admin && $adpw) {
include("admin.php");
}
}
?>







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


Re: [PHP] HELP can someone tell me whats wrong here? (newbie)

2003-07-10 Thread Mark Clarkstone
Oh well I am sorry your royal majesty


- Original Message -
From: "Burhan Khalid" <[EMAIL PROTECTED]>
To: "Mark Clarkstone" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, July 10, 2003 7:26 PM
Subject: Re: [PHP] HELP can someone tell me
whats wrong here? (newbie)


> Please use more intelligent and descriptive subjects for your posts.
> This HELP!!! nonsense is stupid.
>
> --
> Regards,
> Burhan Khalid
> phplist[at]meidomus[dot]com
> http://www.meidomus.com
>
>



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



Re: Re[2]: [PHP] Object assignment

2003-07-10 Thread Matt Grimm
Well I've made a signifigant improvement to this function, and it's now the
parsing operation is only something like 26 lines.  It works flawlessly (so
far) for XML that does not have repeat element names on the same level.
Which seems to be bad form anyway, using similar element names and
distinguishing them with attributes.

I'd still like the code to work with XML that did have similarly named
elements in the same node level.. can you see anything in my DOMXML calls
that might indicate the problem?

Source:
http://www.healthtvchannel.org/test/php2xml.phps
--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org

"Tom Rogers" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Thursday, July 10, 2003, 6:44:55 AM, you wrote:
> MG> Tom:
>
> MG> Thanks for the help.  Using the array setup you described, I end up
with the
> MG> value of each "record" node being appended to a single instance of the
> MG> parent node.  And that single instance of the parent node is the final
one
> MG> that was parsed (the attributes verify this).  The example I used
below is
> MG> outputting this:
>
> MG> 
> MG>   Value 1Value 2
> MG> 
>
> MG> Any ideas?
>
> It seems we now have to clone nodes before using them. (php-4.3 +)
> I did this as a test:
>
> $test =array(
> 1=>array('type'=>'record','value'=>'Value 1','id'=>1),
> 2=>array('type'=>'record','value'=>'Value 2','id'=>2));
> $elements = array();
> $doc = domxml_new_doc("1.0");
> //create a dummy document
> ob_start();
> echo << 
> 
> END;
> $buffer = ob_get_contents();
> ob_end_clean();
> $doc = domxml_open_mem($buffer);
> //get the root element
> $ancestor = $doc->document_element();
> //loop
> foreach($test as $val){
> $key = $val['type'];
> $value = $val['value'];
> $id = $val['id'];
> if(!isset($elements[$key])){
> $elements[$key] = $doc->create_element($key);
> }
> $thisChild =
$ancestor->append_child($elements[$key]->clone_node());//<<< $thisChild->set_attribute('id',$id);
> $txt = $doc->create_text_node($value);
> $thisChild->append_child($txt);
> }
> //end loop
> echo '';
> echo htmlentities($doc->dump_mem(true));
> echo '';
>
> Gave me
> 
> 
> Value 1Value
2
>
> -- 
> regards,
> Tom
>



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



[PHP] Excel Parser

2003-07-10 Thread Johnny Martinez
Hi all,
Does anyone know of any free Excel parsing non-COM code available on the
net? Just straight php driven?

I've found a couple commercial solutions but would like to try this myself
or save money. Thanks for any help.

Johnny

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



[PHP] Re: Continuing with HELP can someone tell me whats wrong here? (newbie)

2003-07-10 Thread Mark Clarkstone
yes

"Shena Delian O'Brien" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Well you realize don't you that unless, on submit, install changes to 1,
> whenever you submit your form it's going to go right back to the initial
> page.
>
> Mark Clarkstone wrote:
> > Its in cpconf.php
> >
> >  > $l33t = "C:/miniserve/Apache/conf/l33t.conf";
> > $syspath = "C:";
> > $install = "0";
> > $siteex = "MySite.Org";
> > $admin = "mini";
> > $adpw = "serve";
> >
> > ?>
> >
> >
> >
> > "Shena Delian O'Brien" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >
> >>Where are you passing the variable "install"? I can't see it in your
> >>form. Perhaps look for $check instead of $install?
> >>
> >>Mark Clarkstone wrote:
> >>
> >>>now the script works but won't write to the file just returns to the
> >>
> > form.
> >
> >>> Control Panel
> >>>
> >>> >>>require("cpconf.php");
> >>>
> >>>if ($install=="0") {
> >>>
> >>>print "Welcome to The Control
> >>
> > Panel
> >
> >>>Installer
> >>>
> >>>This will install the control Panel
> >>>
> >>>  Please enter your site domain e.g.
> >>>  freesite.cjb.com (without a www or a dot please) leave as localhost
if
> >>
> > you
> >
> >>>are
> >>>  using it as a local testing server.
> >>>   >>
> > value=\"localhost\">
> >
> >>>  
> >>>  Please enter a Username &
> >>
> > password to
> >
> >>>access the
> >>>  area
> >>>  Username
> >>>  
> >>>  Password
> >>>  
> >>>  
> >>>";
> >>>}
> >>>else if ($action=="check") {
> >>>
> >>>if (!$csiteex) {
> >>>echo "Please enter your domain";
> >>>}
> >>>else if (!$user) {
> >>>echo "Please enter a username";
> >>>}
> >>>else if (!$pass) {
> >>>echo "Please enter a password";
> >>>}
> >>>else {
> >>>$data = " >>>\$l33t = \"C:/miniserve/Apache/conf/l33t.conf\";
> >>>\$syspath = \"C:\";
> >>>\$install = \"1\";
> >>>\$siteex = \"$csiteex\";
> >>>\$admin = \"$user\";
> >>>\$adpw = \"$pass\";
> >>>
> >>>?>";
> >>>$fp = fopen("cpconf.php",'w');
> >>>$fw = fwrite($fp,$data);
> >>>fclose($fp);
> >>>echo "Done!";
> >>>}
> >>>}
> >>>else if ($install =="1") {
> >>>echo "Welcome to The Control
> >>>Panel
> >>>
> >>>  Please enter a Username &
> >>
> > password to
> >
> >>>access the
> >>>  area
> >>>  Username
> >>>  
> >>>  Password
> >>>  
> >>>  
> >>>";
> >>>}
> >>>else if ($login=="check") {
> >>>
> >>>if (!$userlogin && !$passlogin) {
> >>>echo "Sorry but No Username or password was found";
> >>>}
> >>>else if ($userlogin && $userpass == $admin && $adpw) {
> >>>include("admin.php");
> >>>}
> >>>}
> >>>?>
> >>>
> >>>
> >>>
> >
> >
>



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



Re: [PHP] HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!! can someone tell me whats wrong here? (newbie)

2003-07-10 Thread Burhan Khalid
Please use more intelligent and descriptive subjects for your posts.
This HELP!!! nonsense is stupid.

-- 
Regards,
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com


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



[PHP] regexp problem

2003-07-10 Thread Taylor York
First,
I need the code to replace the link in a string, like

 with 

ereg_replace("''", "''",
$old);

That was the closest i got, but (.*) makes it take the first BASE HREF, and
the last ">, which sucks.
Can anyone help?

Second,
I hate asking for help on Regexps...I would like a tutorial online that
steps me through one method of them at a time, and then lets me move
on...kindof like math. You have to know the basics befor you can get
advanced.  Any help there either?



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



Re[2]: [PHP] Using PPP with PHP

2003-07-10 Thread Burhan Khalid
On Thursday, July 10, 2003, 8:41:03 PM, Jay wrote:

JB> [snip]
JB> Umm, use exec() to call the dialing program?
JB> [/snip]

JB> That works on the surface, but the PPP program returns some vital
JB> information about its connection status that is required for use by any
JB> subsequent file operations. The information is returned via STDOUT.

How about piping the output to a file and then checking that file with
PHP?


-- 
Regards,
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com


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



Re: [PHP] mssql.dll

2003-07-10 Thread Burhan Khalid
On Thursday, July 10, 2003, 3:03:43 PM, Alain wrote:

AR> Where is mssql.dll (not include in packages 4.1.2 / 4.2.3 / 4.3.2 ?

Don't send your messages high priority. Its considered rude and bad
list manners.

mssql.dll comes with the MSSQL product. Its not part of the package.


-- 
Regards,
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com


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



[PHP] Running PHP4 and PHP5 together

2003-07-10 Thread Adam Plocher
Is there anyway I can use PHP4 and PHP5 (as modules, not cgi) together
in Apache2 (Linux)?  I've tried the --enable-versioning configure option
with php, but I'm not quite sure what that does.  I need PHP4 because
Gallery apparently won't work with PHP5.
 
If it's possible to load either php4 or php5 modules per virtualhost,
that would be an acceptible alternative, too, but that didn't seem to
work when I tried it.
 
Thanks
 
-Adam


RE: [PHP] Using PPP with PHP

2003-07-10 Thread Mike Migurski
>[snip]
>Umm, use exec() to call the dialing program?
>[/snip]
>
>That works on the surface, but the PPP program returns some vital
>information about its connection status that is required for use by any
>subsequent file operations. The information is returned via STDOUT.

so try system() instead. Or one of the other methods referenced in
http://php.net/manual/en/function.exec.php

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html


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



Re: [PHP] download php

2003-07-10 Thread Daniel J. Rychlik
You should also store passwords in a non-readable to the world directory.  

-Dan

- Original Message - 
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
To: "Mantas Kriauciunas" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, July 10, 2003 5:01 AM
Subject: Re: [PHP] download php


> Do you use secure connection? Well, you should.
> 
> Mantas Kriauciunas wrote:
> 
> > Hello php-general,
> > 
> >   some hacker just tries his luck everyday to get me pissed, is it
> >   possible to make php files not downloadable? or coded? or something?
> >   because some dude knows my passwords every time, and with them
> >   passes the shity security to main user, thank god not root.
> > 
> >   So is there any way?
> > 
> >   if anyone knows any links or resources, please reply, i'll check
> >   them, i need to put this to end
> > 
> >   P.S system is freebsd.
> > 
> >   Thank you!!!
> > 
> >   there are even more and more kids that want to be named haker,
> >   lookin at their age, could be even my son:)
> > 
> 
> 
> -- 
> 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] Using PPP with PHP

2003-07-10 Thread Jay Blanchard
[snip]
Umm, use exec() to call the dialing program?
[/snip]

That works on the surface, but the PPP program returns some vital
information about its connection status that is required for use by any
subsequent file operations. The information is returned via STDOUT.

Thanks!

Jay

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



[PHP] PHP hosting with remote MySQL access allowed

2003-07-10 Thread Joshua Minnie
I am in the process of developing a client side application that needs to
speak to our remote databases.  Does anybody know of a hosting solution that
would allow me to have remote access to a MySQL database?  I done some
googling and found a quite a few hosting companies, but none of them that I
have check have the information posted on their websites, so I had to submit
an email question to them.

Thanks

Josh Minnie
[EMAIL PROTECTED]


There are 3 kinds of people in the worlds; those who can count and those who
can't.



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



Re: [PHP] Using PPP with PHP

2003-07-10 Thread Adam Voigt
Umm, use exec() to call the dialing program?



On Thu, 2003-07-10 at 13:22, Jay Blanchard wrote:
> Good afternoon gurus and gurettes!
> 
> Has any of you had any experience using PPP (Point-to-Point Protocol)
> with PHP? I need to work with it to establish a connection to a remote
> server on a remote network and was hoping that I could use PHP.
> Currently I can manually establish I dial-up using PPP over a modem. I
> would like to automate the process as much as possible. Any help would
> be grandly appreciated.
> 
> Jay
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



[PHP] Using PPP with PHP

2003-07-10 Thread Jay Blanchard
Good afternoon gurus and gurettes!

Has any of you had any experience using PPP (Point-to-Point Protocol)
with PHP? I need to work with it to establish a connection to a remote
server on a remote network and was hoping that I could use PHP.
Currently I can manually establish I dial-up using PPP over a modem. I
would like to automate the process as much as possible. Any help would
be grandly appreciated.

Jay

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



[PHP] Re: Continuing with HELP can someone tell me whats wrong here? (newbie)

2003-07-10 Thread Shena Delian O'Brien
Well you realize don't you that unless, on submit, install changes to 1, 
whenever you submit your form it's going to go right back to the initial 
page.

Mark Clarkstone wrote:
Its in cpconf.php


?>



"Shena Delian O'Brien" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Where are you passing the variable "install"? I can't see it in your
form. Perhaps look for $check instead of $install?
Mark Clarkstone wrote:

now the script works but won't write to the file just returns to the

form.

 Control Panel


if ($install=="0") {

print "Welcome to The Control

Panel

Installer

This will install the control Panel

 Please enter your site domain e.g.
 freesite.cjb.com (without a www or a dot please) leave as localhost if

you

are
 using it as a local testing server.
 
value=\"localhost\">

 
 Please enter a Username &

password to

access the
 area
 Username
 
 Password
 
 
";
}
else if ($action=="check") {
if (!$csiteex) {
echo "Please enter your domain";
}
else if (!$user) {
echo "Please enter a username";
}
else if (!$pass) {
echo "Please enter a password";
}
else {
$data = "
?>";
$fp = fopen("cpconf.php",'w');
$fw = fwrite($fp,$data);
fclose($fp);
echo "Done!";
}
}
else if ($install =="1") {
echo "Welcome to The Control
Panel

 Please enter a Username &

password to

access the
 area
 Username
 
 Password
 
 
";
}
else if ($login=="check") {
if (!$userlogin && !$passlogin) {
echo "Sorry but No Username or password was found";
}
else if ($userlogin && $userpass == $admin && $adpw) {
include("admin.php");
}
}
?>






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


[PHP] Re: Continuing with HELP can someone tell me whats wrong here? (newbie)

2003-07-10 Thread Mark Clarkstone
Its in cpconf.php





"Shena Delian O'Brien" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Where are you passing the variable "install"? I can't see it in your
> form. Perhaps look for $check instead of $install?
>
> Mark Clarkstone wrote:
> > now the script works but won't write to the file just returns to the
form.
> >
> >  Control Panel
> > 
> >  > require("cpconf.php");
> >
> > if ($install=="0") {
> >
> > print "Welcome to The Control
Panel
> > Installer
> > 
> > This will install the control Panel
> > 
> >   Please enter your site domain e.g.
> >   freesite.cjb.com (without a www or a dot please) leave as localhost if
you
> > are
> >   using it as a local testing server.
> >   
> >   
> >   Please enter a Username &
password to
> > access the
> >   area
> >   Username
> >   
> >   Password
> >   
> >   
> > ";
> > }
> > else if ($action=="check") {
> >
> > if (!$csiteex) {
> > echo "Please enter your domain";
> > }
> > else if (!$user) {
> > echo "Please enter a username";
> > }
> > else if (!$pass) {
> > echo "Please enter a password";
> > }
> > else {
> > $data = " > \$l33t = \"C:/miniserve/Apache/conf/l33t.conf\";
> > \$syspath = \"C:\";
> > \$install = \"1\";
> > \$siteex = \"$csiteex\";
> > \$admin = \"$user\";
> > \$adpw = \"$pass\";
> >
> > ?>";
> > $fp = fopen("cpconf.php",'w');
> > $fw = fwrite($fp,$data);
> > fclose($fp);
> > echo "Done!";
> > }
> > }
> > else if ($install =="1") {
> > echo "Welcome to The Control
> > Panel
> > 
> >   Please enter a Username &
password to
> > access the
> >   area
> >   Username
> >   
> >   Password
> >   
> >   
> > ";
> > }
> > else if ($login=="check") {
> >
> > if (!$userlogin && !$passlogin) {
> > echo "Sorry but No Username or password was found";
> > }
> > else if ($userlogin && $userpass == $admin && $adpw) {
> > include("admin.php");
> > }
> > }
> > ?>
> >
> >
> >
>



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



Re: [PHP] HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!! can someone tell me whats wrong here? (newbie)

2003-07-10 Thread Ray
> else if ($userlogin && $userpass == $admin && $adpw) {
this line probably isn't going to do what your thinking it will.

you probably want either 

else if ($userlogin == $admin && $userpass == $adpw) {

or 

else if (strcasecmp($userlogin,$admin) == 0 && 
  strcasecmp($userpass,$adpw) == 0) {


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



[PHP] Re: Continuing with HELP can someone tell me whats wrong here? (newbie)

2003-07-10 Thread Shena Delian O'Brien
Where are you passing the variable "install"? I can't see it in your 
form. Perhaps look for $check instead of $install?

Mark Clarkstone wrote:
now the script works but won't write to the file just returns to the form.

 Control Panel


if ($install=="0") {

print "Welcome to The Control Panel
Installer

This will install the control Panel

  Please enter your site domain e.g.
  freesite.cjb.com (without a www or a dot please) leave as localhost if you
are
  using it as a local testing server.
  
  
  Please enter a Username & password to
access the
  area
  Username
  
  Password
  
  
";
}
else if ($action=="check") {
if (!$csiteex) {
echo "Please enter your domain";
}
else if (!$user) {
echo "Please enter a username";
}
else if (!$pass) {
echo "Please enter a password";
}
else {
$data = "
?>";
$fp = fopen("cpconf.php",'w');
$fw = fwrite($fp,$data);
fclose($fp);
echo "Done!";
}
}
else if ($install =="1") {
echo "Welcome to The Control
Panel

  Please enter a Username & password to
access the
  area
  Username
  
  Password
  
  
";
}
else if ($login=="check") {
if (!$userlogin && !$passlogin) {
echo "Sorry but No Username or password was found";
}
else if ($userlogin && $userpass == $admin && $adpw) {
include("admin.php");
}
}
?>




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


[PHP] Continuing with HELP can someone tell me whats wrong here? (newbie)

2003-07-10 Thread Mark Clarkstone
now the script works but won't write to the file just returns to the form.

 Control Panel

Welcome to The Control Panel
Installer

This will install the control Panel

  Please enter your site domain e.g.
  freesite.cjb.com (without a www or a dot please) leave as localhost if you
are
  using it as a local testing server.
  
  
  Please enter a Username & password to
access the
  area
  Username
  
  Password
  
  
";
}
else if ($action=="check") {

if (!$csiteex) {
echo "Please enter your domain";
}
else if (!$user) {
echo "Please enter a username";
}
else if (!$pass) {
echo "Please enter a password";
}
else {
$data = "";
$fp = fopen("cpconf.php",'w');
$fw = fwrite($fp,$data);
fclose($fp);
echo "Done!";
}
}
else if ($install =="1") {
echo "Welcome to The Control
Panel

  Please enter a Username & password to
access the
  area
  Username
  
  Password
  
  
";
}
else if ($login=="check") {

if (!$userlogin && !$passlogin) {
echo "Sorry but No Username or password was found";
}
else if ($userlogin && $userpass == $admin && $adpw) {
include("admin.php");
}
}
?>




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



[PHP] Re: HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!! can someone tell me whats wrong here? (newbie)

2003-07-10 Thread Mark Clarkstone
OMG Your Right no wonder it didn't work lol


"Shena Delian O'Brien" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Well for one thing, you've misspelled one of your variables...
>
> the if ($instal=="0") should be, if I'm not incorrect,
> if ($install=="0")
>
> Mark Clarkstone wrote:
> > Can anyone help me with this code I just get someting about $end & help
me fix it
> >
> >
> >
> > Thanks
> >
> >
> > Parse error: parse error, unexpected $end in C:/apache/htdocs/test.php
on line 73
> >
> >
> >  Control Panel
> > 
> >  > require("cpconf.php");
> >
> > if ($instal=="0") {
> >
> > print "Welcome to The Control
Panel Installer
> > 
> > This will install the control Panel
> > 
> >   Please enter your site domain e.g.
> >   freesite.cjb.com (without a www or a dot please) leave as localhost if
you are
> >   using it as a local testing server.
> >   
> >   
> >   Please enter a Username &
password to access the
> >   area
> >   Username
> >   
> >   Password
> >   
> >   
> > ";
> > }
> > else if ($action == "check") {
> >
> > if (!$csiteex) {
> > echo "Please enter your domain";
> > }
> > else if (!$user) {
> > echo "Please enter a username";
> > }
> > else if (!$pass) {
> > echo "Please enter a password";
> > }
> > else if ($csiteex && $user && $pass) {
> > $data = " > \$l33t = \"C:/miniserve/Apache/conf/l33t.conf\";
> > \$syspath = \"C:\";
> > \$install = \"1\";
> > \$siteex = \"$csiteex\";
> > \$admin = \"$user\";
> > \$adpw = \"$pass\";
> >
> > ?>";
> > $fp = fopen("cpconf.php",'w');
> > $fw = fwrite($fp,$data);
> > fclose($fp);
> > }
> > }
> > else if ($install =="1") {
> > echo "Welcome to The Control
Panel
> > 
> >   Please enter a Username &
password to access the
> >   area
> >   Username
> >   
> >   Password
> >   
> >   
> > ";
> > }
> > else if ($login=="check") {
> >
> > if (!$userlogin && !$passlogin) {
> > echo "Sorry but No Username or password was found";
> > }
> > else if ($userlogin && $userpass == $admin && $adpw) {
> > include("admin.php);
> > }
> > ?>
> >
> >
>



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



Re: Re[2]: [PHP] Object assignment

2003-07-10 Thread Matt Grimm
Interesting -- the clone_node() function does make certain that each element
gets its own representation in the output, for any XML I tested.  I guess
then my problem lies with how I'm looping through the aforementioned array
structure to get the values themselves.

Thanks,
--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org

"Tom Rogers" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Thursday, July 10, 2003, 6:44:55 AM, you wrote:
> MG> Tom:
>
> MG> Thanks for the help.  Using the array setup you described, I end up
with the
> MG> value of each "record" node being appended to a single instance of the
> MG> parent node.  And that single instance of the parent node is the final
one
> MG> that was parsed (the attributes verify this).  The example I used
below is
> MG> outputting this:
>
> MG> 
> MG>   Value 1Value 2
> MG> 
>
> MG> Any ideas?
>
> It seems we now have to clone nodes before using them. (php-4.3 +)
> I did this as a test:
>
> $test =array(
> 1=>array('type'=>'record','value'=>'Value 1','id'=>1),
> 2=>array('type'=>'record','value'=>'Value 2','id'=>2));
> $elements = array();
> $doc = domxml_new_doc("1.0");
> //create a dummy document
> ob_start();
> echo << 
> 
> END;
> $buffer = ob_get_contents();
> ob_end_clean();
> $doc = domxml_open_mem($buffer);
> //get the root element
> $ancestor = $doc->document_element();
> //loop
> foreach($test as $val){
> $key = $val['type'];
> $value = $val['value'];
> $id = $val['id'];
> if(!isset($elements[$key])){
> $elements[$key] = $doc->create_element($key);
> }
> $thisChild =
$ancestor->append_child($elements[$key]->clone_node());//<<< $thisChild->set_attribute('id',$id);
> $txt = $doc->create_text_node($value);
> $thisChild->append_child($txt);
> }
> //end loop
> echo '';
> echo htmlentities($doc->dump_mem(true));
> echo '';
>
> Gave me
> 
> 
> Value 1Value
2
>
> -- 
> regards,
> Tom
>



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



Re: Re[2]: [PHP] Object assignment

2003-07-10 Thread Matt Grimm
The array structure is the one suggested on the xml_parse_into_struct page
user comments.  Our example XML would parse into this:

Array
(
[ROOTELEMENT] => Array
(
[0] => Array
(
[ATTRIBUTES] => Array
(
[ID] => 1
)

[RECORD] => Array
(
[0] => Array
(
[ATTRIBUTES] => Array
(
[ID] => 1
)

[VALUE] => Value 1
)

[1] => Array
(
[ATTRIBUTES] => Array
(
[ID] => 2
)

[VALUE] => Value 2
)

)

)

)

)

And my source is here:
http://www.healthtvchannel.org/test/php2xml.phps

--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org

"Tom Rogers" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Thursday, July 10, 2003, 6:44:55 AM, you wrote:
> MG> Tom:
>
> MG> Thanks for the help.  Using the array setup you described, I end up
with the
> MG> value of each "record" node being appended to a single instance of the
> MG> parent node.  And that single instance of the parent node is the final
one
> MG> that was parsed (the attributes verify this).  The example I used
below is
> MG> outputting this:
>
> MG> 
> MG>   Value 1Value 2
> MG> 
>
> MG> Any ideas?
>
> Can you send me the bit of code or the array you are using so I can
> see better what you are doing :)
> Maybe I miss understood something
>
>
> -- 
> regards,
> Tom
>



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



[PHP] Re: HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!! can someone tell me whats wronghere? (newbie)

2003-07-10 Thread Shena Delian O'Brien
Well for one thing, you've misspelled one of your variables...

the if ($instal=="0") should be, if I'm not incorrect,
if ($install=="0")
Mark Clarkstone wrote:
Can anyone help me with this code I just get someting about $end & help me fix it 



Thanks

Parse error: parse error, unexpected $end in C:/apache/htdocs/test.php on line 73

 Control Panel


if ($instal=="0") {

print "Welcome to The Control Panel Installer

This will install the control Panel

  Please enter your site domain e.g. 
  freesite.cjb.com (without a www or a dot please) leave as localhost if you are 
  using it as a local testing server.
  
  
  Please enter a Username & password to access the 
  area
  Username
  
  Password
  
  
";
}
else if ($action == "check") {

if (!$csiteex) {
echo "Please enter your domain";
}
else if (!$user) {
echo "Please enter a username";
}
else if (!$pass) {
echo "Please enter a password";
}
else if ($csiteex && $user && $pass) {
$data = "
\$l33t = \"C:/miniserve/Apache/conf/l33t.conf\";
\$syspath = \"C:\";
\$install = \"1\";
\$siteex = \"$csiteex\";
\$admin = \"$user\";
\$adpw = \"$pass\"; 

?>";
$fp = fopen("cpconf.php",'w');
$fw = fwrite($fp,$data);
fclose($fp);
}
}
else if ($install =="1") {
echo "Welcome to The Control Panel

  Please enter a Username & password to access the 
  area
  Username
  
  Password
  
  
";
}
else if ($login=="check") {

if (!$userlogin && !$passlogin) {
echo "Sorry but No Username or password was found";
}
else if ($userlogin && $userpass == $admin && $adpw) {
include("admin.php);
}
?>



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


Re: [PHP] CHECKING IF A SESSION IS ACTIVE OR NOT

2003-07-10 Thread John Hicks
There is no reliable way for the server (Apache, PHP, etc) 
to know when a user closes a session by closing his browser 
window. That's one reason why session-management sytems 
always employ a timeout on sessions. I don't know what the 
default timeout is for the PHP session-management system, 
but I believe you can set it.

But that raises the question: If you are already storing 
session IDs in a database table, why don't you do your own 
session managment instead of using the PHP system? 

--John

On Thursday 10 July 2003 09:42 am, Nagib Abi Fadel wrote:
> HI,
>
> I'm storing the sessions ids in a database table. I
> want to run a script that reads from the table every
> session id and check if this session is active or not.
>
> I know that session information is stored in a
> directory (/tmp by default) and removed from there
> when the session is closed. But if the user close his
> browser without deconnecting from the session the
> session file is still in the /tmp directory.
>
> How can i know if a session is still active or not !!
> ???
>
> I have searched the session functions and didn't find
> anything that could help
>
> Thx for any Help
>
> N.
>
> __
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com

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



Re: [PHP] SQL select

2003-07-10 Thread Adam Voigt
Hmm. How about:

SELECT DISTINCT id_k, name FROM tablename WHERE typ != 'z' ORDER BY typ
ASC;

Does that work?

On Thu, 2003-07-10 at 11:29, Mark wrote:
> > Jiøí Nìmec wrote:
> > 
> > > hello,
> > > 
> > > i have got a problem with SQL select:
> > > 
> > > I have got a table such this:
> > > 
> > > id_k typ name id
> > >  1   f   bla1   1
> > >  2   f   bla2   1
> > >  2   i   bla3   1
> > >  3   z   bla4   1
> > >  3   f   bla5   1
> > >  4   i   bla6   1
> > >  4   z   bla7   1
> > >  5   z   bla8   1
> > > 
> > > and id = 1 and I need select these rows:
> > > 
> > > id_k  typ nazev id
> > >  1 f   bla1  1
> > >  2 f   bla2  1
> > >  3 f   bla5  1
> > >  4 i   bla6  1
> > > 
> > > so, when doesn'i exist component (id_k = component) type "f" so I
> > want
> > > component with type "i", but when doesn't exist type "f" noir "i"
> > I
> > > don't want to select row with type "z".
> > > 
> 
> I don't think you can do what you want in a simple SQL statement. You
> seem to want to return rows based on what is in other rows of the
> same table. There may be ways to join the table to itself, but I'm
> not aware of a straightforward way to do this only in SQL. In PHP,
> it's probably not too tough.
> 
> Just to be sure we all understand, I assume you want the following:
> -At most, one row for each id_k
> -If there is a row with an 'f' in the type column, return that row.
> -If there is no record with an 'f' in the type column for that id_k,
> and there is a record with an 'i', return that row.
> -If there is no record with an 'f', nor a record with an 'i' in the
> type column, do not return a row.
> 
> Is that right?
> 
> > > jiri nemec, ICQ: 114651500
> > > www.menea.cz - www stránky a aplikace
> > > 
> > > 
> > 
> > 
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 
> 
> =
> Mark Weinstock
> [EMAIL PROTECTED]
> ***
> You can't demand something as a "right" unless you are willing to fight to death to 
> defend everyone else's right to the same thing.
> ***
> 
> __
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



RE: [PHP] HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!! can someone tell me whats wrong here? (newbie)

2003-07-10 Thread Roedel, Mark

You're missing at least one closing brace (}) -- the one that belongs
with the 
else if ($login=="check") {
ten or so lines up from the bottom.


---
Mark Roedel   | "Blessed is he who has learned to laugh
Systems Programmer|  at himself, for he shall never cease
LeTourneau University |  to be entertained."
Longview, Texas, USA  |  -- John Powell


> -Original Message-
> From: Mark Clarkstone [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, July 10, 2003 10:38 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] HELP can someone 
> tell me whats wrong here? (newbie)
> 
> 
> Can anyone help me with this code I just get someting about 
> $end & help me fix it 
> 
> 
> 
> Thanks
> 
> 
> Parse error: parse error, unexpected $end in 
> C:/apache/htdocs/test.php on line 73
> 
> 
>  Control Panel
> 
>  require("cpconf.php");
> 
> if ($instal=="0") {
> 
> print "Welcome to The 
> Control Panel Installer
> 
> This will install the control Panel
> 
>   Please enter your site domain e.g. 
>   freesite.cjb.com (without a www or a dot please) leave as 
> localhost if you are 
>   using it as a local testing server.
>value=\"localhost\">
>   
>   Please enter a Username 
> & password to access the 
>   area
>   Username
>   
>   Password
>   
>   
> ";
> }
> else if ($action == "check") {
> 
> if (!$csiteex) {
> echo "Please enter your domain";
> }
> else if (!$user) {
> echo "Please enter a username";
> }
> else if (!$pass) {
> echo "Please enter a password";
> }
> else if ($csiteex && $user && $pass) {
> $data = " \$l33t = \"C:/miniserve/Apache/conf/l33t.conf\";
> \$syspath = \"C:\";
> \$install = \"1\";
> \$siteex = \"$csiteex\";
> \$admin = \"$user\";
> \$adpw = \"$pass\"; 
> 
> ?>";
> $fp = fopen("cpconf.php",'w');
> $fw = fwrite($fp,$data);
> fclose($fp);
> }
> }
> else if ($install =="1") {
> echo "Welcome to The 
> Control Panel
> 
>   Please enter a Username 
> & password to access the 
>   area
>   Username
>   
>   Password
>   
>   
> ";
> }
> else if ($login=="check") {
> 
> if (!$userlogin && !$passlogin) {
> echo "Sorry but No Username or password was found";
> }
> else if ($userlogin && $userpass == $admin && $adpw) {
> include("admin.php);
> }
> ?>
> 
> 

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



[PHP] HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!! can someone tell me whats wrong here? (newbie)

2003-07-10 Thread Mark Clarkstone
Can anyone help me with this code I just get someting about $end & help me fix it 



Thanks


Parse error: parse error, unexpected $end in C:/apache/htdocs/test.php on line 73


 Control Panel

Welcome to The Control Panel 
Installer

This will install the control Panel

  Please enter your site domain e.g. 
  freesite.cjb.com (without a www or a dot please) leave as localhost if you are 
  using it as a local testing server.
  
  
  Please enter a Username & password to access 
the 
  area
  Username
  
  Password
  
  
";
}
else if ($action == "check") {

if (!$csiteex) {
echo "Please enter your domain";
}
else if (!$user) {
echo "Please enter a username";
}
else if (!$pass) {
echo "Please enter a password";
}
else if ($csiteex && $user && $pass) {
$data = "";
$fp = fopen("cpconf.php",'w');
$fw = fwrite($fp,$data);
fclose($fp);
}
}
else if ($install =="1") {
echo "Welcome to The Control 
Panel

  Please enter a Username & password to access 
the 
  area
  Username
  
  Password
  
  
";
}
else if ($login=="check") {

if (!$userlogin && !$passlogin) {
echo "Sorry but No Username or password was found";
}
else if ($userlogin && $userpass == $admin && $adpw) {
include("admin.php);
}
?>



Re: [PHP] SQL select

2003-07-10 Thread Mark
> Jiøí Nìmec wrote:
> 
> > hello,
> > 
> > i have got a problem with SQL select:
> > 
> > I have got a table such this:
> > 
> > id_k typ name id
> >  1   f   bla1   1
> >  2   f   bla2   1
> >  2   i   bla3   1
> >  3   z   bla4   1
> >  3   f   bla5   1
> >  4   i   bla6   1
> >  4   z   bla7   1
> >  5   z   bla8   1
> > 
> > and id = 1 and I need select these rows:
> > 
> > id_k  typ nazev id
> >  1 f   bla1  1
> >  2 f   bla2  1
> >  3 f   bla5  1
> >  4 i   bla6  1
> > 
> > so, when doesn'i exist component (id_k = component) type "f" so I
> want
> > component with type "i", but when doesn't exist type "f" noir "i"
> I
> > don't want to select row with type "z".
> > 

I don't think you can do what you want in a simple SQL statement. You
seem to want to return rows based on what is in other rows of the
same table. There may be ways to join the table to itself, but I'm
not aware of a straightforward way to do this only in SQL. In PHP,
it's probably not too tough.

Just to be sure we all understand, I assume you want the following:
-At most, one row for each id_k
-If there is a row with an 'f' in the type column, return that row.
-If there is no record with an 'f' in the type column for that id_k,
and there is a record with an 'i', return that row.
-If there is no record with an 'f', nor a record with an 'i' in the
type column, do not return a row.

Is that right?

> > jiri nemec, ICQ: 114651500
> > www.menea.cz - www stránky a aplikace
> > 
> > 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



[PHP] Upgrading 4.2.2 to 4.3.2

2003-07-10 Thread Dave [Hawk-Systems]
Live server was previously a 4.0.4 install that we upgraded to 4.2.2
Am getting ready to upgrade it again to 4.3.2 and wish to verify some things.

1) any caveats to be aware of?

2) it appears from reading INSTALL that a seperate build isn't required if we
want to run both dynamic and static, just run the dynamic install?

3) if the above (dynamic) is correct, will using an existing config.nice still
work for the upgrade considering the config.nice is from 4.0.4 and freebsd has
been patched and upgraded since then as well. file contained below


#! /bin/sh
#
# Created by configure

"./configure" \
"--with-apxs=/usr/local/sbin/apxs" \
"--with-config-file-path=/usr/local/etc" \
"--enable-versioning" \
"--with-system-regex" \
"--disable-debug" \
"--enable-track-vars" \
"--without-gd" \
"--disable-pear" \
"--without-mysql" \
"--with-gd=/usr/local" \
"--with-ttf=/usr/local" \
"--with-zlib" \
"--with-mcrypt=/usr/local" \
"--with-mhash=/usr/local" \
"--with-imap=/usr/local" \
"--with-mysql=/usr/local" \
"--with-pgsql=/usr/local/pgsql" \
"--with-dbase" \
"--with-ldap=/usr/local" \
"--with-openssl=/usr" \
"--with-snmp=/usr/local" \
"--enable-ucd-snmp-hack" \
"--with-xml=/usr/local" \
"--enable-ftp" \
"--with-curl=/usr/local" \
"--with-gettext=/usr/local" \
"--enable-sockets" \
"--enable-sysvsem" \
"--enable-sysvshm" \
"--enable-trans-sid" \
"--prefix=/usr/local" \
"i386--freebsd4.3" \
"$@"


Comments and feedback appreciated.

Dave



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



Re: [PHP] problem with php-4.3.2 and gblib 2 on apache server

2003-07-10 Thread info
Yes, that was the problem. I found out earlier today.

Thanks.


- Original Message - 
From: Jason Wong <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 10, 2003 8:31 AM
Subject: Re: [PHP] problem with php-4.3.2 and gblib 2 on apache server


> On Thursday 10 July 2003 09:41, Tim Grote wrote:
> > I updated my linux apache server to php-4.3.2. It works fine but the
> > promised 'embedded' gdlib 2 doesnt seem to work. gd_info always ends in
> > 'call to undefined function'.
> >
> > Can anybody tell me what's wrong or how to get gdlib 2 working?
> 
> Was php compiled with gd support? manual > Image functions for info.
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Lewis's Law of Travel:
> The first piece of luggage out of the chute doesn't belong to anyone,
> ever.
> */
> 


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



Re: [PHP] Re: mail() - how to attach file to the message???

2003-07-10 Thread Mark
You had an  tag in your email, so I assumed you were trying to
upload the file. If the file is not already on the server, you *will*
have to upload it before emailing it. But that's a whole other
matter.

If you look at the classes and see how they attach a file, you should
be able to figure it out. Basically, you need to set the correct
headers (content-type) and attach an encoded version of the file in
the body of the email. 

An easy way to see what you need it to send yourself an email with an
attachment and look at the raw source of the email you receive. It
should look a bit like this (with a whole lot more headers in it):

From: "Mark" <[EMAIL PROTECTED]>
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Subject: FW: test
Content-Type: multipart/mixed;
boundary="_=_NextPart_000_01C346F1.7A8C7496"

This message is in MIME format. Since your mail reader does not
understand
this format, some or all of this message may not be legible.

--_=_NextPart_000_01C346F1.7A8C7496
Content-Type: multipart/alternative;
boundary="_=_NextPart_001_01C346F1.7A8C7496"


--_=_NextPart_001_01C346F1.7A8C7496
Content-Type: text/plain;
charset="iso-8859-1"

This is the body of the email 
 <> 


--_=_NextPart_000_01C346F1.7A8C7496
Content-Type: image/jpeg;
name="test.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="test.jpg"

/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHR
HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMj
MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAJaAb
AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAw
AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKS
ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmq
.
.
.
--_=_NextPart_000_01C346F1.7A8C7496--


--- szparag <[EMAIL PROTECTED]> wrote:
> no.
> 
> i`m not trying to upload file on server.
> i want to send e-mail with attachments but if it's possible without
> using classes.
> 
> i thought that file should be first uploaded and then send with
> e-mail as
> attachment, maybe uploading isn't correct...
> 
> i don't know how to do it.
> 
> szparag
> 
> >
> >  
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: [PHP] isset function problem

2003-07-10 Thread Jason Wong
On Thursday 10 July 2003 21:53, Denis L. Menezes wrote:
> I have the following code :
>
> Quote:
>
> if (isset($SenderEmailAddress)){
>   mail($mailTo, $mailSubject, $Message);
>   }
>
> Unquote
>
> All I want to do is that , if the $SenderEmailAddress is not entered, the
> mail() function should not run. However,
> if the $senderEmailAddress variable is not set, the error I get is "No
> recipient addresses found in header "
>
> Can someone help and tell me why I get this error?

Use if (!empty(...)) instead. Depending on how you're getting your variable it 
may be set but empty.

And where are you getting $mailTo? Isn't that supposed to contain the 
recipients?


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Humor in the Court:
Q: ...and what did he do then?
A: He came home, and next morning he was dead.
Q: So when he woke up the next morning he was dead?
*/


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



Re: [PHP] Please assist - been on this for hours - Permissions on server

2003-07-10 Thread Jason Wong
On Thursday 10 July 2003 21:04, Steve Jackson wrote:
> > But _why_ do you need to write to the root directory? Why not
> > just write to a directory where you *do* have permission to write to?
>
> I can already do that.
> My problem is that I need to move or copy/delete the file from the place
> I do have permission to write to to the root.
>
> I have generated a PHP page but it is no good where it is, I need to
> automatically move this page and because the owner of the page is HTTPD
> and NoGROUP it doesn't let me. I get permission errors.
>
> I have tried chmod() and chown() the files I've written also to no
> avail.
>
> I'd really appreciate help because I don't know much at all about
> permissions, changing them or how I can automatically do this.

The root of the problem (pun intended) is that you're trying to write to the 
root (/) directory which is usually only possible if you're the root user.

Again, the question is _why_ do you need to write to the root directory? 
Wouldn't your file function if it wasn't in the root directory?

Without the system admin giving the required permissions what you're trying to 
do ought to be impossible (well, you might be able to find an exploit on the 
system that you can exploit). 

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Horngren's Observation:
Among economists, the real world is often a special case.
*/


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



[PHP] Re: newbie array question

2003-07-10 Thread Harry Wiens
try this:

$query = "select name from names (where age <'23'')";
$numero= sybase_connect("database" , "user" , "password" ) or die ("Unable
to connect to database server");
$result=sybase_query($query,$numero );
while($temp=sybase_fetch_array($result)){
$names[] = $temp[name];
}

mfg.
harry wiens

""Bob pilly"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Hi All
>
> Im new to php and are getting a bit confused about the sybase_fetch_array
function (i think that this is the same as mysql_fetch_array?).
>
> If i have a valid sql query that returns three the records 'john','jack'
and 'mary' and i want to put that into an array where
array[0]->john,array[1]->jack etc how do i do this? Im trying to use
sybase_fetch_array as follows:
>
> $query = "select name from names (where age <'23'')";
> $numero= sybase_connect("database" , "user" , "password" )
> or die ("Unable to connect to database server");
> $result=sybase_query($query,$numero );
> $names=sybase_fetch_array($result);
>
>
> I then try and do something like print $names[0];
>
> but it doesnt work. Sorry if this is really basic any help would be
greatly appreciated!
>
>
>
> -
> Want to chat instantly with your online friends? Get the FREE
Yahoo!Messenger



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



Re: [PHP] newbie array question

2003-07-10 Thread David Nicholson
Hello,


This is a reply to an e-mail that you wrote on Thu, 10 Jul 2003 at 15:30,
lines prefixed by '>' were originally written by you.
> If i have a valid sql query that returns three the records
> 'john','jack' and 'mary' and i want to put that into an array where
> array[0]->john,array[1]->jack etc how do i do this? Im trying to use
> sybase_fetch_array as follows:
> $query = "select name from names (where age <'23'')";
> $numero= sybase_connect("database" , "user" , "password" )
> or die ("Unable to connect to database server");
> $result=sybase_query($query,$numero );
> $names=sybase_fetch_array($result);

sybase_fetch_array will fetch one row of the result, if you want all
three rows in one array you will need something like this...

$allnames = array();
while($thisname = sybase_fetch_row($result)){
$allnames[] = $thisname[0];
}

I have never used the sybase db functions though so I may be incorrect.

All the best,

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

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



  1   2   >