[PHP] Context

2003-01-30 Thread Boaz Yahav
HI

I was reading this article : http://www.devarticles.com/art/1/397/2
And am a bit confused now.

If I understand correctly, the author claims that :

 
Combining HTML output and 
 
tags really wastes my time. 

Runs "slightly" faster than 

 


IS this true?
Is echo more consuming than entering and exiting in and out of context?

berber



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




Re: [PHP] Re: domxml memberfunction not dom compliant??

2003-01-30 Thread Øyvind Vestavik

Thanks for your reply Stefan.

I hadn't really read the manual, had just been working with DOM level 2 in
java before, and the fact that attributes are not children of elements,
puzzled me. But after reading the DOM level 2 spesification, it may seem
that you are right.

To me, the fact that attributes are not children of the element they are
contain within seems to defy the purpose of DOM, which is to represent
the entire document as a tree/trees depending on the documenttype.
This tree should be made up of Node interfaces, and as attributes inherit
from the Node interface (like element, text and so on) it seems odd to me
that the attribute is not part of the dom tree.

But I guess it is easier to rewrite my code according to the
"shortcommings" in dom than to change DOM level 2 and subsequently to
change the libxml-libraries :-)

vennlig hilsen
Øyvind

On Thu, 30 Jan 2003 [EMAIL PROTECTED] wrote:

> Hello
> As far as I rememeber according to DOM Level 2 Elementnodes contain
> Attributenodes but the Attributenode has no association with its
> Elementnode meaning you can't tell from an Attributenode which Elementnode
> it belongs to unless you remember it in your code. Thus an Attributenode
> is not part of the Domtree as an Elementnode and will not be returned as a
> Child of that Node. The only way to retrieve Attributenodes is by going
> throught the Elementnode and retrieving the attributes explicitly.
> In other words Attributenodes are special nodes which do not get nested in
> the DOMtree as children of their corresponding Elementnode. This leaves
> space for optimizing the DOMTree by inserting a single attributenode for
> multiple Elementnodes. (At least that is what I'm guessing...)
>
> Please correct me if I'm mistaken
>
> Stefan


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




[PHP] quick question

2003-01-30 Thread Dale
I need to specify a absolute path to a file on my harddrive, but you can't
use backslashes in php. Right?

Thanks,
Dale



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




Re: [PHP] content type header for downloading files

2003-01-30 Thread Ernest E Vogelsinger
At 02:04 30.01.2003, Dara Dowd said:
[snip]
>$fname is the name of the file i want to download. It works in IE, as in the 
>name of the file to be downloaded appears correctly in the dialog box. I 
>changed 'application/octet' to 'application/octet-stream' and this had no 
>effect.
[snip] 

This is what I do to transmit a file for a save-as download, and it works
in all browsers I know and have tested the same (Netscape, IE, Opera/Win;
Mozilla, Konqueror et al. / Linux):

header('Content-type: application/octet-stream');
header('Content-length: ' . strlen($this->export));
header('Content-Disposition: attachment' .
(empty($fname) ? '' : ';filename="'.$fname.'.csv"'));
echo $this->export;
exit();

Note that it seems to be necessary to surround the filename using quotes to
make it work correctly.



-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] if (a == b) ...

2003-01-30 Thread Ernest E Vogelsinger
At 02:36 30.01.2003, Webapprentice said:
[snip]
>Hi,
>I have a conditional:
>if (a == b)
>
>a is the number 0, but b is a string "Friday August 22".
>
>The condition is evaluating as true, which is not what I want.
>What am I misunderstanding?
[snip] 

PHP tries to "help" you - you can only compare data of the same type. So
PHP goes ahead and casts this for you, a string to int in this case.

If you compare it using "===" (typesafe comparison) you will get correct
results.


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] quick question

2003-01-30 Thread Ernest E Vogelsinger
At 10:25 30.01.2003, Dale said:
[snip]
>I need to specify a absolute path to a file on my harddrive, but you can't
>use backslashes in php. Right?
[snip] 

Oh yes, you can. Just pay attention that the backslash is an "escape"
character telling PHP to take the next character literally. So if you want
a backslash you need to type 2 of them:

"C:\Program Files\php" ==> "C:\\Program Files\\php"


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] Is there a bug in fopen() - solved, maybe

2003-01-30 Thread Ernest E Vogelsinger
At 08:33 30.01.2003, zlu tarch said:
[snip]
>I was not able to either telnet (via port 80), or
>connect using fopen() to www2.barchart.com. 
>
>But it seems that it is fine now. Perhaps it was a
>temp problem on the site's server, but still, I had no
>problems connecting to the site via a browser while
>fopen and telnet were not working.
>
>It would be interesting to see if anyone else
>experienced similar problems.
[snip] 

Possibly the server is behind a firewall and is not allowed to make an
outgoing connection on the specific port?


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] quick question

2003-01-30 Thread Jason Wong
On Thursday 30 January 2003 17:25, Dale wrote:
> I need to specify a absolute path to a file on my harddrive, but you can't
> use backslashes in php. Right?

Please use a descriptive subject.

You escape an intended literal backslash with a backslash.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
World War Three can be averted by adherence to a strictly enforced dress code!
*/


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




Re: [PHP] __PHP_Incomplete_Class Object

2003-01-30 Thread Ernest E Vogelsinger
At 06:20 30.01.2003, Weston Houghton said:
[snip]
>I'm trying to register an object in the session, and access that object  
>from 2 different pages.
>
>I start off in the first file, and do:
>include("nycmgMail.php");
>session_start();
>$myMailer = new nycmgMail();
>
> ...
>
>If I print_r the $_SESSION on that page, everything looks fine. So I  
>then move to my second page, and use:
>
>...
>
>Now when I do this, if I look at the $_SESSION object I see that that  
>class is now listed as:
>[myMailer] => __PHP_Incomplete_Class Object
[snip] 

You need to include the class definition of an object _before_
instantiating it. If you omit the class definition, PHP has no chance to
assign the correct class and uses a builtin default class.

Include your class definition file before session_start() and you'll be fine.


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] Remembering which option in a SELECT tag the user had chosen

2003-01-30 Thread Paul
Inside HTML code, parsed as php, in a select, I've been using the below. It's a bit 
longer than your plan to use arrays, but it works fine.


-- Select a country --
>United 
States
>Afghanistan

and so forth

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




[PHP] Please...

2003-01-30 Thread Øyvind Vestavik

Thanks dave for our comments on the use of the list, and sorry for sending
this mail to your adress the first time around.

When we're at it:
If a question has already been answered, please do not follow up with a
new reply that doesn't add important information/corrections.

Regards
Øyvind

On Thu, 30 Jan 2003, David Freeman wrote:

>
> G'day Scott
>
>  > Just curious, is there a PHP function that will break up the
>  > string for us?
>
> I'm not specifically having a go at you but more observing that some
> people use this list as a first line of question rather than doing some
> work themselves.
>
> Assuming that I didn't already know what function provides this
> capability I could do the following:
>
> 1.  Go to the online manual at http://www.php.net/manual/
>
> 2.  Since my problem deals with strings I would then go to the string
> functions page of the function reference section of the manual.
>
> 3.  I would then look through the various functions listed here, each of
> which includes a short description of what the function does.
>
> 4.  I would notice that within the first dozen entries there's a
> function called explode with a description of "Split a string by
> string".
>
> 5.  I would guess that this explode function might be fairly close to
> what I'm looking for and load it's page.
>
> 6.  I would glance at some of the user contributed notes and see
> examples of using explode and even some pitfalls to be aware of in it's
> use.
>
> At this point, my question is answered and I've managed to find out
> things in the process.  If I've been paying attention I've probably
> gained a small appreciation of a few other string related functions that
> I didn't know about and filed it away for future use too.
>
> Just a thought...
>
> CYA, Dave
>
>
>
>
>
> --
> 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] Use Pop3

2003-01-30 Thread Chris Hayes
At 07:49 30-1-2003, you wrote:

Hello,

Is it possible via PHP to :
- join a pop3 server
- make a "query" to recover mails header, subject, date, sender, to
create a list.
- we I have the list when I click on an element of the list recever the
email content (text and attachment) and why not see the email's header
- Have the possibility to delete a specific message (or more)
- Send email too.

search for the phpclasses site with Manuel Lemos' s class for POP3



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




[PHP] SQLqry in PHP

2003-01-30 Thread Per
I try to use a SQLqry in PHP, but i get this anwser in my browser:

FATAL: emalloc(): Unable to allocate 1073741824 bytes

Somthing i can do to fix it in PHP?
(I have no rights at the server)





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




RE: [PHP] quick question

2003-01-30 Thread John W. Holmes
> I need to specify a absolute path to a file on my harddrive, but you
can't
> use backslashes in php. Right?

You can also use forward slashes just as effectively.

C:/path/to/your/file.php

Or, if the file is on the C drive, you can use

/path/to/your/file.php

without even using the c: part. 

---John Holmes...



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




RE: [PHP] Context

2003-01-30 Thread John W. Holmes
> I was reading this article : http://www.devarticles.com/art/1/397/2
> And am a bit confused now.
> 
> If I understand correctly, the author claims that :
> 
> 
> Combining HTML output and
> 
> tags really wastes my time.
> 
> Runs "slightly" faster than
> 
>$php_tags = "PHP Tags";
>   echo "Never breaking out of $php_tags is much less irritating.";
> ?>
> 
> 
> IS this true?
> Is echo more consuming than entering and exiting in and out of
context?

It doesn't matter. If you're doing anything worthwhile in your code,
whatever style you use is going to be negligible to the final time it
takes your code to parse. 

Use what ever is comfortable for you, whichever you understand better.
Or, better yet, use a templating system so your HTML is always
completely separate from your PHP.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




Re: [PHP] SQLqry in PHP

2003-01-30 Thread Chris Hayes
At 12:14 30-1-2003, you wrote:

I try to use a SQLqry in PHP, but i get this anwser in my browser:

FATAL: emalloc(): Unable to allocate 1073741824 bytes

Somthing i can do to fix it in PHP?
(I have no rights at the server)



could you add some code, this is far too cryptic.
also tell us what php version you have and some database details


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




RE: [PHP] Problem with xml_parse_into_struct

2003-01-30 Thread John W. Holmes
> >I have various XML files that might contain <> tags inside the
element
> body, for example:
> >
> >Today on
> 1/29/03, stuff happened
> >
> Your XML is not well formed, not properly nested use:
> 
> 
> 
> This way the XML parser wil accept  and , otherwise it sees it
as
> XML elements. I hope this helps.

Wouldn't another option be to use HTML entities for anything in your
data? Use < for <, > for >, etc... so XML will not recognize it?

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




Re: [PHP] Using custom "button" form element instead of standard "submit"?

2003-01-30 Thread Durwood Gafford
sure this would work but it'd be VERY inefficient in my application.  It's a
file browser application so i have hundreds of folder icons on a page .. the
'submit' element will pass back the name of the button clicked and it would
be available immediately/directly, which is what i want.  BUT an 'image'
element would require me to loop through ALL buttons doing an 'isset' test
on each one.

I can't believe html provides no means for using an icon as a submit button.
well i'm off pursuing a javascript solution now.

by the way .. unrelated question ... why would one want to use
$_REQUEST['foo'] instead of just $foo? doesn't php give you access to form
variables using the latter construct which is much cleaner?

"Philip Olson" <[EMAIL PROTECTED]> wrote in message
Pine.BSF.4.10.10301300503280.83137-10@localhost">news:Pine.BSF.4.10.10301300503280.83137-10@localhost...
>
> [snip]
> > I assume i could use solution "A" above, and parse the _x out of the
"name"
> > value .. but this seems pretty hoaky and it's my understanding soultion
B is
> [snip]
>
> This is how it's done.  If this is set, the button
> was clicked.  For example:
>
>   if (isset($_REQUEST['thebuttonname_x'])) {
>
>   print "The button was clicked";
>   }
>
> Regards,
> Philip
>
>



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




Re: [PHP] Using custom "button" form element instead of standard"submit"?

2003-01-30 Thread Chris Hayes
At 12:18 30-1-2003, you wrote:

sure this would work but it'd be VERY inefficient in my application.  It's a
file browser application so i have hundreds of folder icons on a page .. the
'submit' element will pass back the name of the button clicked and it would
be available immediately/directly, which is what i want.  BUT an 'image'
element would require me to loop through ALL buttons doing an 'isset' test
on each one.

* if there is not other data in the form you coudl turn it into an image 
link and get the value in the $_GET
* else walk through the $_GET vars (each key/value) untill you see a 
varname that could be what you looked for.

I can't believe html provides no means for using an icon as a submit button.

well it does doesn't it?


by the way .. unrelated question ... why would one want to use
$_REQUEST['foo'] instead of just $foo? doesn't php give you access to form
variables using the latter construct which is much cleaner?

not automatically anymore since PHP 4.10.
and the exact reason was that the old way was NOT clean, see the release 
notes for PHP 4.10 for the details.



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



Re: [PHP] Email being blocked

2003-01-30 Thread Ben
No, its definitely not that. I've set the sendmail_from and it's still not
working.

Also, the mail() function actually fails to return a success code for the
non-sitedomain addresses, implying that the problem is at the source, not
the destination.

Can anyone help?

Thanks

Ben

"Lowell Allen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > From: "Ben" <[EMAIL PROTECTED]>
> >
> [snip]
> >
> > I'm trying to send out emails from a script, using the mail() function.
This
> > works, but only for email addresses that are in the same domain as the
> > website !
> >
> > So, if the website domain that the script is running within  is
> > www.mysite.com, then
> >
> > [EMAIL PROTECTED] is fine
> > [EMAIL PROTECTED] will not go
> >
> > The script is running on a Cobalt RaQ, Linux machine, with sendmail.
> >
> > Accessing sendmail from perl CGI presents no such difficulties, so I
assume
> > its not a sendmail / firewall / OS problem.
> >
> > I have also tried talking to sendmail directly, from PHP, rather than
using
> > the mail() function, and have found that the same problem occurrs.
> >
> > Could it be something in PHP.INI ?
> >
>
> The value of sendmail_from can affect the return path header and cause
> receiving systems to block as spam. There's a user contributed note in the
> manual: 
>
> --
> Lowell Allen
>



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




RE: [PHP] SQLqry in PHP

2003-01-30 Thread Jon Haworth
Hi Per,

> I try to use a SQLqry in PHP, but i get this anwser in my browser:
> FATAL: emalloc(): Unable to allocate 1073741824 bytes

1,073,741,824 bytes is exactly 1 gig - that's a *lot* of memory...

Is this an astonishingly large query? Seems the PHP interpreter can't grab
enough memory to do whatever it's trying to - I could well be wrong though.

Got any code we can see?

Cheers
Jon

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




Re: [PHP] Using custom "button" form element instead of standard "submit"?

2003-01-30 Thread Ernest E Vogelsinger
At 12:18 30.01.2003, Durwood Gafford spoke out and said:
[snip]
>sure this would work but it'd be VERY inefficient in my application.  It's a
>file browser application so i have hundreds of folder icons on a page .. the
>'submit' element will pass back the name of the button clicked and it would
>be available immediately/directly, which is what i want.  BUT an 'image'
>element would require me to loop through ALL buttons doing an 'isset' test
>on each one.
[snip] 

???




With the first method, you'd need to test for a button named 'sample_a'.
For the second method, you'd need to test for a button named 'sample_b_x'.

So where's the difference?

You need to "loop" through all available button names anyway, orhave I
completely misunderstood your question?


-- 
   >O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/


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




Re: [PHP] Using custom "button" form element instead of standard"submit"?

2003-01-30 Thread Philip Olson
On Thu, 30 Jan 2003, Chris Hayes wrote:

> At 12:18 30-1-2003, you wrote:
> >sure this would work but it'd be VERY inefficient in my application.  It's a
> >file browser application so i have hundreds of folder icons on a page .. the
> >'submit' element will pass back the name of the button clicked and it would
> >be available immediately/directly, which is what i want.  BUT an 'image'
> >element would require me to loop through ALL buttons doing an 'isset' test
> >on each one.
> * if there is not other data in the form you coudl turn it into an image 
> link and get the value in the $_GET
> * else walk through the $_GET vars (each key/value) untill you see a 
> varname that could be what you looked for.

Or why not:

  $lookingfor = 'somebutton';

  if (isset($_REQUEST[{$lookingfor . '_x'}])) {
  print "Found it, a button named $lookingfor was clicked";
  }

Or something, I think this is what you mean?  Whatever the
problem, there will be a solution ... don't stress :)  But
regarding the problem here, I don't get what you mean.  How
familiar are you with arrays?  Anyway, as Chris stated, the
name/value will be available in the appropriate autoglobal 
which will be $_POST or $_GET, and/or $_REQUEST.

> >I can't believe html provides no means for using an icon as a submit button.
> well it does doesn't it?
> 
> >by the way .. unrelated question ... why would one want to use
> >$_REQUEST['foo'] instead of just $foo? doesn't php give you access to form
> >variables using the latter construct which is much cleaner?
> not automatically anymore since PHP 4.10.
> and the exact reason was that the old way was NOT clean, see the release 
> notes for PHP 4.10 for the details.

It's as of PHP 4.2.0 that the default value of the
register_globals directive went from on to off.  It is 
this directive that pollutes your script with  these 
variables and it's recommended to not use them and
leave this deprecated directive off.  Now what happened
in PHP 4.1.0 was the introduction of autoglobals but
this is all described in various places in the manual
and here's such a place that links to others:

  http://www.php.net/variables.external

May as well read this too:

  http://www.php.net/release_4_2_0.php

Where have you been, hibernating? :)

Regards,
Philip



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




RE: [PHP] Email being blocked

2003-01-30 Thread Timothy Hitchens \(HiTCHO\)
The box does have a default route to get out of your network I trust??


Timothy Hitchens (HiTCHO)
Web Application Consulting
e-mail: [EMAIL PROTECTED]

> -Original Message-
> From: Ben [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, 30 January 2003 9:45 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Email being blocked
> 
> 
> No, its definitely not that. I've set the sendmail_from and 
> it's still not working.
> 
> Also, the mail() function actually fails to return a success 
> code for the non-sitedomain addresses, implying that the 
> problem is at the source, not the destination.
> 
> Can anyone help?
> 
> Thanks
> 
> Ben
> 
> "Lowell Allen" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > From: "Ben" <[EMAIL PROTECTED]>
> >
> [snip]
> >
> > I'm trying to send out emails from a script, using the mail() 
> > function.
This
> > works, but only for email addresses that are in the same domain as 
> > the website !
> >
> > So, if the website domain that the script is running within  is 
> > www.mysite.com, then
> >
> > [EMAIL PROTECTED] is fine
> > [EMAIL PROTECTED] will not go
> >
> > The script is running on a Cobalt RaQ, Linux machine, with sendmail.
> >
> > Accessing sendmail from perl CGI presents no such difficulties, so I
assume
> > its not a sendmail / firewall / OS problem.
> >
> > I have also tried talking to sendmail directly, from PHP, rather 
> > than
using
> > the mail() function, and have found that the same problem occurrs.
> >
> > Could it be something in PHP.INI ?
> >
>
> The value of sendmail_from can affect the return path header and cause

> receiving systems to block as spam. There's a user contributed note in

> the
> manual: 
>
> --
> Lowell Allen
>



-- 
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 custom "button" form element instead of standard "submit"?

2003-01-30 Thread Ernest E Vogelsinger
To add to my message, you could:

$buttons = array('sample_a_x', 'sample_b', 'sample_c_x');
$button_pressed = array_intersect($buttons, array_keys($_REQUEST));

If you have everything perfect, i.e. all available buttons are held in the
array, and there are no other input fields in your form that might
name-collide (which wouldn't be good anyway ;->), this will give you an
array with exactly one entry if any of the buttons are clicked, be it an
image (sample_a, sample_c) or a regular (sample_b) button.


-- 
   >O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/


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




[PHP] Passing Object Refs throught Arrays

2003-01-30 Thread James

I'm having a problem, and I wrote this sample code to illistrate it.

In this code, I'm trying to create a object, put it throught a que. I
then want something to happen to this object, and this change to be
reflected in the original object. I am aware that PHP uses copy
symantecs not refrence ones, so I have used "&" at all the places I can
see to use them. However it doesnt work: the output from this is still
0 not 100 as it should be.

Does anyone have any suggestions, or URL's to really good guides on
reference passing?

Thanks in Advance,
James.

-

class test {
var $flag = 0;
}

// Make Object
$root = new test();

// Make Que
$que = array();

// Stick object on que
array_push($que, &$root);

// Take object from Que
$consider =& array_shift($que);

// Change something on the object we pulled from the que
$consider->flag = 100;

// Test and see if it changed on the original object
echo($root->flag);





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




Re: [PHP] Using custom "button" form element instead of standard "submit"?

2003-01-30 Thread Durwood Gafford

> 
> 
>
> With the first method, you'd need to test for a button named 'sample_a'.
> For the second method, you'd need to test for a button named 'sample_b_x'.

no ... with the first example you can have numerous buttons on the same HTML
page with the same name and use the 'value' attribute to see which one is
pressed. I did this and it works quite elegantly for my application.






your php form handler can now simply do:

print "The user selected button $sample\n")

otherwise, with the image solution you'd have to do something like this...

foreach ($_GET as $button) {
  if (isset($button)) {
$button_name = substr($button, -2, 0);  // or whatever to remove the _x
print "The user selected button substr($button_name);
break;
  }
}

Although arrays might provide a solution that wouldn't quite be as good as
the 'submit' button solution, but not as worse as a straight name-based
'image' solution.

Given that the 'button' element with "type = submit" does NOT work, maybe
the javascript solution is the most elegant. but i haven't gotten that to
work yet either!







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




Re: [PHP] Using custom "button" form element instead of standard "submit"?

2003-01-30 Thread Ernest E Vogelsinger
At 13:37 30.01.2003, Durwood Gafford spoke out and said:
[snip]
>
>
>
>
>
>your php form handler can now simply do:
>
>print "The user selected button $sample\n")

This would display the "value" as button text. It works, BUT:
- you cannot divert content from data or functionality
- you have to modify code if you want to modify your page

Something that might not be worthwile, depends on the project size.

However, if you need to act on a button, you _need_ to test for something,
be it the name or the value.

>Although arrays might provide a solution that wouldn't quite be as good as
>the 'submit' button solution, but not as worse as a straight name-based
>'image' solution.

I still don't get it - maybe you could show us your approach to the
solution so we can grasp the problem?

>Given that the 'button' element with "type = submit" does NOT work, maybe
>the javascript solution is the most elegant. but i haven't gotten that to
>work yet either!

Now that's more easy:




... something here






This will give you a $_REQUEST['button'] containing the button value. Note
though that this doesn't work if JS has been disabled in the browser, or if
the "browser" doesn't support JS at all.


-- 
   >O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/


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




Re: [PHP] Using custom "button" form element instead of standard "submit"?

2003-01-30 Thread 1LT John W. Holmes
> At 13:37 30.01.2003, Durwood Gafford spoke out and said:
> [snip]
> >
> >
> >
> >
> >
> >your php form handler can now simply do:
> >
> >print "The user selected button $sample\n")

If that's what you want, then just make each button a normal  link
and pass an variable to the next page in the link (like someone has already
suggested). You'd get the same end result.






print "The user selected button $sample\n";

---John Holmes...


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




[PHP] php.net links page question

2003-01-30 Thread dan
i would like to suggest a link for the php.net links page, how would i 
go about doing that?


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



Re: [PHP] ftp_ssl_connect

2003-01-30 Thread Markus Boettger
Hello,
The problem is that I cannot find a way to set up an appropriate 
sftp-server. My tunneling with ssh does not work as it should; I'm still 
working on it...
Bye
Markus

Jason Wong schrieb:
On Tuesday 28 January 2003 20:19, Markus Boettger wrote:


Hello,
I try it again ...
is anybody here who can tell me how to use the ftp_ssl_connect function
in 4.3?
Has anybody a sample code in which the use uf the openSSL functions are
declared?
rtfm does not help here, because I do read for days now.



Just what exactly is the problem? AFAICS its use is similar to the plain 
ftp_connect() -- and there are plenty of examples on how to use that.



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




RE: [PHP] SQLqry in PHP

2003-01-30 Thread Jon Haworth
Hi,

> Yes, the field in the mssql database is > 1073741824, 
> but i want only to grab a few byte.

I think you'll need to do this in the database, then.

If you try and grab the whole field and then parse it in your script, you
have to actually get that gig of data into your script - I assume this is
where the error is happening, as your server doesn't have enough memory to
store the query results.

> Here is my code:
> $sql = "SELECT  tblSamNr.Body FROM tblSamNr where ID like '$id'";

Can you do select a substring with MSSQL? Something like:
  SELECT SUBSTR(tblSamNr.Body, 500, 2048)

(assuming the 2kb text you want to grab starts at character 500)


Cheers
Jon


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




Re: [PHP] php.net links page question

2003-01-30 Thread Maxim Maletsky

mail it to [EMAIL PROTECTED]


--
Maxim Maletsky
[EMAIL PROTECTED]



dan <[EMAIL PROTECTED]> wrote... :

> i would like to suggest a link for the php.net links page, how would i 
> go about doing that?
> 
> 
> -- 
> 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] Email being blocked

2003-01-30 Thread Ben
Problem solved !  The emails were being resolved on the box, and not
escaping to the ISP DNS where they would have been MX redirected to the
office. Other email is getting out fine.

Sorry for the stupid and non-PHP related post. I will endeavor to contribute
in future to make up for it !

Thanks,
Ben

"Timothy Hitchens )" <[EMAIL PROTECTED]> wrote in message
008201c2c859$a4320020$0500a8c0@bambino">news:008201c2c859$a4320020$0500a8c0@bambino...
> The box does have a default route to get out of your network I trust??
>
>
> Timothy Hitchens (HiTCHO)
> Web Application Consulting
> e-mail: [EMAIL PROTECTED]
>
> > -Original Message-
> > From: Ben [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, 30 January 2003 9:45 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Email being blocked
> >
> >
> > No, its definitely not that. I've set the sendmail_from and
> > it's still not working.
> >
> > Also, the mail() function actually fails to return a success
> > code for the non-sitedomain addresses, implying that the
> > problem is at the source, not the destination.
> >
> > Can anyone help?
> >
> > Thanks
> >
> > Ben
> >
> > "Lowell Allen" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > From: "Ben" <[EMAIL PROTECTED]>
> > >
> > [snip]
> > >
> > > I'm trying to send out emails from a script, using the mail()
> > > function.
> This
> > > works, but only for email addresses that are in the same domain as
> > > the website !
> > >
> > > So, if the website domain that the script is running within  is
> > > www.mysite.com, then
> > >
> > > [EMAIL PROTECTED] is fine
> > > [EMAIL PROTECTED] will not go
> > >
> > > The script is running on a Cobalt RaQ, Linux machine, with sendmail.
> > >
> > > Accessing sendmail from perl CGI presents no such difficulties, so I
> assume
> > > its not a sendmail / firewall / OS problem.
> > >
> > > I have also tried talking to sendmail directly, from PHP, rather
> > > than
> using
> > > the mail() function, and have found that the same problem occurrs.
> > >
> > > Could it be something in PHP.INI ?
> > >
> >
> > The value of sendmail_from can affect the return path header and cause
>
> > receiving systems to block as spam. There's a user contributed note in
>
> > the
> > manual: 
> >
> > --
> > Lowell Allen
> >
>
>
>
> --
> 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] Encryption using MMCrypt - whats the point?

2003-01-30 Thread Mike Morton
I want to use the mcrypt functions to encrypt credit card numbers for
storage in a mysql database, which mycrypt does admirably:

$key = "this is a secret key";
$input = "Let us meet at 9 o'clock at the secret place.";
$iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256,
MCRYPT_MODE_CBC), MCRYPT_RAND);

$encrypted_data = base64_encode(@mcrypt_encrypt (MCRYPT_RIJNDAEL_256 , $key,
$input, MCRYPT_MODE_CBC,$iv));

The trouble is - the key and the IV.  Both of these have to be available in
the merchants administration for retrieval of the credit card, thus need to
be stored somewhere - most likely on the server or in a database.  Here is
the problem - if someone gets to the database and retrieves the encrypted
credit card, the chances are that they are able to also retrieve the script
that did the encryption, thus find out where the key and IV are stored,
making it simple to decrypt the credit card for them.

The only solution that I can see is to use an asymetric encryption and have
the merchant enter the decryption key at the time of credit card retrieval -
but that is unrealistic for a User Interface point of view.

So - the only other thing that I can see to do is have a compiled program,
bound to the server, that has the key compiled into the program.  I am not a
C programmer - so this is also not exactly possible.

Does anyone else have any answers or has anyone else run into this?  Is this
just a general problem with doing encryption through PHP as opposed to a
compiled binary?  Can anyone suggest a solution to this problem?

Thanks :)




--
Cheers

Mike Morton


*
*  E-Commerce for Small Business
*  http://www.dxstorm.com
*
* DXSTORM.COM
* 824 Winston Churchill Blvd,
* Oakville, ON, CA L6J 7X2
* Tel: 905-842-8262
* Fax: 905-842-3255
* Toll Free: 1-877-397-8676
*


"Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple."
- Byte Magazine

Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey 


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




[PHP] problem with header

2003-01-30 Thread Martin
i have an script, it send a header response:

http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Encryption using MMCrypt - whats the point?

2003-01-30 Thread Jason Sheets
Not a good idea, you might look at some form of public key encryption
where you encrypt the credit card information with the public key and
the merchant decrypts it with their private key that is not on the
server.

You generally do not want to store the information encrypted with mcrypt
because in order for your application to encrypt it it must know the key
and the IV, in order for an attacker to decypt it all they need is the
IV and key as well.

There is a PHP module named "GPG Extension" available at
http://www.sourceforge.net/projects/gpgext/, it uses the gpg made easy
library to enable PHP to do public key encryption without launching
command line programs (also insecure).

Basically look on google for information on storing credit card numbers,
it is not easy to do this securely and generally good advice is not to
do it.  

If you have your merchants going over an SSL connection (which you
should) you can write your own PHP session handler and use mcrypt to
encrypt the session information with a random key generated by your
script, since it is passed over SSL it is encrypted in transit, then
decrypt the session information and load it.  Encrypting your sessions
opens the possibility to store more sensitive information inside them.

I still do not recommend storing credit card information even with these
measures, it exposes you for liability should something bad happen.  

Take a look at authorize.net or verisign's credit card processing
services, or find out if other processing companies have the capability
to store credit card information.

Jason
On Thu, 2003-01-30 at 07:30, Mike Morton wrote:
> I want to use the mcrypt functions to encrypt credit card numbers for
> storage in a mysql database, which mycrypt does admirably:
> 
> $key = "this is a secret key";
> $input = "Let us meet at 9 o'clock at the secret place.";
> $iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256,
> MCRYPT_MODE_CBC), MCRYPT_RAND);
> 
> $encrypted_data = base64_encode(@mcrypt_encrypt (MCRYPT_RIJNDAEL_256 , $key,
> $input, MCRYPT_MODE_CBC,$iv));
> 
> The trouble is - the key and the IV.  Both of these have to be available in
> the merchants administration for retrieval of the credit card, thus need to
> be stored somewhere - most likely on the server or in a database.  Here is
> the problem - if someone gets to the database and retrieves the encrypted
> credit card, the chances are that they are able to also retrieve the script
> that did the encryption, thus find out where the key and IV are stored,
> making it simple to decrypt the credit card for them.
> 
> The only solution that I can see is to use an asymetric encryption and have
> the merchant enter the decryption key at the time of credit card retrieval -
> but that is unrealistic for a User Interface point of view.
> 
> So - the only other thing that I can see to do is have a compiled program,
> bound to the server, that has the key compiled into the program.  I am not a
> C programmer - so this is also not exactly possible.
> 
> Does anyone else have any answers or has anyone else run into this?  Is this
> just a general problem with doing encryption through PHP as opposed to a
> compiled binary?  Can anyone suggest a solution to this problem?
> 
> Thanks :)
> 
> 
> 
> 
> --
> Cheers
> 
> Mike Morton
> 
> 
> *
> *  E-Commerce for Small Business
> *  http://www.dxstorm.com
> *
> * DXSTORM.COM
> * 824 Winston Churchill Blvd,
> * Oakville, ON, CA L6J 7X2
> * Tel: 905-842-8262
> * Fax: 905-842-3255
> * Toll Free: 1-877-397-8676
> *
> 
> 
> "Indeed, it would not be an exaggeration to describe the history of the
> computer industry for the past decade as a massive effort to keep up with
> Apple."
> - Byte Magazine
> 
> Given infinite time, 100 monkeys could type out the complete works of
> Shakespeare. Win 98 source code? Eight monkeys, five minutes.
> -- NullGrey 
> 
> 
> -- 
> 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] Encryption using MMCrypt - whats the point?

2003-01-30 Thread Lowell Allen
Could you use the Zend Encoder to encrypt the PHP script?


--
Lowell Allen 

> From: Mike Morton <[EMAIL PROTECTED]>
> Date: Thu, 30 Jan 2003 09:30:36 -0500
> To: <[EMAIL PROTECTED]>
> Subject: [PHP] Encryption using MMCrypt - whats the point?
> 
> I want to use the mcrypt functions to encrypt credit card numbers for
> storage in a mysql database, which mycrypt does admirably:
> 
> $key = "this is a secret key";
> $input = "Let us meet at 9 o'clock at the secret place.";
> $iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256,
> MCRYPT_MODE_CBC), MCRYPT_RAND);
> 
> $encrypted_data = base64_encode(@mcrypt_encrypt (MCRYPT_RIJNDAEL_256 , $key,
> $input, MCRYPT_MODE_CBC,$iv));
> 
> The trouble is - the key and the IV.  Both of these have to be available in
> the merchants administration for retrieval of the credit card, thus need to
> be stored somewhere - most likely on the server or in a database.  Here is
> the problem - if someone gets to the database and retrieves the encrypted
> credit card, the chances are that they are able to also retrieve the script
> that did the encryption, thus find out where the key and IV are stored,
> making it simple to decrypt the credit card for them.
> 
> The only solution that I can see is to use an asymetric encryption and have
> the merchant enter the decryption key at the time of credit card retrieval -
> but that is unrealistic for a User Interface point of view.
> 
> So - the only other thing that I can see to do is have a compiled program,
> bound to the server, that has the key compiled into the program.  I am not a
> C programmer - so this is also not exactly possible.
> 
> Does anyone else have any answers or has anyone else run into this?  Is this
> just a general problem with doing encryption through PHP as opposed to a
> compiled binary?  Can anyone suggest a solution to this problem?
> 
> Thanks :)
> 
> 
> 
> 
> --
> Cheers
> 
> Mike Morton
> 
> 
> *
> *  E-Commerce for Small Business
> *  http://www.dxstorm.com
> *
> * DXSTORM.COM
> * 824 Winston Churchill Blvd,
> * Oakville, ON, CA L6J 7X2
> * Tel: 905-842-8262
> * Fax: 905-842-3255
> * Toll Free: 1-877-397-8676
> *
> 
> 
> "Indeed, it would not be an exaggeration to describe the history of the
> computer industry for the past decade as a massive effort to keep up with
> Apple."
> - Byte Magazine
> 
> Given infinite time, 100 monkeys could type out the complete works of
> Shakespeare. Win 98 source code? Eight monkeys, five minutes.
> -- NullGrey 
> 
> 
> -- 
> 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: Best PHP db wrapper?

2003-01-30 Thread Manuel Lemos
Hello,

On 01/30/2003 02:48 AM, John Wells wrote:

Trying to decide between wrappers for a rather large application, and
wanted some input from the group as I haven't used any of these to any
degree.  So far, I've found PearDB, metabase, adodb, and MDB.

What's the best option?  My main concerns are speed and good community
support.


If you are concerned about speed, I think you should not bother to use a 
database wrapper because all of them add overhead due to the flexibility 
they provide. The more is the flexibility, the more overhead may be added.

If on the other hand you are looking for database application 
portability so you do not have to rewrite your application if you switch 
databases, maintainability and thus development speed, you may want to 
try Metabase or MDB which is a Metabase version with PEAR-DB like API.

Metabase lets you write truely portable database application. Other 
provide some level of portability but not up to the level that Metabase 
provide.

One unique feature of Metabase is that it provide very easy and portable 
database schema management. This means that in practice you can easily 
describe your database schema with tables, fields, indexes and sequences 
in a very XML based format and Metabase installs the schema for you.

Later, if you want to change your schema by adding/removing/altering any 
of the schema objects, you can simply alter the schema definition and 
Metabase will apply the changes without affecting any data inserted 
after the database schema was installed for the first time or updated 
for the last time.

Furthermore, if you are looking for very fast database application 
development support, you may also want to look into Metastorage. This is 
 a database API generator application that lets you model your database 
applications in the form of classes of objects that basically wrap 
around your database tables providing functions that you specify that 
your application need to manipulate the table rows as objects of such 
classes.

All you need to do is to specify in a very simple XML format, the 
classes with the variables you need, validation rules, relationships 
between classes and the functions of the operations your application 
needs, and Metastorage generates all the code of the classes for you, 
including the code to install and maintain the database schema.

For now, Metastorage generates code based on Metabase but in the future 
it will generate compatible code that just uses calls to the native 
database PHP API functions, thus achieving maximum speed as you need 
while also assuring true portability.

Either Metabase and Metastorage are integrated in the same project 
repository that you may learn all about it here:

http://www.meta-language.net/

--

Regards,
Manuel Lemos


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



Re: [PHP] Encryption using MMCrypt - whats the point?

2003-01-30 Thread Adam Voigt




http://www.ioncube.com/



Encrypt PHP scripts (there pretty cheap to).



On Thu, 2003-01-30 at 09:30, Mike Morton wrote:

I want to use the mcrypt functions to encrypt credit card numbers for

storage in a mysql database, which mycrypt does admirably:



$key = "this is a secret key";

$input = "Let us meet at 9 o'clock at the secret place.";

$iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256,

MCRYPT_MODE_CBC), MCRYPT_RAND);



$encrypted_data = base64_encode(@mcrypt_encrypt (MCRYPT_RIJNDAEL_256 , $key,

$input, MCRYPT_MODE_CBC,$iv));



The trouble is - the key and the IV.  Both of these have to be available in

the merchants administration for retrieval of the credit card, thus need to

be stored somewhere - most likely on the server or in a database.  Here is

the problem - if someone gets to the database and retrieves the encrypted

credit card, the chances are that they are able to also retrieve the script

that did the encryption, thus find out where the key and IV are stored,

making it simple to decrypt the credit card for them.



The only solution that I can see is to use an asymetric encryption and have

the merchant enter the decryption key at the time of credit card retrieval -

but that is unrealistic for a User Interface point of view.



So - the only other thing that I can see to do is have a compiled program,

bound to the server, that has the key compiled into the program.  I am not a

C programmer - so this is also not exactly possible.



Does anyone else have any answers or has anyone else run into this?  Is this

just a general problem with doing encryption through PHP as opposed to a

compiled binary?  Can anyone suggest a solution to this problem?



Thanks :)









--

Cheers



Mike Morton





*

*  E-Commerce for Small Business

*  http://www.dxstorm.com

*

* DXSTORM.COM

* 824 Winston Churchill Blvd,

* Oakville, ON, CA L6J 7X2

* Tel: 905-842-8262

* Fax: 905-842-3255

* Toll Free: 1-877-397-8676

*





"Indeed, it would not be an exaggeration to describe the history of the

computer industry for the past decade as a massive effort to keep up with

Apple."

- Byte Magazine



Given infinite time, 100 monkeys could type out the complete works of

Shakespeare. Win 98 source code? Eight monkeys, five minutes.

-- NullGrey 





-- 

PHP General Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


Re: [PHP] Encryption using MMCrypt - whats the point?

2003-01-30 Thread Mike Morton
Adam/Lowell:

Thanks for the suggestions ­ but like all clients ­ they want maximum
function for minimum $$ - encoders are therefore not a possibility (but I
will keep that in mind for future apps :))

Thanks.

On 1/30/03 9:55 AM, "Adam Voigt" <[EMAIL PROTECTED]> wrote:

> http://www.ioncube.com/
> 
> Encrypt PHP scripts (there pretty cheap to).
> 
> On Thu, 2003-01-30 at 09:30, Mike Morton wrote:
> I want to use the mcrypt functions to encrypt credit card numbers for
> storage in a mysql database, which mycrypt does admirably:
> 
> $key = "this is a secret key";
> $input = "Let us meet at 9 o'clock at the secret place.";
> $iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256,
> MCRYPT_MODE_CBC), MCRYPT_RAND);
> 
> $encrypted_data = base64_encode(@mcrypt_encrypt (MCRYPT_RIJNDAEL_256 , $key,
> $input, MCRYPT_MODE_CBC,$iv));
> 
> The trouble is - the key and the IV.  Both of these have to be available in
> the merchants administration for retrieval of the credit card, thus need to
> be stored somewhere - most likely on the server or in a database.  Here is
> the problem - if someone gets to the database and retrieves the encrypted
> credit card, the chances are that they are able to also retrieve the script
> that did the encryption, thus find out where the key and IV are stored,
> making it simple to decrypt the credit card for them.
> 
> The only solution that I can see is to use an asymetric encryption and have
> the merchant enter the decryption key at the time of credit card retrieval -
> but that is unrealistic for a User Interface point of view.
> 
> So - the only other thing that I can see to do is have a compiled program,
> bound to the server, that has the key compiled into the program.  I am not a
> C programmer - so this is also not exactly possible.
> 
> Does anyone else have any answers or has anyone else run into this?  Is this
> just a general problem with doing encryption through PHP as opposed to a
> compiled binary?  Can anyone suggest a solution to this problem?
> 
> Thanks :) 
> 
> 
> 


--
Cheers

Mike Morton


*
*  E-Commerce for Small Business
*  http://www.dxstorm.com
*
* DXSTORM.COM
* 824 Winston Churchill Blvd,
* Oakville, ON, CA L6J 7X2
* Tel: 905-842-8262
* Fax: 905-842-3255
* Toll Free: 1-877-397-8676
*


"Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple."
- Byte Magazine

Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey 




[PHP] Advanced PHP Debugger

2003-01-30 Thread Fredrik Johansson
Hey,

Where can I find a compiled php_apd.dll for Windows 2000 / PHP 4.3.0? If 
you have it, it would be great if you could send it to me (to me 
personally and not the list).

Thanks!

// Fredrik Johansson



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



Re: [PHP] Encryption using MMCrypt - whats the point?

2003-01-30 Thread Adam Voigt
Title: Re: [PHP] Encryption using MMCrypt - whats the point?




Granted, the $350 stand-alone encoder is a bit expensive. I'm talking about the online

encoder though, you pass your PHP script through the online-control center and it

output's the encrypted version, a typical PHP program is $5.00 (yes that's five dollar's),

try selecting your code after you register for a free account, it will tell you how much it

would cost to encode it. And after it is encoded, the decoder's (the things you put on

the server to run the encrypted program's) are 100% free.





On Thu, 2003-01-30 at 10:03, Mike Morton wrote:

Adam/Lowell:



Thanks for the suggestions – but like all clients – they want maximum function for minimum $$ - encoders are therefore not a possibility (but I will keep that in mind for future apps :)) 



Thanks.



On 1/30/03 9:55 AM, "Adam Voigt" <[EMAIL PROTECTED]> wrote:





http://www.ioncube.com/ 



Encrypt PHP scripts (there pretty cheap to). 



On Thu, 2003-01-30 at 09:30, Mike Morton wrote: 

I want to use the mcrypt functions to encrypt credit card numbers for

storage in a mysql database, which mycrypt does admirably:



$key = "this is a secret key";

$input = "Let us meet at 9 o'clock at the secret place.";

$iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256,

MCRYPT_MODE_CBC), MCRYPT_RAND);



$encrypted_data = base64_encode(@mcrypt_encrypt (MCRYPT_RIJNDAEL_256 , $key,

$input, MCRYPT_MODE_CBC,$iv));



The trouble is - the key and the IV.  Both of these have to be available in

the merchants administration for retrieval of the credit card, thus need to

be stored somewhere - most likely on the server or in a database.  Here is

the problem - if someone gets to the database and retrieves the encrypted

credit card, the chances are that they are able to also retrieve the script

that did the encryption, thus find out where the key and IV are stored,

making it simple to decrypt the credit card for them.



The only solution that I can see is to use an asymetric encryption and have

the merchant enter the decryption key at the time of credit card retrieval -

but that is unrealistic for a User Interface point of view.



So - the only other thing that I can see to do is have a compiled program,

bound to the server, that has the key compiled into the program.  I am not a

C programmer - so this is also not exactly possible.



Does anyone else have any answers or has anyone else run into this?  Is this

just a general problem with doing encryption through PHP as opposed to a

compiled binary?  Can anyone suggest a solution to this problem?



Thanks :)











--

Cheers



Mike Morton





*

*  E-Commerce for Small Business

*  http://www.dxstorm.com

*

* DXSTORM.COM

* 824 Winston Churchill Blvd,

* Oakville, ON, CA L6J 7X2

* Tel: 905-842-8262

* Fax: 905-842-3255

* Toll Free: 1-877-397-8676

*





"Indeed, it would not be an exaggeration to describe the history of the computer industry for the past decade as a massive effort to keep up with Apple."

- Byte Magazine



Given infinite time, 100 monkeys could type out the complete works of 

Shakespeare. Win 98 source code? Eight monkeys, five minutes. 

-- NullGrey 






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


[PHP] XML PHP question

2003-01-30 Thread Hardik Doshi

Hi everyone,

Can you please tell me what is the best way of working with XML technology using PHP? 
I am not clear about integration of these two technologies. 

Suggest some books or links or good tutorials. 

thanks

Hardik Doshi
Web Application Developer
Chicago



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


[PHP] $HTTP_USER_AGENT

2003-01-30 Thread Jan Mikes
hi all,

do anyone know where I can get a full list of $HTTP_USER_AGENT strings ??

thanx a lot

mtg


Re: [PHP] Passing Object Refs throught Arrays

2003-01-30 Thread Tom Rogers
Hi,

Thursday, January 30, 2003, 10:36:20 PM, you wrote:

J> I'm having a problem, and I wrote this sample code to illistrate it.

J> In this code, I'm trying to create a object, put it throught a que. I
J> then want something to happen to this object, and this change to be
J> reflected in the original object. I am aware that PHP uses copy
J> symantecs not refrence ones, so I have used "&" at all the places I can
J> see to use them. However it doesnt work: the output from this is still
J> 0 not 100 as it should be.

J> Does anyone have any suggestions, or URL's to really good guides on
J> reference passing?

J> Thanks in Advance,
J> James.

J> -

J> class test {
J> var $flag = 0;
J> }

J> // Make Object
J> $root = new test();

J> // Make Que
J> $que = array();

J> // Stick object on que
J> array_push($que, &$root);

J> // Take object from Que
J> $consider =& array_shift($que);

J> // Change something on the object we pulled from the que
$consider->>flag = 100;

J> // Test and see if it changed on the original object
echo($root->>flag);

Here are some replacements that I use for handling references as the normal pop
and push wont work:

function array_ref_push(&$array,&$ref){
$array[] =& $ref;
}
function &array_ref_pop(&$array){
$r =& $array[count($array)-1];
array_pop($array);
return $r;
}

function array_ref_unshift(&$array,&$ref){
array_unshift($array,'');
$array[0] =& $ref;
}
function &array_ref_shift(&$array){
$r =& $array[0];
array_shift($array);
return $r;
}



-- 
regards,
Tom


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




[PHP] Re: XML PHP question

2003-01-30 Thread Manuel Lemos
Hello,

On 01/30/2003 01:17 PM, Hardik Doshi wrote:

Can you please tell me what is the best way of working with XML technology using PHP? I am not clear about integration of these two technologies. 

Suggest some books or links or good tutorials. 

Either of these books reviewed here are very good and recommended:

http://en.static.phpclasses.org/products.html/id/1861007213.html

http://en.static.phpclasses.org/products.html/id/0735712271.html

--

Regards,
Manuel Lemos


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




RE: [PHP] $HTTP_USER_AGENT

2003-01-30 Thread Ford, Mike [LSS]
> -Original Message-
> From: Jan Mikes [mailto:[EMAIL PROTECTED]]
> Sent: 30 January 2003 15:23
> 
> do anyone know where I can get a full list of 
> $HTTP_USER_AGENT strings ??

Try http://www.psychedelix.com/agents.html -- it's about as comprehensive as
they come!

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 


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





[PHP] MySQL - setting relationships

2003-01-30 Thread Denis L. Menezes
hello friends,

I am a newbie at MySQL.

In MS Access we specifically set relationships. In MySQL, I have found no 
documentation regarding setting relationships. 

Is is that we do not need to set the relationships in MySQl and only matching the 
Field IDs in respectyive tables is suffecient?

Thanks
Denis


[PHP] Reporting tools for PHP?

2003-01-30 Thread Denis L. Menezes
hello Friends?

Is there any reporting toold for PNH/MySQL like there is Crystal Reports etc?

Thanks
denis


Re: [PHP] $HTTP_USER_AGENT

2003-01-30 Thread Jan Mikes
exactly what I needed

thank you
mtg

- Original Message -
From: "Ford, Mike [LSS]" <[EMAIL PROTECTED]>
To: "'Jan Mikes'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, January 30, 2003 4:46 PM
Subject: RE: [PHP] $HTTP_USER_AGENT


> > -Original Message-
> > From: Jan Mikes [mailto:[EMAIL PROTECTED]]
> > Sent: 30 January 2003 15:23
> >
> > do anyone know where I can get a full list of
> > $HTTP_USER_AGENT strings ??
>
> Try http://www.psychedelix.com/agents.html -- it's about as comprehensive
as
> they come!
>
> Cheers!
>
> Mike
>
> -
> Mike Ford,  Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211
>
>
> --
> 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] $HTTP_USER_AGENT

2003-01-30 Thread Chris Shiflett
--- Jan Mikes <[EMAIL PROTECTED]> wrote:
> do anyone know where I can get a full list of
> $HTTP_USER_AGENT strings ??

There is no such thing.

Chris

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




[PHP] HTTP_GET_VARS[]

2003-01-30 Thread Mike Tuller
I have created a page for editing a row in a MySql database where first 
I have a page listing the items in the table, and have the id as a 
hypertext link that then on then opens the editing page with the 
correct information using HTTP_GET_VARS[id] where the URL is 
http://127.0.0.1/asset/editsoftwareasset.php?id=3. The issue I am 
having now is that I have the editsoftwareassest.php's form action set 
to POST to a script called updatesoftwareasset.php that is supposed to 
take the values from the fields in editsoftwareasset.php and update the 
information. I have the following statement sent to the database.

$query = "UPDATE assets SET title = '$title', version = '$version', 
developer = '$developer', serial_number = '$serial_number',  WHERE 
asset_id = '$HTTP_GET_VARS[id]'" ;

The $HTTP_GET_VARS[id] variable doesn't seem to carry to this script. I 
tested the sql statement by by having the asset_id = '3', and it 
updated the record, but the HTTP_GET_VARS didn't. How can I have the 
editsoftwareasset.php POST to the updatesoftwareasset.php and carry the 
HTTP_GET_VARS variable so that I can update the correct record?

I hope all of this makes sense.


Mike


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



RE: [PHP] HTTP_GET_VARS[]

2003-01-30 Thread Matt Schroebel
> -Original Message-
> From: Mike Tuller [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, January 30, 2003 11:02 AM
> Subject: [PHP] HTTP_GET_VARS[]

> The issue I am 
> having now is that I have the editsoftwareassest.php's form 
> action set 
> to POST to a script called updatesoftwareasset.php that is 
> supposed to 
> take the values from the fields in editsoftwareasset.php and 
> update the 
> information. I have the following statement sent to the database.
> 
> $query = "UPDATE assets SET title = '$title', version = '$version', 
> developer = '$developer', serial_number = '$serial_number',  WHERE 
> asset_id = '$HTTP_GET_VARS[id]'" ;

Change the var to '{$HTTP_POST_VARS['id']}' (with the curly braces since
the array reference is inside a double quoted string.  If your version
of php is 4.1.2 or higher, you really ought to use '{$_POST['id']}'
since it's a magic global and easier to use since you won't have to
declare it global inside functions.
 

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




Re: [PHP] Reporting tools for PHP?

2003-01-30 Thread John Wells
Denis,

I've been looking as well.  My solution?  Run Jasper Reports
(http://jasperreports.sf.net) from a Tomcat container integrated with
Apache via mod_jk.so.  Don't have any reports finished yet, so not sure of
speed, etc., but Jasper looks to be pretty full featured and it freely
available.

HTH,

John

Denis L. Menezes said:
> hello Friends?
>
> Is there any reporting toold for PNH/MySQL like there is Crystal Reports
> etc?
>
> Thanks
> denis




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




Re: [PHP] HTTP_GET_VARS[]

2003-01-30 Thread Mike Tuller
I am using PHP 4.3.0. it looks a little confusing because I am not 
using the $_POST when calling variables, but that is because before 
that script I have this.

$title = $_POST['title'];
$version = $_POST['version'];
$developer = $_POST['developer'];
$serial_number = $_POST['serial_number'];
$platform = $_POST['platform'];

For me it makes things easier to read.

I changed what you said, and it still doesn't update anything. I even 
added echo $HTTP_POST_VARS['id']; to check to see if there was any 
value, but the echo statement doesn't return anything.

Can I carry the HTTP_POST_VARS to another page, or do I need to use 
hidden fields or something?


On Thursday, January 30, 2003, at 10:10 AM, Matt Schroebel wrote:

-Original Message-
From: Mike Tuller [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 30, 2003 11:02 AM
Subject: [PHP] HTTP_GET_VARS[]



The issue I am
having now is that I have the editsoftwareassest.php's form
action set
to POST to a script called updatesoftwareasset.php that is
supposed to
take the values from the fields in editsoftwareasset.php and
update the
information. I have the following statement sent to the database.

$query = "UPDATE assets SET title = '$title', version = '$version',
developer = '$developer', serial_number = '$serial_number',  WHERE
asset_id = '$HTTP_GET_VARS[id]'" ;


Change the var to '{$HTTP_POST_VARS['id']}' (with the curly braces 
since
the array reference is inside a double quoted string.  If your version
of php is 4.1.2 or higher, you really ought to use '{$_POST['id']}'
since it's a magic global and easier to use since you won't have to
declare it global inside functions.




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




[PHP] PHP - mysql_info question

2003-01-30 Thread Mark McCulligh
I have written a PHP function that uses the MySQL command:
LOAD DATA INFILE ...

The command returns the result in mysql_info()
Records: 42 Deleted: 0 Skipped: 0 Warnings: 5

My question is how do you find out what the 5 warnings are.
Does MySQL put them in a log file somewhere and is there a way to display
them to my user through PHP.

Thanks,
Mark.




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




[PHP] MySQL - setting relationships

2003-01-30 Thread Larry E. Ullman
In MS Access we specifically set relationships. In MySQL, I have found 
no documentation regarding setting relationships.

Is is that we do not need to set the relationships in MySQl and only 
matching the Field IDs in respectyive tables is suffecient?

Current versions of MySQL do not have ways to constrain foreign keys 
unless you're using the InnoDB table type. This will change in later 
versions of MySQL. For the time being, you can still create your 
database as you otherwise would and perform a join across the tables.

Larry


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



Re: [PHP] Reporting tools for PHP?

2003-01-30 Thread Tyler Lane
On Thu, 2003-01-30 at 08:57, Denis L. Menezes wrote:
> hello Friends?
> 
> Is there any reporting toold for PNH/MySQL like there is Crystal Reports etc?
Do you mean PHP/MySQL?

if that is the case, why not use Crystal Reports?
Setup MyODBC for your MySQL server and use ODBC to connect to it using
Crystal Reports.

> 
> Thanks
> denis
-- 
Tyler Lane
[EMAIL PROTECTED]

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




RE: [PHP] Adding HTTP URL Code

2003-01-30 Thread ELLIOTT,KATHERINE A (HP-FtCollins,ex1)
Hi all!

Unfortunately, I didn't receive any replies to the problem I sent out
on January 16th so I thought I'd send another email and perhaps
clarify what I am seeing so that maybe someone CAN help and ask
if folks on the list have just not seen this issue before.

The program I am working on allows the customer to view test results
based on a keyword.  If the results contain a URL (these URLs are 
entered into the MySQL database as straight text), I make it live 
using the code snippet below.  Unfortunately, I have not been successful
doing this no matter what I try.  Currently, after I have run the code
below, what I see is a link containing the correct text but, when you put
the cursor over the link, the actual URL is that of the "base" browser
page.  For example, I am working on a file located at:

http://fake.url.com/testing/Test_Results/search_keyword.php

(which is called from form Search_Keyword.php).

If the test results that fit the keyword search contains, say, URL
http://www.cleanrun.com (again, entered into the database as
plain text), this is what will show up in the search output.  HOWEVER,
when the cursor is placed over the URL (or the URL is clicked), the
URL that appears at the bottom of the browser corresponding to 
the cursor'd URL is http://fake.url.com/testing/Test_Results.

Is there something in my PHP config file I might be missing?  Is there
something in my code I'm not doing correctly?  Has anyone else ever
seen this problem?

HELP!!!  I'm at my wits end with this one.  I'm afraid I'm not going to
be able to make these links live which will make the tool much less
usable.  Please let me know if you need more information from me in
order to help!

Thanks so much,

Katherine

-Original Message-
From: ELLIOTT,KATHERINE A (HP-FtCollins,ex1)
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 10:54 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP] Adding HTTP URL Code


Thanks for all your help with my URL code problem!

I have come up with a solution that seems to half work and I can't
figure out what I need to do to get it fully functional.  Given my
data string (text) from my database, this is what I do to replace the
URL text with a functioning link.  I am asking folks that, if they 
include a URL in their results to surround it by [] so that I can search
for the brackets.  This is what my text replace line looks like:

$data_str = eregi_replace ("(\[http://)([^]]*)", "\\0", $data_str);

So, if the URL is (for example) [http://www.cleanrun.com] (in plain text),
it will show up for viewing in my browser as http://www.cleanrun.com
but the URL associated with it will be that of the directory in the browser
"Location" (i.e. http://wrong.url.com/Test_Results).

I've tried all sorts of things with the call to eregi_replace but can't
figure out what is going on.

What the hec???  Can someone help?

Many thanks!!

Katherine Elliott

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 08, 2003 2:05 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Adding HTTP URL Code


On Thursday 09 January 2003 04:07, ELLIOTT,KATHERINE A (HP-FtCollins,ex1) 
wrote:
> OK, so I've gotten NO responses to my query below so I
> thought I'd ask for something slightly different and see what
> I get.

With regards to your original query, the answer is in the archives. Try 
searching for something like "regex url" or "regex hyperlink" etc.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
NOTICE: alloc: /dev/null: filesystem full
*/


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

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

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




[PHP] while loop- will this work?

2003-01-30 Thread SpyProductions Support Team


Should this work?

$f1 = rand(999,999);

while($check_sid = mysql_query("SELECT * FROM that_table WHERE this =
'$f1'")){

$f1 = rand(999,999);

}


i.e. put the random number in a loop to check and make sure it is already
not in use?

Thanks,

-Mike



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




[PHP] Mysterious gap

2003-01-30 Thread Lightfirst
Hello All, I am hoping someone can help me with a problem I am having with
PHP (3.23.49) and mysql  (4). My objective is to fill a table with data from
a database. My problem is that I cannot figure out why I get a gap
(noticeable with about 20 records) at the top of the page (just below the
text line) when I run the code below. In addition, the gap grows (just
slightly) with the amount of records that I retrieve from the database (the
gap will be about 7 lines with 200 records).

The code you see (which has been taken out of a larger program) is what I
needed to reproduce the problem. I know that if I take out the hidden field
the gap will be eliminated (though I am clueless why that should make a
difference) but I need the hidden field for the switch statement (part of
the code I removed).

The data in the database is regular text -nothing weird (I have tested with
a few tables and have encountered the same problem).

Any ideas...Thanks in advance.
-David


   This is the top of the page. Where is this gap comming from??


  
  
  
   
  

   




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




RE: [PHP] HTTP_GET_VARS[]

2003-01-30 Thread Matt Schroebel
> >> $query = "UPDATE assets SET title = '$title', version = '$version',
> >> developer = '$developer', serial_number = '$serial_number',  WHERE
> >> asset_id = '$HTTP_GET_VARS[id]'" ;
> >
> > Change the var to '{$HTTP_POST_VARS['id']}' (with the curly braces 
> > since
> > the array reference is inside a double quoted string.  If 
> your version
> > of php is 4.1.2 or higher, you really ought to use '{$_POST['id']}'
> > since it's a magic global and easier to use since you won't have to
> > declare it global inside functions.

My bad, I misunderstood what you meant. Yes, you'll need to save the id
from the get, and put it in a hidden field on the form or in a session
var, and use that in the update.  Still, make sure to wrap the array
reference in curly braces inside the double quoted string.

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




[PHP] Re: Reporting tools for PHP?

2003-01-30 Thread Mark McCulligh
You can now buy Crystal Reports that runs on non-windows platforms.
Crystal Reports 9 advance has mult-platform version.
But is not cheap, $1,900 US. (also only 3-thread, unlimited threaded reports
cost 25,000 US per CPU)

Are you looking to put reports online, for users can run and view report
through your site.  Or do you want to just write some reports to run
internally for yourself/company.  If you just want to run the reports
through the crystal report application itself.  Just install MyODBC on a
windows desktop, then install Crystal Report. (like someone else suggested)

Of course if you server is window already you can install normal crystal
report right on it, I am assume your MySQL server is not windows.

Mark.


"Denis L. Menezes" <[EMAIL PROTECTED]> wrote in message
001501c2c878$4ee1b240$642a7dcb@pcdenisxp">news:001501c2c878$4ee1b240$642a7dcb@pcdenisxp...
hello Friends?

Is there any reporting toold for PNH/MySQL like there is Crystal Reports
etc?

Thanks
denis



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




RE: [PHP] while loop- will this work?

2003-01-30 Thread Matt Schroebel

> -Original Message-
> From: SpyProductions Support Team [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, January 30, 2003 12:57 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] while loop- will this work?
> 
> 
> 
> 
> Should this work?
> 
> $f1 = rand(999,999);
> 
>   while($check_sid = mysql_query("SELECT * FROM 
> that_table WHERE this =
> '$f1'")){
> 
>   $f1 = rand(999,999);
> 
> }
> 
> 
> i.e. put the random number in a loop to check and make sure 
> it is already
> not in use?

If you check the result set for a match.  $result being true will only
mean the sql executed, and not that the value was in the table.  So you
should do a mysql_fetch_row($result) and if it succeeds the row exists
in the table.

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




Re: [PHP] Mysterious gap

2003-01-30 Thread Jason Wong
On Friday 31 January 2003 02:00, Lightfirst wrote:
> Hello All, I am hoping someone can help me with a problem I am having with
> PHP (3.23.49) and mysql  (4). My objective is to fill a table with data
> from a database. My problem is that I cannot figure out why I get a gap
> (noticeable with about 20 records) at the top of the page (just below the
> text line) when I run the code below. In addition, the gap grows (just
> slightly) with the amount of records that I retrieve from the database (the
> gap will be about 7 lines with 200 records).
>
> The code you see (which has been taken out of a larger program) is what I
> needed to reproduce the problem. I know that if I take out the hidden field
> the gap will be eliminated (though I am clueless why that should make a
> difference) but I need the hidden field for the switch statement (part of
> the code I removed).
>
> The data in the database is regular text -nothing weird (I have tested with
> a few tables and have encountered the same problem).
>
> Any ideas...Thanks in advance.
> -David
>
>  function func1(){
>$id2 = @mysql_pconnect("localhost", "user", "pass");
>@mysql_select_db("db1", $id2);
>
>   $query = "SELECT * FROM t1 WHERE f1= '1'";
>   $result = mysql_query($query);
> ?>
>This is the top of the page. Where is this gap comming from??
> 
>  while($query_data = mysql_fetch_array($result)) {  ?>
>   
>   
>   $q = $query_data ["info"]; ?>
>
>   
> 
>
>  switch ($op) {
>   default:
> func1(); break;
> }
> ?>

Put your  inside the table cells (ie in between  & ). 

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Some people around here wouldn't recognize subtlety if it hit them on the 
head.
*/


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




Re: [PHP] content type header for downloading files

2003-01-30 Thread Sascha Braun
Hi, I would like to test you code in my webpage, but
i dont really know how to get along with path informations
like ../images/pictures/image24.jpg

Do I have to split the string in multiple parts, so i at last only
got the picture name? But how then do i open the file?

- thru fopen() or something equal or how do you do it?

Please gimme some more informations if you like :))

Greetings

Sascha

- Original Message -
From: "Ernest E Vogelsinger" <[EMAIL PROTECTED]>
To: "Dara Dowd" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, January 30, 2003 10:27 AM
Subject: Re: [PHP] content type header for downloading files


> At 02:04 30.01.2003, Dara Dowd said:
> [snip]
> >$fname is the name of the file i want to download. It works in IE, as in
the
> >name of the file to be downloaded appears correctly in the dialog box. I
> >changed 'application/octet' to 'application/octet-stream' and this had no
> >effect.
> [snip]
>
> This is what I do to transmit a file for a save-as download, and it works
> in all browsers I know and have tested the same (Netscape, IE, Opera/Win;
> Mozilla, Konqueror et al. / Linux):
>
> header('Content-type: application/octet-stream');
> header('Content-length: ' . strlen($this->export));
> header('Content-Disposition: attachment' .
> (empty($fname) ? '' : ';filename="'.$fname.'.csv"'));
> echo $this->export;
> exit();
>
> Note that it seems to be necessary to surround the filename using quotes
to
> make it work correctly.
>
>
>
> --
>>O Ernest E. Vogelsinger
>(\)ICQ #13394035
> ^ http://www.vogelsinger.at/
>
>
>
> --
> 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] problem with header

2003-01-30 Thread Chris Hayes

can it be related to the double slash in that path?
/usr/local/php/bin//php

At 15:42 30-1-2003, you wrote:

i have an script, it send a header response:






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




RE: [PHP] XML PHP question

2003-01-30 Thread Chris McCluskey
Hardik,

I have created my own XML parser based on the existing php xml functions
http://php.net/xml .  I've found this is nice but a bit annoying since I
have to write everything from scratch.  After about a week or two trying
to get my parser just right I gave up and used MSXML 4.0 which is a
Microsoft COM Object and contains everything you need to created XML
Documents, parse them, validate them agaisnt DTD and XSD Schemas, etc...
I use php's COM Support http://php.net/com to do this and created a
wrapper object around the COM object with php for easy implementation..

Hope that helps.

-Chris

-Original Message-
From: Hardik Doshi [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 30, 2003 7:17 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP] XML PHP question



Hi everyone,

Can you please tell me what is the best way of working with XML
technology using PHP? I am not clear about integration of these two
technologies. 

Suggest some books or links or good tutorials. 

thanks

Hardik Doshi
Web Application Developer
Chicago



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

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




[PHP] mySql session handler

2003-01-30 Thread R'twick Niceorgaw
Hi all,

Is it possible to setup a mysql session handler on a server basis (
something in php.ini file) so that individual pages do not have to set it up
using call to session_set_save_handler() ?

-R'twick



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




Re: [PHP] Using custom "button" form element instead of standard "submit"?

2003-01-30 Thread Durwood Gafford

"1lt John W. Holmes" <[EMAIL PROTECTED]> wrote in message
>
> If that's what you want, then just make each button a normal  link
> and pass an variable to the next page in the link (like someone has
already
> suggested). You'd get the same end result.
>
> 
> 
> 
> 
>
> print "The user selected button $sample\n";

Indeed this solution does appear to be the best in that it does not rely on
client-side scripting, it allows for control of the icon/button appearance,
and it allows direct access to the "value" associated with the selected
button.  I had hoped to use POST instead of GET, however -- i didn't want to
pass the information via the URL.

To make the issues more clear (assuming everyone's not totally burned out
thinking about this one), I will submit links to working, example code in a
followup post. I'm swamped with a proposal i'm working on for my 'day' job,
however -- so stay tuned.

thanks for all of the insights/assistance!

-Durwood



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




Re: [PHP] Reporting tools for PHP?

2003-01-30 Thread John Wells
Because Crystal Reports is an overpriced rip-off.  To get full web report
functionality, you have to pay anywhere from $1-$10 for their
enterprise edition.  If you pay anything less, you're limited to only
three connections.

Why buy anything when good open source solutions exist?  Makes no sense. 
Just support the OS projects...make a donation.

John

Tyler Lane said:
> On Thu, 2003-01-30 at 08:57, Denis L. Menezes wrote:
>> hello Friends?
>>
>> Is there any reporting toold for PNH/MySQL like there is Crystal
>> Reports etc?
> Do you mean PHP/MySQL?
>
> if that is the case, why not use Crystal Reports?
> Setup MyODBC for your MySQL server and use ODBC to connect to it using
> Crystal Reports.
>
>>
>> Thanks
>> denis
> --
> Tyler Lane
> [EMAIL PROTECTED]
>
> --
> 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] XML PHP question

2003-01-30 Thread Hardik Doshi

Hi Chris, 
Thanks for your nice reply. I would like to know what are the applications of XML with 
PHP. I know how to write and parse XML files but i dont know where can i use this 
power? Either you or any other member of this group can solve my problem then i would 
be thankful to him/her.
Again thanks for your positive response.
Hardik Doshi
Web Application Developer
Institute of Design,
Chicago IL 
 Chris McCluskey <[EMAIL PROTECTED]> wrote:Hardik,

I have created my own XML parser based on the existing php xml functions
http://php.net/xml . I've found this is nice but a bit annoying since I
have to write everything from scratch. After about a week or two trying
to get my parser just right I gave up and used MSXML 4.0 which is a
Microsoft COM Object and contains everything you need to created XML
Documents, parse them, validate them agaisnt DTD and XSD Schemas, etc...
I use php's COM Support http://php.net/com to do this and created a
wrapper object around the COM object with php for easy implementation..

Hope that helps.

-Chris

-Original Message-
From: Hardik Doshi [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 30, 2003 7:17 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP] XML PHP question



Hi everyone,

Can you please tell me what is the best way of working with XML
technology using PHP? I am not clear about integration of these two
technologies. 

Suggest some books or links or good tutorials. 

thanks

Hardik Doshi
Web Application Developer
Chicago



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

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



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


Re: [PHP] Reporting tools for PHP?

2003-01-30 Thread Tyler Lane
I didn't comment on the price of Crystal Reports. I was informing the
poster that it is possible to use Crystal Reports with mysql. 

As for using open source tools, I totally agree with using OpenSource
whenever possible.

On Thu, 2003-01-30 at 11:27, John Wells wrote:
> Because Crystal Reports is an overpriced rip-off.  To get full web report
> functionality, you have to pay anywhere from $1-$10 for their
> enterprise edition.  If you pay anything less, you're limited to only
> three connections.
> 
> Why buy anything when good open source solutions exist?  Makes no sense. 
> Just support the OS projects...make a donation.
> 
> John
> 
> Tyler Lane said:
> > On Thu, 2003-01-30 at 08:57, Denis L. Menezes wrote:
> >> hello Friends?
> >>
> >> Is there any reporting toold for PNH/MySQL like there is Crystal
> >> Reports etc?
> > Do you mean PHP/MySQL?
> >
> > if that is the case, why not use Crystal Reports?
> > Setup MyODBC for your MySQL server and use ODBC to connect to it using
> > Crystal Reports.
> >
> >>
> >> Thanks
> >> denis
> > --
> > Tyler Lane
> > [EMAIL PROTECTED]
> >
> > --
> > 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
-- 
Tyler Lane
[EMAIL PROTECTED]

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




[PHP] Re: Removing elements of multidimensional array

2003-01-30 Thread Erich C. Beyrent
> Hey everyone,
> 
> I am reading an ini file into an array using the parse_ini_file() function.  What I 
>want to do is delete a section from the ini file, and > thought that the best way to 
>do it would be to unset one of the keys in the array returned by the parse function.  
>I then want to > 
> write the modified array back out to the ini file.  I am having a hard time doing 
>the unset though - what am I missing?
> 
> * CODE *
> // Parse out the events file
>  $array = parse_ini_file('./data/events', TRUE);
>  while($key = key($array))
>  {
>   if ($key == $event)
>   {
>unset($key); 
>next($array);
>   }
>   else { next($array); }
>  }

> // This prints the contents of the array, and the value that I tried to unset is 
>still there...
>  print_r($array);
> 
> * END CODE *
> 
> Thanks!
> 
> -Erich-

Never mind.  I am SUCH a moron.

// This works just fine...
unset($array[$event]);  

-Erich-




[PHP] Removing elements of multidimensional array

2003-01-30 Thread Erich C. Beyrent
Hey everyone,

I am reading an ini file into an array using the parse_ini_file() function.  What I 
want to do is delete a section from the ini file, and thought that the best way to do 
it would be to unset one of the keys in the array returned by the parse function.  I 
then want to write the modified array back out to the ini file.  I am having a hard 
time doing the unset though - what am I missing?

* CODE *
// Parse out the events file
 $array = parse_ini_file('./data/events', TRUE);
 while($key = key($array))
 {
  if ($key == $event)
  {
   unset($key); 
   next($array);
  }
  else { next($array); }
 }

// This prints the contents of the array, and the value that I tried to unset is still 
there...
 print_r($array);

* END CODE *

Thanks!

-Erich-



[PHP] Sorting multidimensional arrays..

2003-01-30 Thread Chad Day
I'm struggling with array_multisort, was hoping someone could give me some
help.

I have a multidim array, such as:

$myarray[0][FIRSTNAME] = JOE
$myarray[1][FIRSTNAME] = TIM
$myarray[2][FIRSTNAME] = BOB

$myarray[0][LASTNAME] = SMITH
$myarray[1][LASTNAME] = BROWN
$myarray[2][LASTNAME] = JONES

$myarray[0][EXTENSION] = 2000
$myarray[1][EXTENSION] = 4000
$myarray[2][EXTENSION] = 1000

I was trying array_multisort($myarray[EXTENSION], SORT_NUMERIC, SORT_DESC),
but nothing seems to be happening to the array.  If anyone has any clues or
can point me in the right direction, I would appreciate it.

Thanks,
Chad


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




[PHP] PHP & Apache

2003-01-30 Thread Aaron Stephan William Boeren
Hi,
Maby you could help me on why I get this message when using variables: 
Undefined variable: UN1 in c:\inetpub\wwwroot\sdd\pages\redirection.php 
on line 15

I have PWS being used, PHP 4.3.0 & Apache 2.0.34. OS is Windows 2k
If you could help that would be great because I need it for testing 
scripts for my HSC Course.

See Ya,

Boz
PC's Rule!
Quote: "The brain can understand everything, but itself", Aaron Boeren, 
2002

*N**E***R**D***
Webpage: http://au.geocities.com/bozthepcnerd
Webpage: http://zeus.as.edu.au/~aboeren (not running)
*N**E***R**D***
Some good links: 
Moodle: http://zeus.as.edu.au/moodle
Up & ReparePC's: http://www.upgradingandreparingpcs.com/
Blizzar Entertainment: http://www.blizzard.com/
Samsung: http://www.samsung.com/
Intel: http://www.intel.com/
Microsoft Corp.: http://www.microsoft.com/
AMD: http://www.amd.com/
Google: http://www.google.com/
Apple: http://www.apple.com/
MACOSX: http://www.apple.com/macosx/
PHP: http://www.php.net/
HTML: http://hotwired.webmonkey.com/
HTML: http://au.geocities.com/bozthepcnerd/pages/html.html

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




[PHP] Re: PHP & Apache

2003-01-30 Thread Christoph Grottolo
[EMAIL PROTECTED] (Aaron Stephan William Boeren) wrote:

>Hi,
>Maby you could help me on why I get this message when using variables: 
>Undefined variable: UN1 in c:\inetpub\wwwroot\sdd\pages\redirection.php 
>on line 15
>
>I have PWS being used, PHP 4.3.0 & Apache 2.0.34. OS is Windows 2k
>If you could help that would be great because I need it for testing 
>scripts for my HSC Course.

Suppose you use PWS and not Apache (the path in the error seems to
point to a PWS directory). Anyway: The variable UN1 is not defined.
Maybe you could try to search for 'UN1' in
c:\inetpub\wwwroot\sdd\pages\redirection.php?

>Quote: "The brain can understand everything, but itself", Aaron Boeren, 

oh, there are certainly other cases...

Christoph

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




Re: [PHP] PHP & Apache

2003-01-30 Thread 1LT John W. Holmes
> Maby you could help me on why I get this message when using variables:
> Undefined variable: UN1 in c:\inetpub\wwwroot\sdd\pages\redirection.php
> on line 15

Because you have an undefined variable. You have a variable that has not
been assigned a value. Assign it a default value or use isset() in your
tests and this will go away.

> I have PWS being used, PHP 4.3.0 & Apache 2.0.34. OS is Windows 2k
> If you could help that would be great because I need it for testing
> scripts for my HSC Course.

Or look at error_reporting()

www.php.net/error_reporting

---John Holmes...


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




[PHP] Re: Installation & Configuration Question

2003-01-30 Thread Götz Lohmsnn
Mike At Spy schrieb:
> Has anyone ever had an issue where PHP, for whatever reason, stopped
> .htaccess files from working?
> 
> Thanks,
> 
> -Mike
> 
> 
maybe using reserved words in the .htaccess which belong to PHP ?
what is in the htacces ? sorry not enough informations to get a hint ...


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




Re: [PHP] Installation & Configuration Question

2003-01-30 Thread Paul Marinas
did you check php.ini file?


On Wed, 29 Jan 2003, Mike At Spy wrote:

>
> Has anyone ever had an issue where PHP, for whatever reason, stopped
> .htaccess files from working?
>
> Thanks,
>
> -Mike
>
>
>
> --
> 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] Send commands to a shell program

2003-01-30 Thread Antti
I want to for example give commands to mpg321 when it is executed with 
the -R option (remote control mode). Is this possible with exec() or 
other execute php functions. What I mean is to execute commands while 
being in a shell program. Hope you got it!

antti


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



[PHP] problems with include()

2003-01-30 Thread Daniel Negron/KBE
I have this code :



which works great from the root dir where  these files are stored. [all
content is showing properly]

If I move the file to its final destination, let say ...
http://root_dir/intranet/training/final_folder

I change the code to match



ALL I get is the Converted HTML printed on the screen.  I have tried many
variations of traversing the directories, but this does not seem to be
working.  Can anyone help ?


Thank you,

**DAN**


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




Re: [PHP] Re: Installation & Configuration Question

2003-01-30 Thread Paul Marinas
htacces it's use by apache when you whant to give distinct user privileges
to a certain directory, also uses htpasswd, etc.

more information you could find in apache documentation.

On Thu, 30 Jan 2003, [ISO-8859-1] Götz Lohmsnn wrote:

> Mike At Spy schrieb:
> > Has anyone ever had an issue where PHP, for whatever reason, stopped
> > .htaccess files from working?
> >
> > Thanks,
> >
> > -Mike
> >
> >
> maybe using reserved words in the .htaccess which belong to PHP ?
> what is in the htacces ? sorry not enough informations to get a hint ...
>
>
> --
> 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] mysq_connect()

2003-01-30 Thread Cesar Rodriguez
Hi there, my name is Cesar Rodriguez and I am trying to upgrade from Caldera
Linux Server 2.3 into RedHat Server 8.0. The problem I encounter is that
after testing different scripts, php is working, except when I make an MySQL
call like mysql_connect() or mysql_pconnect().
The call is as follows:

$link = mysql_connect('localhost', 'user1', 'passwd')
or exit();

mysql_select_db ('mydb')
or exit ();

$result = mysql_query ('SELECT COUNT(*) FROM clients')
or exit ();

if ($row = mysql_fetch_array ($result))
.  etc ..

The message I get is:

"Fatal error: Call to undefined function: mysql_pconnect() in
var/www/html/lesson/firsta.php"

Seems that PHP4 does not find the MySQL library. I checked php.ini and
httpd.conf files and everything is in its place apparently. I re-installed
everything from scratch with no positive result. I would appreciate advice
on this issue.

Thanks
Cesar Rodriguez



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




RE: [PHP] while loop- will this work?

2003-01-30 Thread Roedel, Mark
> -Original Message-
> From: SpyProductions Support Team [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, January 30, 2003 11:57 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] while loop- will this work?
> 
> 
> 
> 
> Should this work?

Nope...because the value returned by mysql_query() isn't the number of
rows returned by the query...it's a pointer to the result set (which
could be empty).
 
> $f1 = rand(999,999);
> 
>   while($check_sid = mysql_query("SELECT * FROM 
> that_table WHERE this =
> '$f1'")){
> 
>   $f1 = rand(999,999);
> 
> }

You'll want something more like...

  do {
$f1 = rand(999,);
$check_sid = mysql_query("SELECT * from that_table WHERE
this='$f1'"));
  } while (mysql_num_rows($check_sid))


---
Mark Roedel   | "The most overlooked advantage to owning a
Systems Programmer|  computer is that if they foul up there's no
LeTourneau University |  law against whacking them around a little."
Longview, Texas  USA  |-- Owen Porterfield

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




[PHP] Variable Fun

2003-01-30 Thread James E Hicks III
This code:
";
echo $test2."---".$test1."";
if ( $test2 != $test1){
echo ("The variables are not equal.");
}
?>
Produces the following output (Notice that it doesn't say vars are not equal);

string---string

02061030012451---02061030012452




And this code:
";
echo $test2."---".$test1."";
if ( $test2 != $test1){
echo ("The variables are not equal.");
}
?>
Produces the following output (Notice it printed the message about vars not
being equal);

string---string

02061030012451---02061030012452

The variables are not equal.


Why does PHP Version 4.2.3 ignore my (string) - cast to string in the if
evaluation?
I even tried putting the (string) inside the IF statement with no difference in
execution.


P.S.
The variables were reporting string before I even tried (string).


James E Hicks III


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




[PHP] HTML embedding

2003-01-30 Thread Todd Barr
Hello,

I am having an issue.  I am using an access database, where the names have
whitespace.

Now, when I try to generate a link within the php script I get just their
first name

But in the link itself I get the whole name

so the html link looks something like this

http://www.whatever.com/dave";>David Bruner

I am using an ODBC connection.

Thanks in advance for any help


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




Re: [PHP] HTML embedding

2003-01-30 Thread Andrew Brampton
Try urlencode your data before outputing it.
php.net/urlencode

Andrew
- Original Message -
From: "Todd Barr" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 30, 2003 10:11 PM
Subject: [PHP] HTML embedding


> Hello,
>
> I am having an issue.  I am using an access database, where the names have
> whitespace.
>
> Now, when I try to generate a link within the php script I get just their
> first name
>
> But in the link itself I get the whole name
>
> so the html link looks something like this
>
> http://www.whatever.com/dave";>David Bruner
>
> I am using an ODBC connection.
>
> Thanks in advance for any help
>
>
> --
> 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] HTML embedding

2003-01-30 Thread Chris Shiflett
--- Todd Barr <[EMAIL PROTECTED]> wrote:
> I am having an issue. I am using an access database,
> where the names have whitespace.
> 
> Now, when I try to generate a link within the php
> script I get just their first name
> 
> But in the link itself I get the whole name

So, you are talking about two things:

1. A link
2. The link itself

One works and one doesn't.

As a complete guess, look into URL encoding. I bet you are
trying to use a space in a URL.

Chris

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




Re: [PHP] Sorting multidimensional arrays..

2003-01-30 Thread Tim Ward
if 'EXTENSION' is unique then you can make life
a lot easier by making that the key of the root array
(this is a heirarchy of arrays).

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message -
From: Chad Day <[EMAIL PROTECTED]>
To: php general <[EMAIL PROTECTED]>
Sent: Thursday, January 30, 2003 7:29 PM
Subject: [PHP] Sorting multidimensional arrays..


> I'm struggling with array_multisort, was hoping someone could give me some
> help.
>
> I have a multidim array, such as:
>
> $myarray[0][FIRSTNAME] = JOE
> $myarray[1][FIRSTNAME] = TIM
> $myarray[2][FIRSTNAME] = BOB
>
> $myarray[0][LASTNAME] = SMITH
> $myarray[1][LASTNAME] = BROWN
> $myarray[2][LASTNAME] = JONES
>
> $myarray[0][EXTENSION] = 2000
> $myarray[1][EXTENSION] = 4000
> $myarray[2][EXTENSION] = 1000
>
> I was trying array_multisort($myarray[EXTENSION], SORT_NUMERIC,
SORT_DESC),
> but nothing seems to be happening to the array.  If anyone has any clues
or
> can point me in the right direction, I would appreciate it.
>
> Thanks,
> Chad
>
>
> --
> 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] Variable Fun

2003-01-30 Thread Jason Wong
On Friday 31 January 2003 05:55, James E Hicks III wrote:
> This code:
>  $var1 = "02061030012452";
> $var2 = "02061030012451";
> $test1 = (string) $var1
> $test2 = (string) $var2;
> echo gettype($test2)."---".gettype($test1)."";
> echo $test2."---".$test1."";
> if ( $test2 != $test1){
> echo ("The variables are not equal.");
> }
> ?>
> Produces the following output (Notice that it doesn't say vars are not
> equal);
> 
> string---string
>
> 02061030012451---02061030012452
>
> 

>
> And this code:
>  $var1 = "A"."02061030012452";
> $var2 = "A"."02061030012451";
> $test1 = (string) $var1
> $test2 = (string) $var2;
> echo gettype($test2)."---".gettype($test1)."";
> echo $test2."---".$test1."";
> if ( $test2 != $test1){
> echo ("The variables are not equal.");
> }
> ?>
> Produces the following output (Notice it printed the message about vars not
> being equal);
> 
> string---string
>
> 02061030012451---02061030012452
>
> The variables are not equal.
> 
>
> Why does PHP Version 4.2.3 ignore my (string) - cast to string in the if
> evaluation?
> I even tried putting the (string) inside the IF statement with no
> difference in execution.
>
>
> P.S.
> The variables were reporting string before I even tried (string).

String comparisons are best done using strcmp() or:

 if ($string1 === $string2) { echo "equal"; }

or

 if ($string1 !== $string2) { echo "not equal"; }

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Code like that would not pass through anybody's yuck-o-meter.

- Linus Torvalds about design on linux-kernel
*/


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




[PHP] Re: problems with include()

2003-01-30 Thread Al
Looks like you are only backing up 2 levels when you need 3.

Why not try something like:

$root= "the absolute path to your root folder";

Then simply:

include ($root . "mainfile.php");

etc.


Daniel Negron/Kbe wrote:

I have this code :



which works great from the root dir where  these files are stored. [all
content is showing properly]

If I move the file to its final destination, let say ...
http://root_dir/intranet/training/final_folder

I change the code to match



ALL I get is the Converted HTML printed on the screen.  I have tried many
variations of traversing the directories, but this does not seem to be
working.  Can anyone help ?


Thank you,

**DAN**




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




[PHP] php question - query string

2003-01-30 Thread Anthony Ritter
The following script is from Kevin Yank's book on page 59-60.  (Sitepoint)

I'd like to get some clarification about the line: (almost next to last line
in the script)

...
echo("Add a Joke!");



He has a link called "Add a Joke!".

When the user clicks on the link, the same page loads - with the form this
time - and the query string passes the value -1 - to the variable $addjoke.

Am I on the right track?

If so, why does 1 - as opposed to 2 or something else - have to be the
name/value pair if the user is adding another joke?

Thank you.
TR
..



 The Internet Joke Database 





Type your joke here:




Unable to connect to the " .
"database server at this time." );
  exit();
}

// Select the jokes database
if (! @mysql_select_db("jokes") ) {
  echo( "Unable to locate the joke " .
"database at this time." );
  exit();
}

// If a joke has been submitted,
// add it to the database.
if ($submitjoke == "SUBMIT") {
  $sql = "INSERT INTO Jokes SET
  JokeText='$joketext',
  JokeDate=CURDATE()";
  if (@mysql_query($sql)) {
echo("Your joke has been added.");
  } else {
echo("Error adding submitted joke: " .
 mysql_error() . "");
  }
}

echo(" Here are all the jokes in our database: ");

// Request the text of all the jokes
$result = @mysql_query("SELECT JokeText FROM Jokes");
if (!$result) {
  echo("Error performing query: " . mysql_error() . "");
  exit();
}

// Display the text of each joke in a paragraph
while ( $row = mysql_fetch_array($result) ) {
  echo("" . $row["JokeText"] . "");
}

// When clicked, this link will load this page
// with the joke submission form displayed.
echo("Add a Joke!");

  endif;

?>



--





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




[PHP] php as shell script

2003-01-30 Thread David H
Hi,

I am trying to run php as shell script. I have this:

helloworld.php:



I run 

php helloworld.php

then I got this:

Hello World.
Fatal error: Nesting level too deep - recursive
dependency? in Unknown on line 0

I am using Redhat 8, anyone knows what is the problem
is?

Thanks,
David

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] Re: php question - query string

2003-01-30 Thread Philip Hallstrom
You've got it right... look at the man page for parse_str() for more info
on the QUERY_STRING stuff as well as the register_globals configuration
option.

Looking at the script below, there is nothing special about setting
$addjoke to 1.  It's just important that it is set to *something* (because
of the isset($addjoke) call.  You could set it to whatever you want, but
setting it to 1 is commonly done to indicate "trueness" or "it's on".

You could set it to "yes" if you wanted and the script would work the
same.

Hope this helps.

-philip

On Thu, 30 Jan 2003, Anthony Ritter wrote:

> The following script is from Kevin Yank's book on page 59-60.  (Sitepoint)
>
> I'd like to get some clarification about the line: (almost next to last line
> in the script)
>
> ...
> echo("Add a Joke!");
> 
>
>
> He has a link called "Add a Joke!".
>
> When the user clicks on the link, the same page loads - with the form this
> time - and the query string passes the value -1 - to the variable $addjoke.
>
> Am I on the right track?
>
> If so, why does 1 - as opposed to 2 or something else - have to be the
> name/value pair if the user is adding another joke?
>
> Thank you.
> TR
> ..
>
> 
> 
>  The Internet Joke Database 
> 
> 
>if (isset($addjoke)): // If the user wants to add a joke
> ?>
>
> 
> Type your joke here:
> 
> 
> 
>
>else: // Default page display
>
> // Connect to the database server
> $dbcnx = @mysql_connect("localhost", "root", "mypasswd");
> if (!$dbcnx) {
>   echo( "Unable to connect to the " .
> "database server at this time." );
>   exit();
> }
>
> // Select the jokes database
> if (! @mysql_select_db("jokes") ) {
>   echo( "Unable to locate the joke " .
> "database at this time." );
>   exit();
> }
>
> // If a joke has been submitted,
> // add it to the database.
> if ($submitjoke == "SUBMIT") {
>   $sql = "INSERT INTO Jokes SET
>   JokeText='$joketext',
>   JokeDate=CURDATE()";
>   if (@mysql_query($sql)) {
> echo("Your joke has been added.");
>   } else {
> echo("Error adding submitted joke: " .
>  mysql_error() . "");
>   }
> }
>
> echo(" Here are all the jokes in our database: ");
>
> // Request the text of all the jokes
> $result = @mysql_query("SELECT JokeText FROM Jokes");
> if (!$result) {
>   echo("Error performing query: " . mysql_error() . "");
>   exit();
> }
>
> // Display the text of each joke in a paragraph
> while ( $row = mysql_fetch_array($result) ) {
>   echo("" . $row["JokeText"] . "");
> }
>
> // When clicked, this link will load this page
> // with the joke submission form displayed.
> echo("Add a Joke!");
>
>   endif;
>
> ?>
> 
> 
>
> --
>
>
>
>
>
> --
> 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] php question - query string

2003-01-30 Thread Lowell Allen
Although you don't show it in your snippet of code, the script in question
starts with:

if (isset($addjoke)): // If the user wants to add a joke

So all he's doing is setting the variable $addjoke. It could have been set
to 2 or something else, although 1 kind of makes more sense because it's
associated with "true" (as 0 is associated with "false").

--
Lowell Allen

> From: "Anthony Ritter" <[EMAIL PROTECTED]>
> Date: Thu, 30 Jan 2003 18:30:28 -0500
> To: [EMAIL PROTECTED]
> Subject: [PHP] php question - query string
> 
> The following script is from Kevin Yank's book on page 59-60.  (Sitepoint)
> 
> I'd like to get some clarification about the line: (almost next to last line
> in the script)
> 
> 
> echo("Add a Joke!");
> .
> 
> 
> He has a link called "Add a Joke!".
> 
> When the user clicks on the link, the same page loads - with the form this
> time - and the query string passes the value -1 - to the variable $addjoke.
> 
> Am I on the right track?
> 
> If so, why does 1 - as opposed to 2 or something else - have to be the
> name/value pair if the user is adding another joke?
> 
> Thank you.
> TR
> ...
> 
> 
> 
>  The Internet Joke Database 
> 
> 
>  if (isset($addjoke)): // If the user wants to add a joke
> ?>
> 
> 
> Type your joke here:
> 
> 
> 
> 
>  else: // Default page display
> 
> // Connect to the database server
> $dbcnx = @mysql_connect("localhost", "root", "mypasswd");
> if (!$dbcnx) {
> echo( "Unable to connect to the " .
> "database server at this time." );
> exit();
> }
> 
> // Select the jokes database
> if (! @mysql_select_db("jokes") ) {
> echo( "Unable to locate the joke " .
> "database at this time." );
> exit();
> }
> 
> // If a joke has been submitted,
> // add it to the database.
> if ($submitjoke == "SUBMIT") {
> $sql = "INSERT INTO Jokes SET
> JokeText='$joketext',
> JokeDate=CURDATE()";
> if (@mysql_query($sql)) {
> echo("Your joke has been added.");
> } else {
> echo("Error adding submitted joke: " .
> mysql_error() . "");
> }
> }
> 
> echo(" Here are all the jokes in our database: ");
> 
> // Request the text of all the jokes
> $result = @mysql_query("SELECT JokeText FROM Jokes");
> if (!$result) {
> echo("Error performing query: " . mysql_error() . "");
> exit();
> }
> 
> // Display the text of each joke in a paragraph
> while ( $row = mysql_fetch_array($result) ) {
> echo("" . $row["JokeText"] . "");
> }
> 
> // When clicked, this link will load this page
> // with the joke submission form displayed.
> echo("Add a Joke!");
> 
> endif;
> 
> ?>
> 
> 
> 
> --
> 
> 
> 
> 
> 
> -- 
> 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] php as shell script

2003-01-30 Thread Khalid El-Kary
maybe, but not sure, you need to replace "


Hi,

I am trying to run php as shell script. I have this:

helloworld.php:



I run

php helloworld.php

then I got this:

Hello World.
Fatal error: Nesting level too deep - recursive
dependency? in Unknown on line 0

I am using Redhat 8, anyone knows what is the problem
is?

Thanks,
David

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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



_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


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



[PHP] PHP Compile Error

2003-01-30 Thread Robert Fitzpatrick
Running Redhat 8.0
PHP 4.3.0

When I try to configure with the following:
./configure --with-apxs=/web_root/bin/apxs --enable-track-vars
--enable-versioning --with-mysql=/usr/mysql --with-gd=/usr/local
--with-jpeg-dir=/usr/local/bin/  --with-png-dir=/usr/lib
--with-zlib-dir=/usr/lib --with-zlib --enable-xslt --enable-cli
--disable-debug --with-xslt-sablot

I get the following error:
...
configure: error: libjpeg.(a|so) not found.

Any ideas?

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




  1   2   >