|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Thu Jan 30 2003 - 16:48:19 CST
php-general Digest 30 Jan 2003 22:48:19 -0000 Issue 1854
Topics (messages 133622 through 133705):
SQLqry in PHP
133622 by: Per
133625 by: Chris Hayes
133630 by: Jon Haworth
133642 by: Jon Haworth
Re: quick question
133623 by: John W. Holmes
Re: Context
133624 by: John W. Holmes
Re: Problem with xml_parse_into_struct
133626 by: John W. Holmes
Re: Using custom "button" form element instead of standard "submit"?
133627 by: Durwood Gafford
133628 by: Chris Hayes
133631 by: Ernest E Vogelsinger
133632 by: Philip Olson
133634 by: Ernest E Vogelsinger
133636 by: Durwood Gafford
133637 by: Ernest E Vogelsinger
133638 by: John W. Holmes
133682 by: Durwood Gafford
Re: Email being blocked
133629 by: Ben
133633 by: Timothy Hitchens \(HiTCHO\)
133644 by: Ben
Passing Object Refs throught Arrays
133635 by: James
133656 by: Tom Rogers
PHP --with-imap on Cobalt RaQ with Stackguard IMAP
133639 by: Götz Lohmann
php.net links page question
133640 by: dan
133643 by: Maxim Maletsky
Re: ftp_ssl_connect
133641 by: Markus Boettger
Encryption using MMCrypt - whats the point?
133645 by: Mike Morton
133647 by: Jason Sheets
133648 by: Lowell Allen
133650 by: Adam Voigt
133651 by: Mike Morton
133653 by: Adam Voigt
problem with header
133646 by: Martin
133678 by: Chris Hayes
Re: Best PHP db wrapper?
133649 by: Manuel Lemos
Advanced PHP Debugger
133652 by: Fredrik Johansson
XML PHP question
133654 by: Hardik Doshi
133657 by: Manuel Lemos
133679 by: Chris McCluskey
133684 by: Hardik Doshi
$HTTP_USER_AGENT
133655 by: Jan Mikes
133658 by: Ford, Mike [LSS]
133661 by: Jan Mikes
133662 by: Chris Shiflett
MySQL - setting relationships
133659 by: Denis L. Menezes
133668 by: Larry E. Ullman
Reporting tools for PHP?
133660 by: Denis L. Menezes
133665 by: John Wells
133669 by: Tyler Lane
133674 by: Mark McCulligh
133683 by: John Wells
133685 by: Tyler Lane
HTTP_GET_VARS[]
133663 by: Mike Tuller
133664 by: Matt Schroebel
133666 by: Mike Tuller
133673 by: Matt Schroebel
PHP - mysql_info question
133667 by: Mark McCulligh
Re: Adding HTTP URL Code
133670 by: ELLIOTT,KATHERINE A (HP-FtCollins,ex1)
while loop- will this work?
133671 by: SpyProductions Support Team
133675 by: Matt Schroebel
133698 by: Roedel, Mark
Mysterious gap
133672 by: Lightfirst
133676 by: Jason Wong
Re: content type header for downloading files
133677 by: Sascha Braun
Re: [PHP-WIN] Register globals on and off
133680 by: Dash McElroy
mySql session handler
133681 by: R'twick Niceorgaw
Re: Removing elements of multidimensional array
133686 by: Erich C. Beyrent
133687 by: Erich C. Beyrent
Sorting multidimensional arrays..
133688 by: Chad Day
133703 by: Tim Ward
PHP & Apache
133689 by: Aaron Stephan William Boeren
133690 by: Christoph Grottolo
133691 by: John W. Holmes
Re: Installation & Configuration Question
133692 by: Götz Lohmann
133693 by: Paul Marinas
133696 by: Paul Marinas
Send commands to a shell program
133694 by: Antti
problems with include()
133695 by: Daniel Negron/KBE
133705 by: Al
mysq_connect()
133697 by: Cesar Rodriguez
Variable Fun
133699 by: James E Hicks III
133704 by: Jason Wong
HTML embedding
133700 by: Todd Barr
133701 by: Andrew Brampton
133702 by: Chris Shiflett
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
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)
attached mail follows:
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
attached mail follows:
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
attached mail follows:
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
attached mail follows:
> 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...
attached mail follows:
> 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 :
>
> <?php $php_tags = "PHP Tags" ?>
> Combining HTML output and
> <?php echo $php_tags; ?>
> tags really wastes my time.
>
> Runs "slightly" faster than
>
> <?php
> $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/
attached mail follows:
> >I have various XML files that might contain <> tags inside the
element
> body, for example:
> >
> ><news id="1" shortDescription="Stuff Happened Today">Today on
> <b>1/29/03</b>, stuff happened</news>
> >
> Your XML is not well formed, not properly nested use:
>
> <news id="1" shortDescription="Stuff Happened Today"><![CDATA[Today on
> <b>1/29/03</b>, stuff happened]]></news>
>
> This way the XML parser wil accept <b> and </b>, 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/
attached mail follows:
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" <philip
cornado.com> wrote in message
news:Pine.BSF.4.10.10301300503280.83137-100000
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
>
>
attached mail follows:
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.
attached mail follows:
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]--------------------
???
<input type="submit" name="sample_a">
<input type="image" name="sample_b" src="myimg.gif">
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/
attached mail follows:
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
attached mail follows:
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/
attached mail follows:
> <input type="submit" name="sample_a"> > <input type="image" name="sample_b" src="myimg.gif"> > > 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.
<input type="submit" name="sample" value="a" > <input type="submit" name="sample" value="b" > <input type="submit" name="sample" value="c" > <input type="submit" name="sample" value="d" >
your php form handler can now simply do:
print "The user selected button $sample<br>\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!
attached mail follows:
At 13:37 30.01.2003, Durwood Gafford spoke out and said: --------------------[snip]-------------------- ><input type="submit" name="sample" value="a" > ><input type="submit" name="sample" value="b" > ><input type="submit" name="sample" value="c" > ><input type="submit" name="sample" value="d" > > >your php form handler can now simply do: > >print "The user selected button $sample<br>\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:
<form name="myform"> <input type="hidden" name="button" value="">
... something here
<input type="image" src="img_1.gif" onClick="document.forms['myform']['button'].value='button_a'"><br> <input type="image" src="img_2.gif" onClick="document.forms['myform']['button'].value='button_b'"><br> <input type="image" src="img_3.gif" onClick="document.forms['myform']['button'].value='button_c'"> </form>
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/
attached mail follows:
> At 13:37 30.01.2003, Durwood Gafford spoke out and said: > --------------------[snip]-------------------- > ><input type="submit" name="sample" value="a" > > ><input type="submit" name="sample" value="b" > > ><input type="submit" name="sample" value="c" > > ><input type="submit" name="sample" value="d" > > > > >your php form handler can now simply do: > > > >print "The user selected button $sample<br>\n")
If that's what you want, then just make each button a normal <a href> link and pass an variable to the next page in the link (like someone has already suggested). You'd get the same end result.
<a href="page.php?sample=a"><img></a> <a href="page.php?sample=b"><img></a> <a href="page.php?sample=c"><img></a> <a href="page.php?sample=d"><img></a>
print "The user selected button $sample<br>\n";
---John Holmes...
attached mail follows:
"1lt John W. Holmes" <holmes072000
charter.net> wrote in message
>
> If that's what you want, then just make each button a normal <a href> link
> and pass an variable to the next page in the link (like someone has
already
> suggested). You'd get the same end result.
>
> <a href="page.php?sample=a"><img></a>
> <a href="page.php?sample=b"><img></a>
> <a href="page.php?sample=c"><img></a>
> <a href="page.php?sample=d"><img></a>
>
> print "The user selected button $sample<br>\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
attached mail follows:
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" <la
lowellallen.com> wrote in message
news:BA5D9A9F.12ABB%la
lowellallen.com...
> > From: "Ben" <wdesign
petromedia.co.uk>
> >
> [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
> >
> > test
mysite.com is fine
> > test
someothersite.com 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: <http://www.php.net/manual/en/ref.mail.php>
>
> --
> Lowell Allen
>
attached mail follows:
The box does have a default route to get out of your network I trust??
Timothy Hitchens (HiTCHO)
Web Application Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: Ben [mailto:wdesign
petromedia.co.uk]
> Sent: Thursday, 30 January 2003 9:45 PM
> To: php-general
lists.php.net
> 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" <la
lowellallen.com> wrote in message
news:BA5D9A9F.12ABB%la
lowellallen.com...
> > From: "Ben" <wdesign
petromedia.co.uk>
> >
> [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
> >
> > test
mysite.com is fine
> > test
someothersite.com 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: <http://www.php.net/manual/en/ref.mail.php> > > -- > Lowell Allen >
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
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 )" <hitcho
php.net> wrote in message
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: tim
hitcho.com.au
>
> > -----Original Message-----
> > From: Ben [mailto:wdesign
petromedia.co.uk]
> > Sent: Thursday, 30 January 2003 9:45 PM
> > To: php-general
lists.php.net
> > 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" <la
lowellallen.com> wrote in message
> news:BA5D9A9F.12ABB%la
lowellallen.com...
> > > From: "Ben" <wdesign
petromedia.co.uk>
> > >
> > [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
> > >
> > > test
mysite.com is fine
> > > test
someothersite.com 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: <http://www.php.net/manual/en/ref.mail.php>
> >
> > --
> > Lowell Allen
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
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);
attached mail follows:
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
attached mail follows:
Hi,
I took me a long time to compile PHP with IMAP Support, but solve this, so here is a solution:
If you have a Cobalt with latest Patches, then you have an StackGuard version of IMAP wich won't compile with the default gcc
first you need:
RaQ4-All-Security-2.0.1-13323.pkg using wget from ftp.cobalt.sun.com (which includes the gcc for the cobalt)
gcc-2.7.2.3-11SG.i386.rpm from http://www.cse.ogi.edu/DISC/projects/immunix/StackGuard/
now get rid of the new gcc without StackGuard
rpm -e gcc-c++-2.95.3-1c1r4 \ gcc-chill-2.95.3-1c1r4 \ gcc-g77-2.95.3-1c1r4 \ gcc-java-2.95.3-1c1r4 \ gcc-objc-2.95.3-1c1r4 \ gcc-2.95.3-1c1r4
and install that from StackGuard
rpm -Uvh gcc-2.7.2.3-11SG.i386.rpm
now go and do a
./configure --prefix=/usr \ --enable-magic-quotes \ --enable-mbstr-enc-trans \ --enable-mbstring \ --enable-mm=shared \ --enable-calendar \ --enable-dba \ --enable-dbase \ --enable-dbx \ --enable-ftp \ --enable-gd-native-ttf \ --enable-inline-optimization \ --enable-safe-mode \ --enable-track-vars \ --enable-trans-sid \ --enable-wddx=shared \ --enable-xml \ --disable-debug \ --with-apxs=/usr/sbin/apxs \ --with-config-file-path=/etc/httpd \ --with-curl=shared \ --with-dba \ --with-db3=/usr/include/ \ --with-exec-dir=/usr/bin \ --with-flatfile \ --with-gd \ --with-gettext=/usr \ --with-gdbm \ --with-imap=shared,/usr/lib \ --with-imap-ssl \ --with-interbase=shared \ --with-jpeg-dir=/usr/lib \ --with-kerberos \ --with-ldap=shared \ --with-libdir=/usr/lib \ --with-mbstr-enc-trans \ --with-mbstring \ --with-ming \ --with-mysql \ --with-pdflib=shared \ --with-png-dir=/usr/lib \ --with-pgsql=shared \ --with-regex=system \ --with-ttf=/usr/include/freetype \ --with-tiff-dir=/usr/lib \ --with-zlib \ --with-xpm-dir=/usr/lib
or whatever you need ... and finish this with
make
you got it ... now same way backwards remove the gcc from Stackguard with rpm -e gcc-2.7.2.3-11SG
to get the rpms out of the cobalt pkg just rename it to *.tar.gz and open it with the mc (MidnightCommander) and copy all the gcc files to /tmp ... install them ...
ready to go ;-)
PS: All this info is without warranty !!! Don't wheep if you crash your Cobalt ... if you have questions ask me personaly to prevent OT in this list
attached mail follows:
i would like to suggest a link for the php.net links page, how would i go about doing that?
attached mail follows:
mail it to webmaster
php.net
-- Maxim Maletsky maximphp.net
dan <zan
stargeek.com> 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 >
attached mail follows:
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. >
attached mail follows:
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 :)
-- CheersMike 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
attached mail follows:
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
attached mail follows:
Could you use the Zend Encoder to encrypt the PHP script? <http://www.zend.com/store/products/zend-safeguard-suite.php>
-- Lowell Allen> From: Mike Morton <mike
dxstorm.com> > Date: Thu, 30 Jan 2003 09:30:36 -0500 > To: <php-general
lists.php.net> > 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 >
attached mail follows:
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 (adamcryptocomm.com) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQA+OTzLF9k9BmZXCWYRArk8AJsGOs0zD2hIyLwzDNK4PIx8YtOfuwCfTaoy 6kfdtASB8fw3y9cxtG2sCmI=gPoP -----END PGP SIGNATURE-----
attached mail follows:
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" <adam
cryptocomm.com> 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 :)
>
>
>
-- CheersMike 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
attached mail follows:
Granted, the +ACQ-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 +ACQ-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+ACU free.
On Thu, 2003-01-30 at 10:03, Mike Morton wrote:
Adam/Lowell: Thanks for the suggestions +IBM but like all clients +IBM they want maximum function for minimum +ACQAJA - encoders are therefore not a possibility (but I will keep that in mind for future apps :)) Thanks. On 1/30/03 9:55 AM, +ACI-Adam Voigt+ACI +ADw-adam+AEA-cryptocomm.com+AD4 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: +ACQ-key +AD0 +ACI-this is a secret key+ACIAOw +ACQ-input +AD0 +ACI-Let us meet at 9 o'clock at the secret place.+ACIAOw +ACQ-iv +AD0 mcrypt+AF8-create+AF8-iv (mcrypt+AF8-get+AF8-iv+AF8-size (MCRYPT+AF8-RIJNDAEL+AF8-256, MCRYPT+AF8-MODE+AF8-CBC), MCRYPT+AF8-RAND)+ADs +ACQ-encrypted+AF8-data +AD0 base64+AF8-encode(+AEA-mcrypt+AF8-encrypt (MCRYPT+AF8-RIJNDAEL+AF8-256 , +ACQ-key, +ACQ-input, MCRYPT+AF8-MODE+AF8-CBC,+ACQ-iv))+ADs 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 +ACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACo +ACo +ACo E-Commerce for Small Business +ACo http://www.dxstorm.com +ACo +ACo DXSTORM.COM +ACo 824 Winston Churchill Blvd, +ACo Oakville, ON, CA L6J 7X2 +ACo Tel: 905-842-8262 +ACo Fax: 905-842-3255 +ACo Toll Free: 1-877-397-8676 +ACo +ACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACo +ACI-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.+ACI - 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 (adam+AEA-cryptocomm.com) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam+AF8-at+AF8-cryptocomm.asc
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQA+OT6rF9k9BmZXCWYRAiKmAJ9ynQ2HlrtpVnmHy0qtAQK8swt0wQCfe4s0 dPz0TDB65AegolIxJMkfukQ=SFyo -----END PGP SIGNATURE-----
attached mail follows:
i have an script, it send a header response:
<?php header ("HTTP/1.1 206 Partial content"); .....
it works fine im my server on windows2000 as apache module, but doesn´t work in my apache cgi on internet (linux). The following error appears when i run the script.
[Wed Jan 29 11:07:18 2003] [error] [client 200.43.42.120] malformed header from script. Bad header=HTTP/1.1 206 Partial content: /usr/local/php/bin//php
Somebody know how i can make it works. Thanks, Martin
attached mail follows:
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 >header ("HTTP/1.1 206 Partial content"); >..... > >it works fine im my server on windows2000 as apache module, but doesn´t work >in my apache cgi >on internet (linux). The following error appears when i run the script. > > >[Wed Jan 29 11:07:18 2003] [error] [client 200.43.42.120] malformed header >from script. Bad header=HTTP/1.1 206 Partial content: >/usr/local/php/bin//php > >Somebody know how i can make it works. >Thanks, Martin
attached mail follows:
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:
--Regards, Manuel Lemos
attached mail follows:
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
attached mail follows:
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
attached mail follows:
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
attached mail follows:
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:php_hardik
yahoo.com]
Sent: Thursday, January 30, 2003 7:17 AM
To: php-general
lists.php.net
Cc: doshhar
iit.edu
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
attached mail follows:
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 <chris
modulusgroup.com> 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:php_hardik
yahoo.com]
Sent: Thursday, January 30, 2003 7:17 AM
To: php-general
lists.php.net
Cc: doshhar
iit.edu
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
attached mail follows:
hi all,
do anyone know where I can get a full list of $HTTP_USER_AGENT strings ??
thanx a lot
mtg
attached mail follows:
> -----Original Message-----
> From: Jan Mikes [mailto:mtg
generace.cz]
> 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: m.ford
lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
exactly what I needed
thank you mtg
----- Original Message -----
From: "Ford, Mike [LSS]" <M.Ford
lmu.ac.uk>
To: "'Jan Mikes'" <mtg
generace.cz>; <php-general
lists.php.net>
Sent: Thursday, January 30, 2003 4:46 PM
Subject: RE: [PHP] $HTTP_USER_AGENT
> > -----Original Message-----
> > From: Jan Mikes [mailto:mtg
generace.cz]
> > 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: m.ford
lmu.ac.uk
> 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
>
>
attached mail follows:
--- Jan Mikes <mtg
generace.cz> wrote:
> do anyone know where I can get a full list of
> $HTTP_USER_AGENT strings ??
There is no such thing.
Chris
attached mail follows:
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
attached mail follows:
> 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
attached mail follows:
hello Friends?
Is there any reporting toold for PNH/MySQL like there is Crystal Reports etc?
Thanks denis
attached mail follows:
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
attached mail follows:
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 tlanelyrical.net
attached mail follows:
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" <menezesd
singnet.com.sg> wrote in message
news:001501c2c878$4ee1b240$642a7dcb
pcdenisxp...
hello Friends?
Is there any reporting toold for PNH/MySQL like there is Crystal Reports etc?
Thanks denis
attached mail follows:
Because Crystal Reports is an overpriced rip-off. To get full web report functionality, you have to pay anywhere from $10000-$100000 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
> tlane
lyrical.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
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 $10000-$100000 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
> > tlane
lyrical.net
> >
> > --
> > 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 tlanelyrical.net
attached mail follows:
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
attached mail follows:
> -----Original Message-----
> From: Mike Tuller [mailto:php
ce.anoka.k12.mn.us]
> 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.
attached mail follows:
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:php
ce.anoka.k12.mn.us]
>> 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.
>
>
attached mail follows:
> >> $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.
attached mail follows:
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.
attached mail follows:
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:katherine.elliott
hp.com]
Sent: Thursday, January 16, 2003 10:54 AM
To: 'php-general
lists.php.net'
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://)([^]]*)", "<a href \"http=\\0\">\\0</a>", $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:php-general
gremlins.biz]
Sent: Wednesday, January 08, 2003 2:05 PM
To: php-general
lists.php.net
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
attached mail follows:
Should this work?
$f1 = rand(999,99999999999);
while($check_sid = mysql_query("SELECT * FROM that_table WHERE this = '$f1'")){
$f1 = rand(999,99999999999);
}
i.e. put the random number in a loop to check and make sure it is already not in use?
Thanks,
-Mike
attached mail follows:
> -----Original Message-----
> From: SpyProductions Support Team [mailto:support
spyproductions.com]
> Sent: Thursday, January 30, 2003 12:57 PM
> To: php-general
lists.php.net
> Subject: [PHP] while loop- will this work?
>
>
>
>
> Should this work?
>
> $f1 = rand(999,99999999999);
>
> while($check_sid = mysql_query("SELECT * FROM
> that_table WHERE this =
> '$f1'")){
>
> $f1 = rand(999,99999999999);
>
> }
>
>
> 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.
attached mail follows:
> -----Original Message-----
> From: SpyProductions Support Team [mailto:support
spyproductions.com]
> Sent: Thursday, January 30, 2003 11:57 AM
> To: php-general
lists.php.net
> 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,99999999999); > > while($check_sid = mysql_query("SELECT * FROM > that_table WHERE this = > '$f1'")){ > > $f1 = rand(999,99999999999); > > }
You'll want something more like...
do { $f1 = rand(999,99999999); $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
attached mail follows:
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
<?php
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?????? <table width="100%" border="1"> <?php while($query_data = mysql_fetch_array($result)) { ?> <form name="update" method="post" action="<?php echo $PHP_SELF?>"> <input type="hidden" name="op" value ="func1"> <?php $q = $query_data ["info"]; ?> <TR><TD WIDTH="100%" ALIGN="CENTER"><?php echo"$q";?></TD></TR> </form> <? } ?> </table> <? } switch ($op) { default: func1(); break; } ?>
attached mail follows:
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
>
> <?php
> 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??????
> <table width="100%" border="1">
> <?php
> while($query_data = mysql_fetch_array($result)) { ?>
> <form name="update" method="post" action="<?php echo $PHP_SELF?>">
> <input type="hidden" name="op" value ="func1">
> <?php
> $q = $query_data ["info"]; ?>
> <TR><TD WIDTH="100%" ALIGN="CENTER"><?php echo"$q";?></TD></TR>
> </form>
> <? } ?>
> </table>
> <? }
> switch ($op) {
> default:
> func1(); break;
> }
> ?>
Put your <FORM> inside the table cells (ie in between <td> & </td>).
-- 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. */
attached mail follows:
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" <ernest
vogelsinger.at>
To: "Dara Dowd" <daradowd
campus.ie>
Cc: <shiflett
php.net>; <php-general
lists.php.net>
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 >
attached mail follows:
Yes. Either via a .htaccess file or in your httpd.conf in a Directory entry put this:
php_value register_globals on
See the following URL's for more info:
http://www.php.net/manual/en/configuration.changes.php http://www.php.net/manual/en/function.ini-set.php
-Dash
AQUARIUS (Jan 20 - Feb 18) You have an inventive mind and are inclined to be progressive. You lie a great deal. On the other hand, you are inclined to be careless and impractical, causing you to make the same mistakes over and over again. People think you are stupid.
On Thu, 30 Jan 2003, Davy Obdam wrote:
> Hello people,
>
> On my development machine (win XP/Apache 2.0.44/PHP 4.3.0/MySQL 3.23.55)
> i have several websites that i made some time ago that require register
> globals to be On in the php.ini. Ofcourse i know thats not a good idea
> at all for security, but rewriting all this code is not an option.
> However in my php.ini i have set register globals to Off because that
> better. Is it possible to configure my webserver/php so that only those
> sites that require register globals to be On have that setting, for
> instance in a .htacces file?? Any help is appreciated:-)
>
> Best regards,
>
> Davy Obdam
> mailto:info
davyobdam.com
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
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
attached mail follows:
> 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-
attached mail follows:
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-
attached mail follows:
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
attached mail follows:
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:timward
chessish.com
----- Original Message -----
From: Chad Day <cday
atpco.com>
To: php general <php-general
lists.php.net>
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 > >
attached mail follows:
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
attached mail follows:
aboeren
as.edu.au (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
attached mail follows:
> 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...
attached mail follows:
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 ...
attached mail follows:
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 >
attached mail follows:
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 >
attached mail follows:
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
attached mail follows:
I have this code :
<?php
if(!isset($mainfile)) { include("mainfile.php"); } include("open_session.php"); include('config.php'); include ('header.php');
Coverted html in here.
include ('footer.php');
?>
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
<?php
if(!isset($mainfile)) { include("../../mainfile.php"); } include("../../open_session.php"); include('../../config.php'); include ('../../header.php');
Coverted html in here.
include ('../../footer.php');
?>
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**
attached mail follows:
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 : > > <?php > > if(!isset($mainfile)) > { > include("mainfile.php"); > } > include("open_session.php"); > include('config.php'); > include ('header.php'); > > Coverted html in here. > > include ('footer.php'); > > ?> > > 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 > > <?php > > if(!isset($mainfile)) > { > include("../../mainfile.php"); > } > include("../../open_session.php"); > include('../../config.php'); > include ('../../header.php'); > > Coverted html in here. > > include ('../../footer.php'); > > ?> > > 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** >
attached mail follows:
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
attached mail follows:
This code: <? $var1 = "020610000030012452"; $var2 = "020610000030012451"; $test1 = (string) $var1 $test2 = (string) $var2; echo gettype($test2)."---".gettype($test1)."<BR><BR>"; echo $test2."---".$test1."<BR><BR>"; 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
020610000030012451---020610000030012452
--------------------------------------------------------------------
And this code: <? $var1 = "A"."020610000030012452"; $var2 = "A"."020610000030012451"; $test1 = (string) $var1 $test2 = (string) $var2; echo gettype($test2)."---".gettype($test1)."<BR><BR>"; echo $test2."---".$test1."<BR><BR>"; 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
020610000030012451---020610000030012452
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
attached mail follows:
On Friday 31 January 2003 05:55, James E Hicks III wrote: > This code: > <? > $var1 = "020610000030012452"; > $var2 = "020610000030012451"; > $test1 = (string) $var1 > $test2 = (string) $var2; > echo gettype($test2)."---".gettype($test1)."<BR><BR>"; > echo $test2."---".$test1."<BR><BR>"; > 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 > > 020610000030012451---020610000030012452 > > --------------------------------------------------------------------
> > And this code: > <? > $var1 = "A"."020610000030012452"; > $var2 = "A"."020610000030012451"; > $test1 = (string) $var1 > $test2 = (string) $var2; > echo gettype($test2)."---".gettype($test1)."<BR><BR>"; > echo $test2."---".$test1."<BR><BR>"; > 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 > > 020610000030012451---020610000030012452 > > 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 */
attached mail follows:
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
<a href="http://www.whatever.com/dave">David Bruner</a>
I am using an ODBC connection.
Thanks in advance for any help
attached mail follows:
Try urlencode your data before outputing it. php.net/urlencode
Andrew
----- Original Message -----
From: "Todd Barr" <tbarr
geo-imaging.com>
To: <php-general
lists.php.net>
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 > > <a href="http://www.whatever.com/dave">David Bruner</a> > > 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 > >
attached mail follows:
--- Todd Barr <tbarr
geo-imaging.com> wrote:
> I am having an issue. I am using an access database,
> where the names have whitespace.
>
> Now, when I t