[PHP] Re: duplicating databases
Check out sqlyog. (www.sqlyog.com) It has a structure sync tool. After making the first change, you could generate a script to make the change to the next database and then take that script and parameterize it so that a PHP script could use it to update all of your database. HOWEVER, A better way to do this may be to re-think your entire schema. Instead of keeping the data in separate but identical databases, put it all in one database but add a key (owner, database, etc) to each table. Then in your selects, simply add to your where clause "AND ownerID=x". This way you only have 1 database but your data is kept separate. (Until MySQL comes out with views, then it gets a lot easier.) HTH, =C= * Cal Evans * http://www.eicc.com * We take care of your IT, * So you can take care of your business. * * I think inside the sphere. Steve Buehler wrote: I am running PHP/MySQL for a program that I am writing. We will have 100's or 1000's of databases that will be duplicates in structure. The problem is when I make a change to the database, I have to go to every database manually and make the change. All of the databases start with "a_" and are on the same server. I would like to be able to have one master database and then run a script when I make a change to it that will get the structure of the master database and check all of the other databases to make sure that their structures match. If not, it will make the change to the other databases. Does anybody know if there is all ready a program out there that would do this? Can anybody point me in the right direction? Or if it is only a few lines of script that somebody all ready has to do this, can you share it? Thank You Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML...
in page to try var_dump($_POST['email_recipients']); =C= * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * - Original Message - From: "Johnny Martinez" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 16, 2003 11:26 AM Subject: [PHP] HTML... > Hi all, > I'm trying to send an email to multiple recips but for some reason the > isn't passing "multiple" ...Does anyone see a problem with > this code? Do I an array or something to handle the passed multiples? > > Johnny > > > > page_1.php: > > > > > NONE > Andreas > Doreen > Elvin > > > > > > > = > > page_2.php > $email_recipients = $_POST['email_recipients']; > print "" . $email_recipients; > ?> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP CLI question
http://www.php.net/manual/en/function.ini-set.php * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * - Original Message - From: "Monte Ohrt" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, June 05, 2003 9:22 AM Subject: [PHP] PHP CLI question > Hi, > > A couple of questions: > > 1) Is there a way to make the CLI version of PHP ignore certain settings > in the php.ini file? For instance, I don't want the ioncube accelerator > invoked when using PHP from the command line. My current work around is > to use two separate init files, php.ini and php-cli.ini ... and this > brings me to my second question: > > 2) Is there a way to specify a different name for the php.ini file, > apart from hacking php_ini.c ? It seems I can only change the _path_ to > the file, but not the filename itself. > > TIA > Monte > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 3 entries going into 1 field
have 3 select boxes bdMonth, bdDay, bdYear. Then when processing the $_POST, simply contact them in the format you want. $bdString = $_POST['bsMonth'].'/'.$_POST['bsDay'].'/'.$_POST['bsYear']; HTH, =C= * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * - Original Message - From: "Vicky" <[EMAIL PROTECTED]> To: "PHP List" <[EMAIL PROTECTED]> Sent: Saturday, May 31, 2003 9:05 AM Subject: [PHP] 3 entries going into 1 field Hi, I have a registration form, but I would like to add a Date of Birth section. Now, because of the different formats of writing it I want to have 3 seperate drop down boxes, Date, Month and Year. However, I then want those 3 dropdowns to go into one field in a mySQL database, in DD/MM/ format. How can I acheive this, in simple language as I'm a newbie to this stuff ^_~ Thanks! Vicky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Netbilling PHP Script
Mike, I'm glad you vented. Now let me. I say none of this in anger and quite a lot of it in amusement. Please don't take this the wrong way. (By saying that I'm insuring that you WILL take it the wrong way!) :) Why is it helpful to give a person the answer to a question that has been answered before? Why is it not more helpful to show them how to find the answer to their question and possibly to the next one...and the net one...and the next one. All of us at one point or another have gotten mad because they've been told to RTFM. (UTFG, UTFW, etc.) But the fact of the matter is if you get told that a couple of time, you may actually start doing it. Jason's search google answer is very appropriate for many questions asked on this list. The people who answer questions here do it of their own free will, for no pay, and in the case of independent consultants, at the expense of their paying work. (Those of you who are employed and posting from work are just slacking!) :) Therefore, it is their right to answer in the way that they feel most helpful. If RTFM is the quickest way to get a newb to start reading the manual instead of asking (yet again) how the mail() function works then that's what will be posted. Telling people like Jason off as you have done feels really good. But at some point Jason will decide that it's no longer worth while to bother to read this list and drop. Then you can tell off someone else who knows what they are talking about because they don't follow your rules of etiquette...and maybe they will leave. At some point, you will find yourself in the list all by yourself. (except for the newb over in the corner still twiddling with the mail() function) It boils down to this. mailing lists have been around longer than you or I have been on the Internet. (Unless you are Vint Cerf and if you are I HUMBLY apologize and bow at your feet!) The rules of mailinglist etiquette (especially for technical lists, which this is) have matured over the years and are not really up for discussion. If you don't like them, go elsewhere, start your own list. Otherwise, play nice. most humbly, =C= - Original Message - From: "Mike Morton" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, May 29, 2003 8:49 AM Subject: Re: [PHP] Netbilling PHP Script > I have to get this off my chest, and I tried to send it directly to Jason > off list, but the email bounces back. Why? Probably because he gets a lot > of these emails. Don't like what I have to say? Tough luck, I am sick of > unconstructive emails hitting the list putting people down. If you cannot > or will not answer someone, just don't answer them at all. Be helpful, not > hurtful. Oops, should take my own advice and not post this at all, but I > need to get it off my chest, I am sure that I am not the only one thinking > it: > > Jason: > > Why do you bother to answer on the php list at all? 90% of the messages > from you are 'search google' if you do not have constructive info to offer, > why bother to answer at all. I am directing this to you because the list > does not need to see my crap about it, but it just makes me sick to see you > over and over putting people down who are just asking for help. > > Really, I have been a member of MANY lists over the years, and I truly have > never seen anyone as negative as you. If you do not have a useful answer to > the question just don't answer- you clutter the list and my inbox. > > And no, 'search google' is not a good answer - at the best of times it is > tough to wade through all the crap that google spits at you, at the worst of > times, most people do not even know what to search for to narrow it down! > Never mind searching the list archive - half the time all I get back is your > emails saying 'search google'! > > Geeze, look what you have made me do, get pissed of and waste my time > flaming you. What a waste of our time. > > > On 5/29/03 5:43 AM, "Jason Wong" <[EMAIL PROTECTED]> wrote: > > > On Thursday 29 May 2003 17:36, Ralph wrote: > >> I have to setup credit card verification/processing with Netbilling.com, > >> does anybody know of a PHP based Netbilling gateway script or class? > > > > Have you searched google? > > -- > Cheers > > Mike Morton > > > * > * Tel: 905-465-1263 > * Email: [EMAIL PROTECTED] > * > > > "Indeed, it would not be an exaggeration to describe the history of the > computer industry for the past decade as a massive effort to keep up with > Apple." > - Byte Magazine > > Given infinite time, 100 monkeys could type out the complete works of > Shakespeare. Win 98 source code? Eight monkeys, five minutes. > -- NullGrey > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Generators
check www.freshmeat.net. There are several. =C= * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * - Original Message - From: "Clint" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 28, 2003 9:59 AM Subject: [PHP] Form Generators > Does anyone know of a form generator that will look at a MySQL table and > generate an add/edit form off of that table? > > Thanks, > Clint > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Valid Email Question
The only way to do that would be to open a connection to the SMTP server directly and try and send the email. (Instead of using the mail function) This way the mail server would give you an error code if it didn't work. =C= * Cal Evans * Stay Plugged Into Your Audience * http://www.christianperformer.com -Original Message- From: Stephen [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 8:05 PM To: PHP List Subject: [PHP] Valid Email Question Is there anyway you can email a certain email a user enters, see if it bounces back, and if it does, tell the user to enter a valid username? I've always wanted to do this but I'm not sure how to see if it bounces back. Thanks, Stephen Craton http://www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] crontab
I've not seen anything to indicate to me that running php scripts in a cron job (via php compiled as a CLI) is any less secure than running cron jobs written in any other language. All of mine are 700 root, the cron process runs as root and I understand that. Since I'm the root on the box, it's ok. PHP does not 'run as root'. The CLI will run as whomever is executing the script. My $.02 worth. =C= * Cal Evans * Stay Plugged Into Your Audience * http://www.christianperformer.com -Original Message- From: John Taylor-Johnston [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 3:07 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] crontab Cal, Liam, Jimmy, Thanks. If this is a serious security hazard, could you show me some code that is more secure? I am the "root". Mind you I've never worked with crontab before. I want to run /var/www/backup_mysql.php I suppose I should start by putting it somewhere not publicly accessible? Thanks, John Liam Gibbs wrote: > > Can I run a php script in crontab? > > Do I echo or print? > > Anyone doing it? > > This is a serious security hazard. However, what you could do is have a PHP > page set cron settings (such as name of file, location, frequency, and > importance), then have another cron job (running at a decent frequency) do > the organization. However, this is still a security flaw, as hackers can > just take a look at your cron jobs and get in and run their own in place of > yours. Probably no more a flaw than normal, though, as if a hacker can get > in to replace your cron job, they can get in and run any number of things > anyway. Make sure to hard code your cron jobs, as having a downloadable page > is a bigger security hazard. You don't want the PHP page to do this itself, > because it will have to run as root. > > I did this one time, and if I'm allowed some time to get my page up, I can > e-mail you some instructions. What you'll need is a PHP page, a txt file > (for the settings) and a cron job that will read the file and do the > necessary steps to arrange the cron jobs itself. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] crontab
1: yes you can. 2: You can use either print or echo. I use echo when I actually want something output, most of my scripts don't output anything. If there is some output of import, I use mail() to send it to myself. 3: Yes, I am. * Cal Evans * Stay Plugged Into Your Audience * http://www.christianperformer.com -Original Message- From: John Taylor-Johnston [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 2:45 PM To: [EMAIL PROTECTED] Subject: [PHP] crontab Can I run a php script in crontab? Do I echo or print? Anyone doing it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Newbie look for some content specific tutorials
take a look at the database abstraction layer ADODB at php.weblog.com Even if you are like me and never use more than just MySQL, it makes like a lot easier. =C= * Cal Evans * Stay Plugged Into Your Audience * http://www.christianperformer.com -Original Message- From: Hunter, Jess [mailto:[EMAIL PROTECTED] Sent: Thursday, February 27, 2003 2:38 PM To: [EMAIL PROTECTED] Subject: [PHP] Newbie look for some content specific tutorials Greets all, First time poster here and a 1 week old PHP/Mysql programmer I have bought several books and scoured the net for any and all PHP/MySQL tutorials. Here is the problem I am running into: 1. The docs tell how to access MySql through the MySql monitor 2. any docs that tutor how to make PHP interact with MySql has you doing all the functions directly on the page 3. All the rest are written like VCR instructions (Mine still blinks "12:00") What I am looking for is a tutorial that talks specifically about the interaction of PHP forms with MySql I have figured out how to add records using PHP, and have even figured out a crude search function, but being able to update or delete records are eluding me. Does anyone know of a site that has this type of information with some extremely well commented samples? Thanks Jester -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] newbie: installing gd in php4
did you bounce the service after uncommenting the line? =C= * Cal Evans * Stay Plugged Into Your Audience * http://www.christianperformer.com -Original Message- From: Anthony Ritter [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 10:15 AM To: [EMAIL PROTECTED] Subject: [PHP] newbie: installing gd in php4 Using MS Win 98 / PHP 4 and Apache. I tried running the following script but got an undefined call to: ImageCreate() The following copy is located in my php.ini file...one of which is: .. ;extension=php_gd.dll .. I tried uncommenting this line to no avail. What is the best way to install php_gd.dll so that I can make use of the image library. Many thanks. Tony Ritter ;; ; Dynamic Extensions ; ;; ; if you wish to have an extension loaded automaticly, use the ; following syntax: extension=modulename.extension ; for example, on windows, ; extension=msql.dll ; or under UNIX, ; extension=msql.so ; Note that it should be the name of the module only, no directory information ; needs to go here. Specify the location of the extension with the extension_dir directive above. ;Windows Extensions ;extension=php_mysql.dll ;extension=php_nsmail.dll ;extension=php_calendar.dll ;extension=php_dbase.dll ;extension=php_filepro.dll ;extension=php_gd.dll ;extension=php_dbm.dll ;extension=php_mssql.dll ;extension=php_zlib.dll ;extension=php_filepro.dll ;extension=php_imap4r2.dll ;extension=php_ldap.dll ;extension=php_crypt.dll ;extension=php_msql2.dll ;extension=php_odbc.dll -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Newbie Question
you have 2 functions named DBField. This was ok until 4.3. After 4.3 you couldn't re-declare a function like this. PHP does not allow for overloading like Java and C++ (It looks like that's what you are trying to do) Check the docs for overloading. There is some support for it but it's a bit of a kludge. (IMHO, etc.) =C= * Cal Evans * Stay Plugged Into Your Audience * http://www.christianperformer.com -Original Message- From: Greg Luce [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 25, 2003 9:47 PM To: [EMAIL PROTECTED] Subject: [PHP] Newbie Question Can someone explain why this code works on the hosting company's server, but won't run on my local server? I'm not sure what version is on the host server, but I'm running 4.0.5 locally on winXP Pro. The error says: Fatal error: Cannot redeclare dbfield() in c:\inetpub\wwwroot\livinginnaples\database.php on line 30 7.class DBField 8.{ 9. var $name; 10. var $type; 11. var $table; 12. var $title; 13. 14. var $size; 15. var $rows; 16. var $maxlength; 17. var $value; 18. var $prefix; 19. var $postfix; 20. var $display; 21. 22. function DBField() 23. { 24. $name = ""; 25. $table = ""; 26. 27. $this->display = true; 28. } 29. 30. function DBField( $name, $table, $size, $value ) 31. { 32. if( $size == "" ) $size=20; 33. $this->display = true; $this->name = $name; $this->table = $table; $this->size = $size; $this->rows = 5; $this->value = $value; $this->title = ucwords( $name ); } function display() { if( !$this->display ) return; $prefix = str_replace( "[TITLE]", $this->title, $this->prefix ); echo $prefix; switch( $this->type ) { case "blob": ?> value ?>value != "" ) $time = strtotime( $this->value ); else $time = strtotime( "now" ); ?> ">/">/"> postfix . "\r\n"; } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Submit buttons
using JavaScript you can use an and in the onClick call a function that sets the form's target and then calls document.formname.submit(); =C= * Cal Evans * Stay Plugged Into Your Audience * http://www.christianperformer.com -Original Message- From: Greg [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 25, 2003 2:11 PM To: [EMAIL PROTECTED] Subject: [PHP] Submit buttons Is there any way that I can have a form submit to different pages depending on the submit button that is pressed? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] page shown, but browser keeps doing something
are you preloading graphics using JavaScript? * Cal Evans * Stay Plugged Into Your Audience * http://www.christianperformer.com -Original Message- From: Chris Hayes (SENSE) [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 25, 2003 9:13 AM To: [EMAIL PROTECTED] Subject: [PHP] page shown, but browser keeps doing something hi list, i'm working on my local WAMP on a PHP module to fit in a cms, and i fail to understand what is taking the browser so much time _after_ the page is completely visible. Statusbar says still loading the page. Javascript links and the refresh function of the browser are reluctant. When i stop downloading, and look at the source, the page is in untill the last tag. This is what i checked: * with Phoenix (small version of mozilla) i loked at 'page info': as far as i can tell all images seem to exist. * the table and page structure is ok, Dreamweaver has no complaints. * it happens also when i turn off javascript in the internet explorer, so it is not a javascript on-the-run. If i save the entire page to disk and open it as a file:, it is very quick. Any ideas where to look now? Chris PS OT but while i tried to debug this situation, i changed several IE security settings and options and now it wants to download files from localhost in stead of show them. it starts asking whether want to open it, then choice open/save and then it asks with what i want to open it. Pretty annoying! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] general question ?
* Cal Evans * Stay Plugged Into Your Audience * http://www.christianperformer.com -Original Message- From: Jonas Geiregat [mailto:[EMAIL PROTECTED] Sent: Monday, February 24, 2003 3:42 PM To: [EMAIL PROTECTED] Subject: [PHP] general question ? http://kemu.ath.cx/intranet/login.phps when I press submit everything is OK it works like I want it to work but I'm not happy with the result I see in my url window I see this http://localhost/intranet/login.php?user=kemu&passwd=test&submit=login I don't like it that you can know the passwd is there a way to just make this login.php and not with all the vars I send with it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] browser dialog boxes
php=backend alert boxes=front end checkout JavaScript. You can use php to dynamically generate JavaScript. =C= * Cal Evans * Stay Plugged Into Your Audience * http://www.christianperformer.com -Original Message- From: Sunfire [mailto:[EMAIL PROTECTED] Sent: Monday, February 24, 2003 2:08 PM To: [EMAIL PROTECTED] Subject: [PHP] browser dialog boxes hi was just wondering if there is something with php that will let you create a browser dialog box when someone pushes a submit button or something like that... tnx --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cannot find php.ini
find / -iname php.ini or create a page with Untitled Save it and then call it form your webserver. It'll tell you where the ini is. =C= * Cal Evans * Stay Plugged Into Your Audience * http://www.christianperformer.com -Original Message- From: Kevin Paz [mailto:[EMAIL PROTECTED] Sent: Friday, February 21, 2003 1:03 PM To: [EMAIL PROTECTED] Subject: [PHP] Cannot find php.ini I've taken over a redhat server with apache/php4.1. I need to enable register_argc_argv but I can't find the php.ini file (I've searched the entire system). Would creating a new php.ini file with only register_argc_argv line work? Where's the default location for php.ini? Thanks in advance, Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Result in the same page
John, header(location:) is the way I'm doing it. I check for the Submit button, if it was pressed and the processing succeeded, I redirect. If processing fails (validation, error in connecting to the database, etc.) I redisplay the same page with all the same variables that the user just input. I give them a message telling them what went wrong and allow them to fix it. If you find a better way, please share. It would be nice to have something like =C= -Original Message- From: John Hicks [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 15, 2003 11:56 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Result in the same page Cal-- I just posted this reply to your reply on php.general. --John From: [EMAIL PROTECTED] (John Hicks) Newsgroups: php.general Subject: Re: [PHP] Result in the same page References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> NNTP-Posting-Host: 68.165.13.138 Message-ID: <[EMAIL PROTECTED]> I, too, like the idea of keeping my processing code in the same file as the form being processed. But I'm trying to figure out how to transfer control to the next page based on the result of the forms processing. In JSP, i would use , which is basically a "Go to" command. The only reference I can find to "transfer of control" in PHP is the header(location: ) function. But that requires a complete server/browser/server interchange. There must be a more direct way to transfer control in PHP. Would someone please tell me what it is? Thanks in advance, Frappy [EMAIL PROTECTED] (Cal Evans) wrote in message news:<[EMAIL PROTECTED]>... > Yes, just user $_SERVER['PHP_SELF'] as the action of your form. This will > cause the page to call itself. Then you can branch your processing on the > existence of a SUBMIT button (or whatever) and handle the query. > > I do all my pages this way because it keeps all the code in a single page. > It's easier for me to find it that way. > > =C= > > * > * Cal Evans > * Stay plugged into your audience. > * http://www.christianperformer.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
Hey Vern, PHP does not think you have the MySQL module installed. none of the mysql_* commands are going to work. check the output of phpinfo() to verify. What version of PHP are you running? Since you are using RPMs the only (helpful) advice I can give is try re-installing the PHP rpm. Possibly it needs to refresh itself. (I can offer some unhelpful advice like quit using RPMs and compile from source...switch to gentoo linux instead of RedHat for a better package manager...you know, stuff like that. But that's not helpful at the moment!) :) =C= * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com -Original Message- From: Vernon [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 6:13 AM To: [EMAIL PROTECTED] Subject: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2 After upgrading to MySQL 4.0.1.2 I ma getting the message : Fatal error: Call to undefined function: mysql_connect() in /home/penpals/pub/mysql.php on line 3 Please help my production server is down! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] if (a == b) ...
Stephen, "Friday August 22" evaluates to the number 0. (check the docs for intval()) Therefore the condition would be true. I stated in an earlier thread this week. It is bad for to allow PHP todo your conversions for you. At the least it's lazy, at the most it will cause unpredictable results. (as is your case below.) If you really MUST compare a string and a number, do an explicit cast first. if ($a==intval("Friday August 22")) or if (strval($a)=="Friday August 22") In both cases above, since we are explicitly casting, it is easy to predict the results and explain them. (In the above, the first should be true and the second should be false.) =C= * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com * -Original Message- From: Webapprentice [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 29, 2003 7:36 PM To: [EMAIL PROTECTED] Subject: [PHP] if (a == b) ... Hi, I have a conditional: if (a == b) a is the number 0, but b is a string "Friday August 22". The condition is evaluating as true, which is not what I want. What am I misunderstanding? Thanks, Stephen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Found a PHP bug!!!!!!!!!
John. > Actually, "08" is equal to 8 in PHP. PHP will convert the string to an >integer and the two will compare as equal. No they are not equal. Yes, PHP will do the conversion so that they are equal. That does not refute the fact that logically '08' != 8. > Someone already posted why the problem was happening, because the numbers > were being converted to invalid octal numbers and being set to zero. I understand the problem at hand. (and did when I posted) However, if Scott had been doing the conversions manually, he would never have run across this problem. It is a bad idea to rely on the language (whatever the language) to do automatic variable conversions. =C= -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Found a PHP bug!!!!!!!!!
Scott, Because "8" != 8. "8" (and "08") is a string with the numerals representing the number eight. It is not the number eight. (think back to basic math, the difference between a number and a numeral) PHP does some conversions for you automatically but that just saves you from yourself. (Personally, I wish it wouldn't. People have more trouble *because* of the automatic conversions than they would if they had to do the converting themselves.) To keep from running into this simply do the conversions yourself before you do comparisons. intval("08")==8 =C= * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com * -Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED]] Sent: Monday, January 27, 2003 2:14 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Found a PHP bug! I don't see why a string wouldn't work when I use "08" (string) and match it against the integer 8, or 08. "Kirk Johnson" <[EMAIL PROTECTED]> wrote in message B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef">news:B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef... > > > -Original Message- > > From: Scott Fletcher [mailto:[EMAIL PROTECTED]] > > > > Found a PHP bug, I'm using PHP version 4.2.3. I have been > > struggling with > > why PHP code failed to work with the month is August or > > September > > I stumbled into this one a short while ago myself. It is not a bug, but a > feature! ;) When passing values of 08 or 09 (Aug and Sep), PHP interprets > them as octal numbers (because of the leading 0). However, 08 and 09 are > invalid octal numbers, so PHP converts them to zero. > > The fixes are numerous: > - remove the leading zero; > - add zero to them before passing (addition forces a type conversion to > int); > - force a type conversion to integer using (int); > - quote them (when PHP converts a string to an integer, it removes the > leading zero); > > Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dynamic List Using Php
unless you want to submit the form to the server for each new entry (bad mojo) then I would recommend you look into using JavaScript to do this. (much easier and faster.) Once the user has entered all their entries then submit the form and update your database or storage medium of choice. IMHO, etc. =C= * * Cal Evans * Techno-Mage * http://www.calevans.com * - Original Message - From: "Pushpinder Singh Garcha" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 21, 2003 1:09 PM Subject: [PHP] Dynamic List Using Php > Hello All > > I am wanting a create a dynamic List using php. When a user enters a > value on a form, I need the value that he entered on the form to added > to a dynamic list box, which is displayed on the next page. So the List > Box continues to grow whenever a user adds a value on the form (note: > The values entered every time have to be stored) > > Thanks in advance. > > Pushpinder Singh Garcha > _ > Web Architect > T. Falcon Napier and Associates, Inc. > _ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can I use php to load a icon?????(.ico .exe .....)
exactly how do you "load" an icon? What are you loading it into? =C= * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com * -Original Message- From: hei [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 31, 2001 3:18 PM To: [EMAIL PROTECTED] Subject: [PHP] Can I use php to load a icon?(.ico .exe .) Can I use php to load a icon?(.ico .exe .) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 2 Qs: Passing current URL with session and how to avoid session timeout???
I guess I'm dense this morning. In response to 1: $_SESSION['mother']=$_SERVER['PHP_SELF']; and then Go Back or better yet... Go Back as to #2: I usually just pass this kind of info around on the URL. http://mypage.com/mypage.php?prevURL=http://mypage.com/lastpage.php if I have to pass a full query string then I urlencode() it first and urldecode() it on the other side. This survives sessions expiring. =C= * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com * -Original Message- From: -<[ Rene Brehmer ]>- [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 18, 2003 10:04 AM To: [EMAIL PROTECTED] Subject: [PHP] 2 Qs: Passing current URL with session and how to avoid session timeout??? Hi gang Been trying to figure out this session stuff, but since I was unable to make the manual sample into something workable, I instead decided to actually try and make the session do what I need it for: Passing the URL of the caller page to the page that's being called. 1. Only I can't figure out if there's a function to just pull the current URL and plop it into a session variable. The thing is that these pages are all built by using a bunch of GET variables in the URL, so it would be easiest to just do something like: $_SESSION['mother'] = $currentURL; And then in the called, daughter, page do this: >Get back to where you came from As the only other way I've found is to have it use the string-functions and re-build the current URL throughout the if-tree that builds the page. I need to pass the mother URL to the daughter pages because there's two main entry-points into the daugther pages, and one of them can have 10-15 different states... But how do you pull the current url? ParseURL just smacks it into an array, and I'll then have to rebuild it anyway ... which makes it about just as simple as running it through the if-tree. Whether or not the session-id is inside the URL is not essential to me, but dunno if php cares about it. 2. Since the above is required to function at all times, I need to override the expiration time. I can't do it in the ini file, 'cause I can't modify the server where it's to run, and it's set to 0 there... (not sure if that means it expires right away, or not at all) Anyway to do this??? TIA Rene -- Rene Brehmer This message was written on 100% recycled spam. Come see! My brand new site is now online! http://www.metalbunny.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
RE: [PHP] Select multiple boxes
What you are describing is a "2 List Mover". PHP is a server-side language and as such knows nothing about what is going on on the client. Therefore you have limited options. My favorite is : In your form's onSubmit() put code to load all the values into a hidden field. (Assuming you have defined the hidden field) in your JavaScript put things like document.mainForm.storeStuffHere.value += "storeStuffHere[1]='Value1'"; document.mainForm.storeStuffHere.value += "storeStuffHere[2]='Value2'"; document.mainForm.storeStuffHere.value += "storeStuffHere[3]='Value3'"; Then, when the form is submitted use: parse_str($_POST['storeStuffHere']); This will create the array storeStuffHere with the 3 values. HTH, =C= * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com * -Original Message- From: Gregory Chagnon [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 18, 2003 9:31 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Select multiple boxes The problem is I have 2 seelect boxes...it's for creating a user and adding them to a list of available groups...so I have one select box that is initially empty called memberOf and another box that has all of the available groups listed in it called availableGroups. I have a script that can move items back and forth and when the form is submitted I want to be able to get all the items that are in the memberOf box..anyh ideas on how to to this? THanks. -Greg "John W. Holmes" <[EMAIL PROTECTED]> wrote in message 000501c2bf01$46464cc0$7c02a8c0@coconut">news:000501c2bf01$46464cc0$7c02a8c0@coconut... > > Is there any way to get all of the elements in a SELECT MULTIPLE box, > not > > just the ones that are selected? Thanks! > > No. You create the box, so you should know all of the possible values. > > ---John W. Holmes... > > PHP Architect - A monthly magazine for PHP Professionals. Get your copy > today. http://www.phparch.com/ > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Select multiple boxes
whoops. Sorry, didn't read the question. Wrong answer. John gave the correct answer. =C= * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com * -Original Message- From: Cal Evans [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 18, 2003 8:41 AM To: Gregory Chagnon; [EMAIL PROTECTED] Subject: RE: [PHP] Select multiple boxes use [] in your select box name. When it comes back in the $_POST array you will have an array of options. It breaks HTML standard therefore it is a Bad Thing (tm) but it does work. Don't pick me Pick me Selecting both results in: $_POST['mySelect'][1] == "Don't pick me" $_POST['mySelect'][2] == "Pick me" HTH, =C= * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com * -Original Message- From: Gregory Chagnon [mailto:[EMAIL PROTECTED]] Sent: Friday, January 17, 2003 11:14 PM To: [EMAIL PROTECTED] Subject: [PHP] Select multiple boxes Hi- Is there any way to get all of the elements in a SELECT MULTIPLE box, not just the ones that are selected? Thanks! -Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Select multiple boxes
use [] in your select box name. When it comes back in the $_POST array you will have an array of options. It breaks HTML standard therefore it is a Bad Thing (tm) but it does work. Don't pick me Pick me Selecting both results in: $_POST['mySelect'][1] == "Don't pick me" $_POST['mySelect'][2] == "Pick me" HTH, =C= * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com * -Original Message- From: Gregory Chagnon [mailto:[EMAIL PROTECTED]] Sent: Friday, January 17, 2003 11:14 PM To: [EMAIL PROTECTED] Subject: [PHP] Select multiple boxes Hi- Is there any way to get all of the elements in a SELECT MULTIPLE box, not just the ones that are selected? Thanks! -Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Ever complained about lousy PHP programmers?
Since no one else has asked, I'll bite. Why not just use str_rot13()? The biggest problem I have with your code is that you didn't learn enough about the language to know that this was already in the code. As a newb, you need to set down with your favorite version of the manual (I keep the windows help version open at all times) and familiarize yourself with the language. You do not need to memorize each function' signature but it would help if you read the description of each function. You'll be surprised what you find in there. =C= * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com * -Original Message- From: Peter Hutnick [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 16, 2003 10:40 AM To: [EMAIL PROTECTED] Subject: [PHP] Ever complained about lousy PHP programmers? Well, here's your chance to criticize a newbie. As an exercise in learning PHP I have written a rot-13 script. It is at http://hutnick.com/rot13/index.html?show_content=1 . I'm soliciting comments on style, technique, etc. Be brutal, but don't get your feelings hurt if I don't take your comments as gospel. References will help me take comments to heart. It will be easier on me if you send or CC comments to [EMAIL PROTECTED] Thanks a million! -Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Result in the same page
Yes, just user $_SERVER['PHP_SELF'] as the action of your form. This will cause the page to call itself. Then you can branch your processing on the existence of a SUBMIT button (or whatever) and handle the query. I do all my pages this way because it keeps all the code in a single page. It's easier for me to find it that way. =C= * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com * -Original Message- From: Ezequiel Sapoznik [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 18, 2003 6:11 AM To: [EMAIL PROTECTED] Subject: [PHP] Result in the same page It is possible to run a query in php when the user press a button an return the result in the same page? Thanks! Ezequiel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] More OOP
personally, I would ditch the Error class and put raise_error in Base. =C= * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com * -Original Message- From: Jordan Elver [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 16, 2003 3:52 PM To: [EMAIL PROTECTED] Subject: [PHP] More OOP Hi guys, After your previous advice. I have been looking at some more OOP for my application. Is this the sort of way a proper OOP application should be constructed? I want to use smarty as my template language as well, how could I integrate that? "; // get connections details list($host, $username, $password, $type) = $details; // connect to the database if($connection = mysql_connect($host, $username, $password)) { $this->raise_error(); } } } class Login extends Database { function Login() { echo "Hello, I'm the Login class"; // connect to the database $this->connect(); } } $c = new Database; $c->connect(); Any pointers would be great :) Cheers, Jord -- Jordan Elver You don't have to be mad to work here, but you do have to be on time, well presented, a team player, customer service focused and sober!! -- David Brent (The Office) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] x12 837
yea, mine is all array based. I pull the data from a FoxPro table via XML (and jump through several hoops.) Then I have a main loop that spins through the data (which is ordered) and * creates a new PO if the PO number has changes (PO Object) * Create a PoLineItem for each line in the PO (POLineItemObject) * repeat. * PO's own POLineItems * All PO's are owned by the X12_850 object. Once everything is nicely sliced and diced into objects I call X12_850->generateX12(). This spits out all the necessary headers and then calls generateX12() on each PO. Each PO spits out all the necessary headers and then calls generateX12() on each POLine Item. Then it spits out the necessary trailers and bumps control back up the line. Once it's finished, I have a (honkin' big) string that represents the 850 document. Currently, I dump this out to a file for ftping but you could just as easily use CURL to call a SOAP process somewhere if your X12 partner had a brain. (mine does not, the company I was a consultant for in the medical insurance industry did not either) Anyhow, I'm happy to share what I know if you have questions. HTH, =C= * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com * http://www.calevans.com * -Original Message- From: Edward Peloke [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 16, 2003 3:55 PM To: Php-General@Lists. Php. Net Subject: RE: [PHP] x12 837 Cal, You used php for this? I am pretty sure that an 850 is on our list of things to do somewhere. Eddie -Original Message- From: Cal Evans [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 16, 2003 4:22 PM To: Edward Peloke; Php-General@Lists. Php. Net Subject: RE: [PHP] x12 837 I've created an 850 and a base class x12. It's not terribly hard. I did not find much in the way of useful classes already built though. =C= * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com * -Original Message- From: Edward Peloke [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 16, 2003 3:39 PM To: Php-General@Lists. Php. Net Subject: [PHP] x12 837 Ok, I know this is a longshot but does anyone on this list work in the healthcare industry and have created an 837 with php? I am thinking of attempting to create one in php and didn't want to reinvent the wheel. Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] x12 837
I've created an 850 and a base class x12. It's not terribly hard. I did not find much in the way of useful classes already built though. =C= * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com * -Original Message- From: Edward Peloke [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 16, 2003 3:39 PM To: Php-General@Lists. Php. Net Subject: [PHP] x12 837 Ok, I know this is a longshot but does anyone on this list work in the healthcare industry and have created an 837 with php? I am thinking of attempting to create one in php and didn't want to reinvent the wheel. Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] forms
yes but it's more of an HTML/JavaScript thing. use INPUT Type='BUTTON' to put a second button on your form. Then use the onClick method to assign an action to it. If you want it to submit your form then call document.formName.submit(); =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: cj [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003 7:32 PM To: [EMAIL PROTECTED] Subject: [PHP] forms G'day All Just a quick question This is really a html more than a php question. Is it possible to have two buttons and have different actions for each button in the same form? Thanks CJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Media library
since you've not indicated that you've looked around and not found one, I suggest starting your search at www.freshmeat.net. =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: GWAD Mailinglist [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 18, 2002 8:32 AM To: [EMAIL PROTECTED] Subject: [PHP] Media library Hi! I'm looking a (good) PHP source for media library reg (eg.). - user authentication - user groups - store pictures / video / audio (database or file) - easy upload - php / mysql / apache and maybe - simple picture edit, video / audio edit?? Anyone to know something good source? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] key pairs
Possible but a single table with all addresses and an addressType (SHIP_TO or BILL_TO) linked back to the main order table will allow you to retrieve both addresses with a single select: select * from address where orderID=x =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Brad Bonkoski [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 3:50 PM To: 1LT John W. Holmes Cc: [EMAIL PROTECTED]; PHP-General List Subject: Re: [PHP] key pairs What about a master table like: Order ID | Ship_TO | BILL_TO Then an address table: ID | NAME | ADDR | CITY | STATE | ZIP Then you could have many addresses, and IFFthe Bill to and Ship to were the same then the master table would reflect that. Many sites provide a check box to indicate that the Bill to and Ship to are the same, which you would key off of and if so, assign the same Unique Address ID to both fields in the master table. Many ways to do this, but those are my thoughts -Brad "1LT John W. Holmes" wrote: > > >Hopefully the other solution worked for how to parse the data. If not, > post > > >back. What I wanted to comment on is why would you use two tables, one > for > > >SHIP_TO and one for BILL_TO? Why not just add a column to one table set > set > > >it to BILL or SHIP. You won't be repeating data that way and it'll be > easier > > >to find things overall. Plus you can just have a column that flags > whether > > >the SHIP_TO and BILL_TO addresses are the same. > > > > > > > > I haven't gotten that far yet. BILL_TO and SHIP_TO aren't always > > the same people, hence my initial thought of creating two tables and > > keep things separate. However, you're right, I could dump it all into > > one table - if they're different, then populate the rest of the fields, > > if not, don't bother. > > What I was thinking is that you have one table with > > Order_ID > Name > Address > Flag -> Here you flag this as SHIP_TO or BILL_TO > etc... > > Your order_ID could be a key, but it will not be unique, since if the > bill_to and ship_to address are different, the order_id will appear in the > table twice. So an order with different shipping and billing addresses would > have two rows in the table. An order where they are the same would only have > one row. > > That layout would be better than: > > Order_ID > Ship_name > Ship_address > Bill_name > Bill_address > etc... > > Which is what I got from you last email. > > Does anyone agree? > > ---John Holmes... > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] File Random Access
Rick, If you have a file that is to large to simply read into memory, do your inserts and then write back out then you need to move it to a database. Cluttering up the main code base with random flat-file reads and writes is not necessary. If you seriously need it then you can do as suggested, create a new file, read from the old file, insert at the proper place, close, delete, rename, rinse, repeat. If you think about it, that's what the php developers will have to do to accommodate your request. (assuming again that your file is too large to simply fit in memory.) It may be a need for you but in my 2 years of using PHP, you are the first person I've seen ask for it. Therefore I don't think it qualifies as a serious flaw. IMHO, etc. =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 30, 2002 7:46 AM To: PHP Subject: [PHP] File Random Access I never noticed before...there is no easy way to perform random-access read and WRITE on a file. I vote/recommend/suggest that this most basic functionality be added to the next release of PHP. This would not be an enhancement; rather, it is correcting a serious flaw. Or am I missing something - Original Message - From: "Marek Kilimajer" <[EMAIL PROTECTED]> To: "PHP" <[EMAIL PROTECTED]> Sent: Wednesday, October 30, 2002 6:28 AM Subject: Re: [PHP] write on the begin of a file There is no insert in fputs, you need to make a new file and then rename it to your old one, or build it in the memory and then overwrite it. Sébastien Eckert -- Netika wrote: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] about $_post
Yes. $_POST[ID] Since there are no quotes around the variable name ID and no dollar sign in front of it, PHP will look for a constant named ID and if one is not found it will blow chow. $_POST['ID'] Should work find, assuming a variable named ID came from your form. However, I wouldn't get in the habit of writing my arrays like this. It's confusing to say the least. =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Meltem Demirkus [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 19, 2002 6:35 AM To: [EMAIL PROTECTED] Subject: [PHP] about $_post Hi, I just want to learn if there is any differen between $_POST[ID] and $_POST['ID'] ..If there is.. does it cause a problem ?.. thanks meltem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL Current Row??
In (most) SQL servers there is no concept of 'row number'. Most DA's design tables with a unique primary key. This can be used to identify the row form all of the other rows but it is not the same as a 'row number'. Since you are using PHP you can set a counter to 1 before your loop and then increment it at each loop. This will give you the semblance of a row number but be aware it is not the same. These are row numbers within the cursor you are looking at. If your cursor is a subset of the table's data then the numbers you are counting do not correspond to the data in the table. HTH, =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Beeman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 18, 2002 8:30 AM To: php Subject: [PHP] MySQL Current Row?? What function/array index should I use to determine the current row of a MySQL query when outputting using a do..while.. Loop? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] OO code and private functions
not yet (Zend engine 2.0 I believe has this) Currently the convention is to name private functions _* (variables the same) This denotes to other coders that you intended this to be a private function. =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Richard Black [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 9:24 AM To: Php-General Subject: [PHP] OO code and private functions Can I make a function private in PHP, so that it can only be called from within an object of that class??? Just discovering the wonders of OO PHP... :-) == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] security login
If it's simple security then you might want to use an .htaccess file instead of coding something. More complex solutions involve asking the user for credentials, validating those credentials and then storing something in the $_SESSION that indicates that this user has been validated. It can be something as simple as $_SESSION['isOK'] = true; to creating a Person object with various credentialling information and storing it. $_SESSION['currentMember'] = new Person(); $_SESSION['currentMember']->setLogin('myUserName'); $_SESSION['currentMember']->setPassword('someSillyPassword'); $_SESSION['currentMember']->load(); if !$_SESSION['currentMember']->isA('SYSADMIN){ die("Begone form here you freakin' script-kiddie!"); } // if !$_SESSION['currentMember']->isA('SYSADMIN) // normal code goes here. In the above example it is assumed that you have created a Person object to deal with everything. HTH, =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Pag [mailto:[EMAIL PROTECTED]] Sent: Monday, August 12, 2002 10:12 AM To: [EMAIL PROTECTED] Subject: [PHP] security login Well, first off sory for a very basic question, but i really dont know where else to look for the answer. Heres my dilemma: I need to code a backend for this site i am building, the backend will manage the news for the front page. The database stuff is pretty straight forward (so far!), but i need to validate who does the managing, i mean, some sort of login for only a few people. I am thinking of using username/pass from a table and all that but the thing is, how do i do the validating itself? Sure i know how to check for valid user/pass, but then what happens for the rest of the pages inside the backend, how do i keep the user validated and make sure only he can browse inside that "secure" mini site? Dont know if i am explaining things right, hmm, ok, any of you guys are familiar with gryematter? It validates the user at the start and then we can do whatever we want inside. I want to prevent users from skipping the login and just typing the other page url and go on from there. I use sessions, cookies? what? can you provide me with some urls for my research, or at least what to look for? Thanks a lot, really appreciate all the help. Pag -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Banner Ad Serving...
Tell apache that .html files are to be served through php * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Dave at Sinewaves.net [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 23, 2002 11:00 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Banner Ad Serving... That works fine for files with .php extensions, but I need something to add code to html pages as well... Any ideas??? Dave -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 23, 2002 8:55 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Banner Ad Serving... On Wednesday 24 July 2002 11:47, Dave at Sinewaves.net wrote: > Is there any way of automatically adding a certain bit of code to every > page on a web server (or within a given directory)? php.ini --> auto_prepend_file, auto_append_file -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* An eye in a blue face Saw an eye in a green face. "That eye is like this eye" Said the first eye, "But in low place, Not in high place." */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Accessing Ports
No. No. PHP runs on the server. It knows nothing of the client. =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Thomas "omega" Henning [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 18, 2002 5:33 AM To: [EMAIL PROTECTED] Subject: [PHP] Accessing Ports Hello, Can i access my paralel or USB port with PHP server side? Thomas "omega" Henning -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Alley-OOP! ... or not?
Building off of what Jay said... I'm a hardcore OOP developer but agree that you must use it judiciously. Used in the correct way it makes maintaining/extending your applications much easier. There are times though when you don't want it. I usually find myself coding pages that have PHP in them. However, whenever I can abstract a task from the page and move it into an object that can be reused, I do. ALMOST ALL of my database interaction goes through objects. (I do some quickies where I'll code a mysql_query line in the page, but not often.) If it is a discrete task (database interaction) or an abstraction of a physical object (Person, Invoice, Order) then I use object. The code in the page mainly creates objects and manipulates them. HTH, =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Martin Clifford [mailto:[EMAIL PROTECTED]] Sent: Monday, July 15, 2002 10:05 AM To: [EMAIL PROTECTED] Subject: [PHP] Alley-OOP! ... or not? Hey all, I've seen quite a few programs that seem to greatly favor Object Orienting Programming (OOP) in their code. I don't mean to start a holy war or anything of the sort, but as a burgeoning PHP developer, I would like the opinions of my peers. So how about it, ladies and gents? Tell me about the Pros and Cons to OOP, and why you prefer to use it/not use it! Personally, I've always used regular functions to accomplish my repetetive tasks, and OOP seems rather daunting for me, but I'm always open to new (and hopefully, more efficient) ideas! Thanks! Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How come this will echo No or nothing?
off the top of my head, I'd suggest : if(intval($row['plevel']) == 0){ Grasping at straws here but you've moved beyond a simple question into a debigging process. (Which doesn't work too well for email.) Sorry I couldn't be of more help. =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: JJ Harrison [mailto:[EMAIL PROTECTED]] Sent: Friday, July 12, 2002 11:26 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] How come this will echo No or nothing? The value of plevel is "0" according to var_dump. -- JJ Harrison [EMAIL PROTECTED] www.tececo.com "Cal Evans" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Have you done a var_dump on $row to make sure that plevel exists? > > =C= > > * > * Cal Evans > * The Virtual CIO > * http://www.calevans.com > * > > > -Original Message- > From: JJ Harrison [mailto:[EMAIL PROTECTED]] > Sent: Friday, July 12, 2002 11:11 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] How come this will echo No or nothing? > > > I tried that. > > same result. > > Here is my (new) snippet: > > if($row['plevel'] == 0){ > echo 'No'; > } else { > echo 'Yes'; > } > > "Cal Evans" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > because $row['plevel'] is NEVER == '0' It is probably == 0 though. (note > > the missing quotes. ) :) > > > > HTH, > > =C= > > * > > * Cal Evans > > * The Virtual CIO > > * http://www.calevans.com > > * > > > > > > -Original Message- > > From: JJ Harrison [mailto:[EMAIL PROTECTED]] > > Sent: Friday, July 12, 2002 11:01 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP] How come this will echo No or nothing? > > > > > > here is the portion of the script: > > > > if($row['plevel'] == '0'){ > > echo 'No'; > > } else { > > echo 'Yes'; > > } > > > > here is my table structure dump: > > > > # > > # Table structure for table `docs` > > # > > > > CREATE TABLE docs ( > > id int(11) unsigned NOT NULL auto_increment, > > name varchar(200) NOT NULL default '', > > note varchar(200) NOT NULL default '', > > author varchar(200) NOT NULL default '', > > path varchar(200) NOT NULL default '', > > plevel tinyint(3) NOT NULL default '0', > > type char(3) NOT NULL default '', > > cat tinyint(3) NOT NULL default '0', > > file_size int(11) unsigned NOT NULL default '0', > > date int(11) unsigned NOT NULL default '0', > > PRIMARY KEY (id) > > ) TYPE=MyISAM; > > > > the row plevel is either 0 or 1. > > > > why won't this script echo Yes? > > > > The reason that the plevel is set in numbers is because I may add higher > > ones later. > > > > -- > > JJ Harrison > > [EMAIL PROTECTED] > > www.tececo.com > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Newbie question
++ is an incrementor. $i=1; $i++; echo $i; =C= p.s. -- is a decrementor. * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Jay [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 13, 2002 8:32 PM To: [EMAIL PROTECTED] Subject: [PHP] Newbie question I have just started to teach myself php so I am reading through several scripts to see how the language is "spoken". I came across the following at phpworld.com $i = 1; while ($i <= 10) { print $i++ Its a little script that counts from 1 to 10, but what does $i++ mean. What does the ++ do? Why ++ and not just one + Thanks -Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How come this will echo No or nothing?
Have you done a var_dump on $row to make sure that plevel exists? =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: JJ Harrison [mailto:[EMAIL PROTECTED]] Sent: Friday, July 12, 2002 11:11 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] How come this will echo No or nothing? I tried that. same result. Here is my (new) snippet: if($row['plevel'] == 0){ echo 'No'; } else { echo 'Yes'; } "Cal Evans" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > because $row['plevel'] is NEVER == '0' It is probably == 0 though. (note > the missing quotes. ) :) > > HTH, > =C= > * > * Cal Evans > * The Virtual CIO > * http://www.calevans.com > * > > > -Original Message- > From: JJ Harrison [mailto:[EMAIL PROTECTED]] > Sent: Friday, July 12, 2002 11:01 PM > To: [EMAIL PROTECTED] > Subject: [PHP] How come this will echo No or nothing? > > > here is the portion of the script: > > if($row['plevel'] == '0'){ > echo 'No'; > } else { > echo 'Yes'; > } > > here is my table structure dump: > > # > # Table structure for table `docs` > # > > CREATE TABLE docs ( > id int(11) unsigned NOT NULL auto_increment, > name varchar(200) NOT NULL default '', > note varchar(200) NOT NULL default '', > author varchar(200) NOT NULL default '', > path varchar(200) NOT NULL default '', > plevel tinyint(3) NOT NULL default '0', > type char(3) NOT NULL default '', > cat tinyint(3) NOT NULL default '0', > file_size int(11) unsigned NOT NULL default '0', > date int(11) unsigned NOT NULL default '0', > PRIMARY KEY (id) > ) TYPE=MyISAM; > > the row plevel is either 0 or 1. > > why won't this script echo Yes? > > The reason that the plevel is set in numbers is because I may add higher > ones later. > > -- > JJ Harrison > [EMAIL PROTECTED] > www.tececo.com > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How come this will echo No or nothing?
because $row['plevel'] is NEVER == '0' It is probably == 0 though. (note the missing quotes. ) :) HTH, =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: JJ Harrison [mailto:[EMAIL PROTECTED]] Sent: Friday, July 12, 2002 11:01 PM To: [EMAIL PROTECTED] Subject: [PHP] How come this will echo No or nothing? here is the portion of the script: if($row['plevel'] == '0'){ echo 'No'; } else { echo 'Yes'; } here is my table structure dump: # # Table structure for table `docs` # CREATE TABLE docs ( id int(11) unsigned NOT NULL auto_increment, name varchar(200) NOT NULL default '', note varchar(200) NOT NULL default '', author varchar(200) NOT NULL default '', path varchar(200) NOT NULL default '', plevel tinyint(3) NOT NULL default '0', type char(3) NOT NULL default '', cat tinyint(3) NOT NULL default '0', file_size int(11) unsigned NOT NULL default '0', date int(11) unsigned NOT NULL default '0', PRIMARY KEY (id) ) TYPE=MyISAM; the row plevel is either 0 or 1. why won't this script echo Yes? The reason that the plevel is set in numbers is because I may add higher ones later. -- JJ Harrison [EMAIL PROTECTED] www.tececo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] html entry within XML "database"
As a general rule of thumb you should ALWAYS validate the information posted as a form before sending it on to whatever backend you are using. =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: William S. [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 13, 2002 7:37 AM To: php Subject: [PHP] html entry within XML "database" I am experimenting with using an XML file as a database. One of the things I do is provide a way of adding records to the database by an html form. This seems to work out well so far unless one of the fields in a record contains an html reference. The result is a Sablotron parse error. What is the best way around this? Should I validate the form before it is submitted so that html references are rejected? How would I do this? -- Bill Amsterdam, NL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] don't want to receive but email please
only if user stupidity can be considered a virus. =C= - Original Message - From: "Lazor, Ed" <[EMAIL PROTECTED]> To: "PHP List" <[EMAIL PROTECTED]> Sent: Monday, July 08, 2002 11:37 AM Subject: RE: [PHP] don't want to receive but email please > So is this a new virus? > > -Original Message- > From: Rodolfo Contreras T. [mailto:[EMAIL PROTECTED]] > Sent: Friday, July 05, 2002 6:30 PM > To: [EMAIL PROTECTED]; PHP List > Subject: [PHP] don't want to receive but email please > > > don't want to receive but email please don't want to receive but email > please don't want to receive but email please don't want to receive but > email please don't want to receive but email please don't want to receive > but email please don't want to receive but email please don't want to > receive but email please don't want to receive but email please don't want > to receive but email please don't want to receive but email please don't > want to receive but email please don't want to receive but email please > don't want to receive but email please don't want to receive but email > please don't want to receive but email please don't want to receive but > email please don't want to receive but email please don't want to receive > but email please don't want to receive but email please don't want to > receive but email please don't want to receive but email please don't want > to receive but email please don't want to receive but email please don't > want to receive but email please don't want to receive but email please > don't want to receive but email please don't want to receive but email > please don't want to receive but email please don't want to receive but > email please don't want to receive but email please don't want to receive > but email please don't want to receive but email please don't want to > receive but email please don't want to receive but email please don't want > to receive but email please don't want to receive but email please don't > want to receive but email please don't want to receive but email please > don't want to receive but email please don't want to receive but email > please don't want to receive but email please don't want to receive but > email please don't want to receive but email please don't want to receive > but email please don't want to receive but email please > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > This message is intended for the sole use of the individual and entity to > whom it is addressed, and may contain information that is privileged, > confidential and exempt from disclosure under applicable law. If you are > not the intended addressee, nor authorized to receive for the intended > addressee, you are hereby notified that you may not use, copy, disclose or > distribute to anyone the message or any information contained in the > message. If you have received this message in error, please immediately > advise the sender by reply email and delete the message. Thank you very > much. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] function for size of array
size_of() (insert obligatory RTFM comment here) =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 9:16 AM To: [EMAIL PROTECTED] Subject: [PHP] function for size of array Is there PHP function that would get the total array count. ie --snip-- $array[0] = "zero"; $array[1] = "one"; $array[2] = "two"; $array_count = --snip-- And I would get 3 as an answer. Thanks, FletchSOD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Authentication
I agree with Ed. Use sessions. It's more secure that how you are doing it because theusername is not stored in the page and retransmitted each page. =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Peter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 2:32 PM To: [EMAIL PROTECTED] Subject: [PHP] Authentication On my site, when a user logs in, their password is encrypted using md5() and the username and encrypted password is then passed from page to page using hidden form inputs (clicking on a link submits the form using POST). Does anyone have any comments on this method e.g. security wise? I know I could use sessions or cookies but is it relly necessary? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: MySQL fetch data
Jeff, Also, try php.weblogs.com ADODB if you absolutly MUST have all of your data in an array. I'll agree with Richard that it's not a great idea unless there is a specific need. While loops for displaying the contents of many records are much better. (IMHO, etc...) =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Sent: Sunday, June 30, 2002 5:41 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: MySQL fetch data In article <00e001c21db3$7b1b66a0$0a01a8c0@jcowart> , [EMAIL PROTECTED] (Jefferson Cowart) wrote: >Is there any way to return all the rows returned by a mysql query with >one command. Currently I have to run through a for or while loop the >same number of times as there are rows and take that row and copy it to >an array. I end up with an array of arrays but it seems like it would be >a common enough problem that the function would already exist. Why do you think you need the data in an array? Usually, you can just deal with it immediately and discard it. I think Oracle lets you snatch a whole array at once, but not MySQL. If you screw up your SQL, you don't want to try to snatch the whole thing at once anyway -- The potential for trashing your web/db-server by asking for, oh, 10,000 records at once is just too high. Better safe than sorry. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php & SMS (or phone contact)
don't reinvent the wheel. (Unless you jsut REALLY want to) Try www.nagios.org It has support for SMS. (Be prepared to spend about 3-4 hours setting it up) =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Duncan [mailto:[EMAIL PROTECTED]] Sent: Monday, July 01, 2002 9:47 AM To: [EMAIL PROTECTED] Subject: [PHP] php & SMS (or phone contact) Hi, i want to make a script, that monitors my server and if its down, sends an SMS, pager message, or rings the phone (lol) to contact me. Is it possible to send a message to a pager or an SMS to a handy with php? Or are there any scripts already out there? I tried to take a look around, but most scripts i found relied on services, which don't exist anymore, of who changed their service, so that its not possible to use from the outside. Regards, Hendrik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ASP style "application-level" variables
Lee, Please check the archives before posting questions like this. As John stated, this question has been asked and answered this week. (I think it was a thread just yesterday.) It would have been much quicker for you to get your answer by mining the archives than by posting it again here. Thanks for your cooperation, =C= p.s. I accomplish applicaiton level variables by storing them in a table called application in my application's database. This way I can change them on the fly and all my pages can see them. I have objects that read them in on the pages that need them. * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Lee [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 29, 2002 10:11 AM To: [EMAIL PROTECTED] Subject: [PHP] ASP style "application-level" variables Hi, Apologies if this question has already been asked in the past, but I have only just registered for this list. Does PHP in anyway support ASP style application-level variables in a similair way to how standard sessions are used. Though of implementing this as either files or database records but the additional coding could be more error-prone or eat more system resources than using a feature built into PHP itself. I would be interested to hear other peoples views on this feature. Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Populate Popup Menu from Database
Hi Mike, Check out ADODB. It's a database abstraction layer for PHP that has functions to do this. (php.weblogs.com) Otherwise it's kinda easy to do this, here's some psuedo-code that shoudl get you going. fields['departmentID']; ?>">fields['departmentName']; ?> ?> =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Mike Tuller [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 29, 2002 10:42 AM To: php mailing list Subject: [PHP] Populate Popup Menu from Database I have some popup menus and want the items in the menu to be populated from a database. In this case I have a table that contains a listing of departments. I have a page that I can go in and add/delete departments, and want the changes to reflect in the menu the next time you go to the page. I searched for examples and found this: http://marc.theaimsgroup.com/?l=php-general&m=97628169623096&w=2 What is here is beyond my understanding, and seems like it is a little much for what I need. Here is what my database table looks like: Departments department_id department_name I just want to list the department name in the popup. Thanks, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Why isn't this working?
Have you tried: $query = "UPDATE poll_options SET votes = votes + 1"; * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: JJ Harrison [mailto:[EMAIL PROTECTED]] Sent: Friday, June 28, 2002 8:05 AM To: [EMAIL PROTECTED] Subject: [PHP] Why isn't this working? Here is my code: $query = "UPDATE poll_options SET votes + 1"; mysql_query($query); All where conditions have were removed to try and fix the problem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] HTTP1.1
It's not so much a no-no as it is bad form. It makes it very difficult to re-arrange your site at a later date or move that page. For your own peace of mind and those who come behind you, absolute links in the form of href="/correct/path/to/the/file.php" should be used. You can omit the http:// and the host name if you like. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Gerard Samuel [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 27, 2002 12:40 PM To: php-gen Subject: [PHP] HTTP1.1 Kinda off topic, but it deals with a php script Im writing. Ive been using dynamic strings to create relative links like -> somefile I was wondering if this is a no no according to http 1.1 specs. ie absolute links -> http://host/correct_path_to_file.php";>somefile I briefly looked through through the specs, but it didn't say that links/urls shouldn't be formatted like the first example above... Any insight, would be grateful. Thanks -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Editor
URL?? :) * * Cal Evans * Techno-Mage * http://www.calevans.com * - Original Message - From: "Adrian Greeman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 14, 2002 8:18 AM Subject: [PHP] Editor > I am just surprised that noone mentioned HTML-Kit among all the editors > suggested. I think it is fine and it even gives you a quick preview in > browser window for HTML. It gives you PHP among various other options > colouring the code differently and you can just highlight code to surround > it with php tags for example. > > Does Java and other stuff too. > > Lots of plug-ins endlessly under development > > And it's FREE. > > I have it plugged in as the external text editor of choice with Dreamweaver. > > > > > > Regards > > > Adrian Greeman > > > Telephone +44 20 8672 9661 > Mobile +44 780 329 7447 > > e-mail:- > [EMAIL PROTECTED] > > or > > [EMAIL PROTECTED] > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] forcing file downloads
> Justin French wrote: > > > > 1. Is this a widely accepted practice for forcing downloads (a pop-up > window > > to download a file), given the problems with older versions of IE? > > I believe so. Don't. > > > 2. Can someone tell me what the %20 is there for? > > You can try typing http://www.foo.net/bar/of soap/he he he/ and it may > work in some browsers. The %20 (I forget the exact explanation, sorry) > is basically code for the space. All browsers understand > http://www.foo.net/bar/of%20soap/he%20he%20he/ 20 is the hex code for a space. When the url get 'URLENCODED' any non-valid characters get converted to hex. In some (broken?) browsers a space in the URL may work but it's generally not a good idea. =C= * * Cal Evans * Techno-Mage * http://www.calevans.com * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] E-Commerce and "small" intranet solution
have you searched freshmeat.net? google.com? both of those can give you the examples you are looking for. * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Jay Fitzgerald [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 05, 2002 2:16 PM To: [EMAIL PROTECTED] Subject: [PHP] E-Commerce and "small" intranet solution Does anyone know where I can find the best (not just good) shopping cart solution that also has small intranet functionality? Im not too worried about the intranet aspect right now, but I really need examples of some of the best carts that are out there. -- Should you have any questions, comments or concerns, feel free to call me at 318-338-2034. Thank you for your time, Jay Fitzgerald, Design Director - CSBW-A, CPW-A, CWD-A, CEMS-A = Bayou Internet..(888) 30-BAYOU...http://www.bayou.com Mississippi Internet...(800) MISSISSIPPIhttp://www.mississippi.net Vicksburg Online..(800) MISSISSIPPIhttp://www.vicksburg.com Bama Online.(877) GETCONNECTED...http://www.bamaonline.net = Tel: (318) 338-2034ICQ: 38823829Fax: (318) 323-5053 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] open a new html page
store the user's preference in a database. Once they have logged in, use their login or userID to retrieve it form the database and redirect to the appropriate page. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Renaldo De Silva [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 05, 2002 1:01 PM To: [EMAIL PROTECTED] Subject: [PHP] open a new html page is there a simple way to automatically load a new page according to a choice made by a user. If one persons logs in they go to one page, If another peson logs in they go to another page? Any help appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 1 session, 2 subdomains
Actually, if you are doing this then just re-login the person once they get to the new domain. Then you have the login and the session. PHP has the capability to allow you to replace the session handler. If you have to have them login in one domain and then use the info in another, building your own session handler is one way to do it. But if you have no session info to pass, why is it a problem? =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Jason Dulberg [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 3:08 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP] 1 session, 2 subdomains I am currently storing the session hash/login info (userid, session hash, host, etc.) in the db and send it to the next domain in the redireted URL. How would the handler work if no session info isn't being passed to the subdomain? Thanks! Jason > From: Cal Evans [mailto:[EMAIL PROTECTED]] > > Store your session information in a database. Assign it an ID and > send that > ID to the cookie or the URL in the new domain. Then you can > write a session > handler that retrieves the session info form the database. > > =C= > > * > * Cal Evans > * Journeyman Programmer > * Techno-Mage > * http://www.calevans.com > * > > > -Original Message- > From: Jason Dulberg [mailto:[EMAIL PROTECTED]] > Sent: Monday, June 03, 2002 2:13 PM > To: [EMAIL PROTECTED] > Subject: [PHP] 1 session, 2 subdomains > > > I am working on a sports website that will have a subdomain for each major > sport. There is a login panel on the main domain that routes users to the > appropriate subdomain depending on the sport that they are in. Everything > seems to be ok with cookies (cookiedomain=.domain.tld) but I > can't get it to > work with sessions -- even if I pass the session id in the URL. > > In the login script, I define the session then route to the appropriate > subdomain. This where the problem lies - after redirection, the session is > lost. It appears that the session is defined for the domain name that the > user signs in on - if I allow users to login on their given sport > subdomain, > the session works ok, but this doesn't work the way I'd like. > > Any ideas on what I'm doing wrong? > > (I can post my login/session code if need be) > > Thanks for any suggestions!! > > __ > Jason Dulberg > Extreme MTB > http://extreme.nas.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
RE: [PHP] 1 session, 2 subdomains
Store your session information in a database. Assign it an ID and send that ID to the cookie or the URL in the new domain. Then you can write a session handler that retrieves the session info form the database. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Jason Dulberg [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:13 PM To: [EMAIL PROTECTED] Subject: [PHP] 1 session, 2 subdomains I am working on a sports website that will have a subdomain for each major sport. There is a login panel on the main domain that routes users to the appropriate subdomain depending on the sport that they are in. Everything seems to be ok with cookies (cookiedomain=.domain.tld) but I can't get it to work with sessions -- even if I pass the session id in the URL. In the login script, I define the session then route to the appropriate subdomain. This where the problem lies - after redirection, the session is lost. It appears that the session is defined for the domain name that the user signs in on - if I allow users to login on their given sport subdomain, the session works ok, but this doesn't work the way I'd like. Any ideas on what I'm doing wrong? (I can post my login/session code if need be) Thanks for any suggestions!! __ Jason Dulberg Extreme MTB http://extreme.nas.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
RE: [PHP] nested if parse error
if (1){ if (1) {echo "hello";} } else { } ?> * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Miroslav Figlar [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 7:05 AM To: [EMAIL PROTECTED] Subject: [PHP] nested if parse error could somebody explain me please what is wrong with this piece of code? it gives me parse error on line 4 this works fine (no parse error): thank you miro -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] arrays and same index
$array["untitled_1.jpg"] = array(0,3,4,0,1) Or you could : $array["untitled_1.jpg"] = array(); $array["untitled_1.jpg"][0]=0 $array["untitled_1.jpg"][1]=3 $array["untitled_1.jpg"][2]=4 $array["untitled_1.jpg"][3]=0 $array["untitled_1.jpg"][4]=1 Then you can access them by using: echo $array["untitled_1.jpg"][0] // = 0; echo $array["untitled_1.jpg"][1] // = 3; echo $array["untitled_1.jpg"][2] // = 4; echo $array["untitled_1.jpg"][3] // = 0; echo $array["untitled_1.jpg"][4] // = 1; or: $x = $array["untitled_1.jpg"]; echo $x[0]; echo $x[1]; echo $x[2]; echo $x[3]; echo $x[4]; HTH, =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Victor Spang Arthursson [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 8:37 AM To: [EMAIL PROTECTED] Subject: [PHP] arrays and same index Hi! I want to create an array that looks like follows: $array["untitled_1.jpg"][] = 0 $array["untitled_1.jpg"][] = 3 $array["untitled_1.jpg"][] = 4 $array["untitled_2.jpg"][] = 0 $array["untitled_3.jpg"][] = 1 What I'm thinking about is accessing all "untitled_1.jpg" values by doing the following: $newarray = $array["untitled_1.jpg"]; and receive an array with 3 indexes which has the values 0,3,4... This doesn't works... $array["untitled_1.jpg"][] = 3 seems to overwrite $array["untitled_1.jpg"][] = 0 and then $array["untitled_1.jpg"][] = 4 overwrites $array["untitled_1.jpg"][] = 3... How should I solve this? Sincerely Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] newbie: cron jobs
1: Yes, if your host has given you permission to run cron jobs. Some hosts lock cron to only root or to a specific subset of users. If you have permission to create them, crontab -e will give you the editor to edit them. (hint: man crontab. read it. Now read it again.) 2: man cron, man crontab, http://www.google.com/search?hl=en&q=cron+tutorial 3: This is one of those, "If you have to ask, you can't afford it" questions. Technically, no, there is nothing special about a "cron job" cron is a program that runs other programs or shell scripts at pre-determined intervals. However, it doesn't bother to check to see if it's a good idea to run the job or if you are going to eradicate all life on earth by running this job. cron just runs the job. If I were you, I'd consult with a professional or at least a ranking armature before trying to implement a cron job on any machine you care about. My $0.02 worth, =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Edgard Berendsen [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 8:11 AM To: [EMAIL PROTECTED] Subject: [PHP] newbie: cron jobs Hi, I'm new to cron jobs and I need to do one. 1- It's possible to program cron jobs in a remote server where you can't modify something, for example, a normal web-hosting? 2-Where can I find more informationa about? 3-It's there something special I should know to program one? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ADODB - whaddya think?
I've been using it for about 4 months and it's very stable. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Jerome Houston [mailto:[EMAIL PROTECTED]] Sent: Friday, May 17, 2002 4:05 PM To: [EMAIL PROTECTED] Subject: [PHP] ADODB - whaddya think? Testimonial time! Despite ROCK STAR assistance from a PHP developer, I'm having troubles with mssql_*() functions. most of the problems are gone (or being fixed by some AWESOME people), but to make use of those fixes, i've got to use php v 4.3-dev. and there's other bugs in that (as there should be). so i've been looking for alternatives to using the mssql functions... and i've found something that looks promising: ADODB. for those of you who don't know, some people have just written some code that attempts (and looks as if it does a pretty good job) of unifying ODBC calls for lots of different databases. their website: http://php.weblogs.com/ADODB What i want to know is: does anyone have experience with these libraries? I tested them briefly, and it seemed to work like a charm, but so did the mssql_*() functions, until i got into some of the nitty-gritty uses of the DB. Will lots of little bugs come about, the more i use it? or have they ironed most of that out? thanks for your opinons, and i apologize for possibly spurring another loquacious debate amongst smart people :-) -jerome _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Making Multiple Pages
Do a google search for ADODB. It's a PHP database abstraction layer. It has built in 'pagination' methods (Previous X, next X) along with an example of how to use them. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Jason Soza [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 16, 2002 1:31 PM To: [EMAIL PROTECTED] Subject: [PHP] Making Multiple Pages I have some ideas on how this should be done, but I'm at work and can't really test them, so I was thinking maybe I could run it by you all and maybe get some feedback and/or new ideas. I have a PHP/MySQL-generated page that displays image thumbnails. Currently, I have a loop that makes a table and table rows, fills the rows with the thumbnails, then when there's no more information, it completes whatever row it's on with blank 's, then closes the table. This was working fine, but my site is actually attracting more traffic than I originally thought, and I'm getting more image submissions. It's getting to where it's no longer practical to arrange all the thumbnails onto one page, I need to have like 25 on one page, then have the script create a link at the bottom so users can click and see the next 25. I'm thinking I need to use some kind of row count language in the script, i.e. first count how many rows are in the MySQL table, if it's less than 25, just display them all. If there's more than 25, display only 1 - 25, then create a link to view 26 - 50, etc. Is that what I need to be looking into? Any other ideas would be appreciated. Thanks! Jason Soza -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to stop site flipping?
sweet. Very nice solution. * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Monday, May 13, 2002 10:18 PM To: David McInnis; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] How to stop site flipping? This might help: I have a php file in my doc root called email.php. Instead of linking an email address with mailto:[EMAIL PROTECTED]";>, I link it like this: Justin French (Actually I do it with a function, but for clarity sake, I'll leave the above in place). email.php isn't a HTML page, it's a small script which sends a mailto: header to the browser: mailto:$email_address";); ?> As you can see, there are defaults in there, so if they link to email.php?to=justin, the default domain will be used, and vice-versa for a missing "to", or both missing. I tested it in a few browsers, and the original page was not refreshed... an email window popped up in outlook express, just as it would with a regular mailto: link, and everything works fine. This prevents spiders hunting for mailto:something in your pages. Other spiders might look for anything that looks like an email address, so I'd recommend not having regular email address' anywhere: Justin French instead of [EMAIL PROTECTED] I've seen some simular stuff where the users put in something like a space around the @ to make it harder for the spiders to find the text too, but I dunno if this is that reliable: justin @ indent.com.au Of course the other option is to strip every email address from your site, and put in a "contact us" form. Justin French on 14/05/02 12:07 PM, David McInnis ([EMAIL PROTECTED]) wrote: > I have been running a newswire service since 97 and recently noticed an > increase in the number of people flipping our site to harvest email > addresses contained in the news releases posted on our site. (prweb.com) > > I am running apache and php on a linux box. Can anyone suggest > something that I can implement that would block users who are harvesting > data from our site? I do not mind legit users from using this data, but > the flippers are chewing up my bandwidth and db resources. > > I also want to be careful to not block valid search engine spiders from > indexing our site. > > David McInnis > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Self Destruct code
IANAL! It's against the law in most states to create booby-traps in your code. As others have suggested, don't turn over the code until you've received payment. IMHO, you really should have specified the payment schedule in your contract. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: PHPCoder [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 3:20 AM To: php-general Subject: [PHP] Self Destruct code Hi I have a funny request; I wrote a system for a client and am rather concerned that I am not going to receive payment for the work done. They want me to hand over the code before they are willing to pay, so basically I will be left at their mercy; if they don't pay, they will still have a working version of the system... So, is there any way I can inconspicuously code in some boo-boo's that are time related etc. Something that will bomb the mysql tables or break some code if it is not "unlocked" within a month etc. I'm not sure if people out tjere might have existing safeguard tools etc, so I'm open for suggestions. PS, I know about Zend's encrypter, but since it will live on their server, I don't think it will help much since they will need the decrypter on there anyway right? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is it possible to verify that a form submision is not being "spoofed"?
Generate a random number when creating a form, store it in the session and in a hidden on the form. Then when the post comes back, make sure the hidden is there and that it matches the one in the session. Cal * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Warrick Wilson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 30, 2002 2:52 PM To: [EMAIL PROTECTED] Subject: [PHP] Is it possible to verify that a form submision is not being "spoofed"? I'm having a hard time explaining what I'm trying to do, which is why I'm having a hard time finding anything online/in manuals... My site serves a form for the user to fill in. User has been authenticated with a login and we're using PHP 4 sessions. When using Internet Explorer, the user can hit Ctrl-N and get a new window, but his session for that new window is still valid. He could then load up a local page and submit it to the target of my original form. Is there some way of detecting that the submission came from a page that hadn't been served up by my application, but was instead sent in from some other "foreign" form? Or maybe the question is - how can I kill off sessions if the user navigates away from the page that I sent him originally? Warrick Wilson mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] In Addition to [PHP] PHP Security
While I've never actually had that happen (If Apache crashes, NOTHING goes out the socket...not the source to the page) in short, there is very little that you can do to protect yourself against this. For PHP to get to the file, it has to be readable but the user that Apache is running under. Since include files get shoveled in before the page is executed, if Apache were to spew the source, your include files would go with it. That being said, I keep all my passwords in include files and keep the include files in directories that Apache can't serve directly. This provides some level of comfort. (but not a lot) =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Jan Peuker [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 1:45 PM To: [EMAIL PROTECTED] Subject: [PHP] In Addition to [PHP] PHP Security Sorry for answering with a new question. But, what's if, say, the PHP-Parser crashes (or a filename is changed) and Apache returns the source. How is it simply possible to store passwords somewhere a httpd-users won't see it? (e.g. in the includes-Folder, am I right?) And are session-variables send per post or does the next script reads it from the session-file so nobody can't read them? Regars, Jan Peuker - Original Message - From: "Miguel Cruz" <[EMAIL PROTECTED]> To: "Jay Fitzgerald" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, April 29, 2002 8:33 PM Subject: Re: [PHP] PHP Security > On Mon, 29 Apr 2002, Jay Fitzgerald wrote: > > Can someone point me in the right direction in determining just how secure > > PHP really is? > > What are you actually trying to find out? > > As far as actual security problems in PHP, where the interpreter behaves > contrary to documentation when provided with extraordinary inputs, the > team has been very responsive with fixes (in contrast with, say, > Microsoft). > > If you are wondering about the security of any given application developed > in PHP, well, that's up to the developers of that application. > > miguel > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cannot add header information
It means that something has already output to the outbuffer in unbuffered mode. Therefore, whatever header operation you are trying to do (start a session? redirect?) cannot be done. IMHO, the biggest culprit of this is blank lines in your include files. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Bo Pritchard [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 12:02 PM To: [EMAIL PROTECTED] Subject: [PHP] Cannot add header information I know without the accompanying code there's no way to help me...But without having to get real specific what does the following message tell me is wrong? Thanks Warning: Cannot add header information - headers already sent by (output started at /home/omnidevi/omnidevices-www/s-cart/form.phtml:4) in /home/omnidevi/omnidevices-www/s-cart/shop-head.phtml on line 44 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] javascript and PHP
since php runs on the server, not on the client, you have to pass the value of data back to the server. Normally, this is done via a GET or a POST from a form or by building a URL and using javascript to load it. (i.e. document.location = 'http://myserver.com/mypage.php?data=Hello%20World';) Then your PHP script can execute and see the value of $_GET['data'] HTH, Cal * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Steve Buehler [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 10:30 AM To: [EMAIL PROTECTED] Subject: [PHP] javascript and PHP Does anybody know of a good/short tutorial about passing variables from JavaScript to/from PHP? For example, how to do the following: data = "hello world"; "; ?> The above might at least give me a clue. Just a note. I really know nothing to speak of about JavaScript. Thanks in Advance Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Secure MySQL connections in PHP with 'stunnel'
My suggestion, if you just want to move data between the 2 servers, is to mysqldump to a file, scp the file to the destination server and then mysql < filename to get it into the second server. You can't do it under programmatic control but it will work and your data will remain secure in transport. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Stefen Lars [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 10:24 AM To: [EMAIL PROTECTED] Subject: [PHP] Secure MySQL connections in PHP with 'stunnel' Hello all I have written a very simple PHP script to copy the data from one MySQL database table on SERVERA to another MySQL database table on SERVERB. Using PHP, I simply connect to each server and copy the data across. That works well. However, natively, MySQL works with clear text. i.e. the data is copied across the Internet in clear text (a bad thing). I would now like encrypt the MySQL data between SERVERA and SERVERB. After searching with Google, I see that stunnel is a tool to use. However, I have been trying with no avail to create an encrypted connection between the two servers from MySQL to work. Following the instructions at: http://www.zataz.net/php-stunnel-tuneling.php I have come up with the following: SERVERA (master) /usr/local/sbin/stunnel -f -P/tmp/ -c -d 3308 -r SERVERA:3307 /usr/local/sbin/stunnel -f -P/tmp/ -p /usr/local/ssl/certs/stunnel.pem -d 3307 -r 3306 SERVERB (slave) /usr/local/sbin/stunnel -f -P/tmp/ -c -d 3308 -r SERVERB:3307 /usr/local/sbin/stunnel -f -P/tmp/ -p /usr/local/ssl/certs/stunnel.pem -d 3307 -r 3306 This does not work. When I connect to the slave with: and select / insert data into SERVERB, the data is selected / inserted to the database on SERVERA. This is very strange. Has anyone else tried using stunnel to achieve what I want to do? If so, I would REALLY like to hear how you achieve the encrypted link. Or are there other ways of securely coping data from one MySQL server to another? Using stunnel seems rather fiddly Any comments on this subject will be well received. Stefen _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Text File Formating.
the manual is your friend. http://www.php.net/manual/en/function.nl2br.php * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Randum Ian [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 10:20 AM To: PHP Subject: [PHP] Text File Formating. Hi there, I have got various text files which I need to convert on the fly to HTML with PHP. How do I convert this: --- TEXT --- CHART RETURN Chart Date: blah No. Artist - 'Track (Remix)' (Label) 1. blah - 'blah (blah mix)' (blah) --- END TEXT--- to this: --- HTML --- CHART RETURN Chart Date: blah No. Artist - 'Track (Remix)' (Label) 1. blah - 'blah (blah mix)' (blah) --- END TEXT--- Any help much appreciated, Ian. --- Randum Ian DJ / Reviewer / Webmaster, DancePortal (UK) Limited [EMAIL PROTECTED] http://www.danceportal.co.uk DancePortal.co.uk - Global dance music media -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] return multiple value from function
no, it's not possible to do it that way. If you need to return multiple values from a function, your best bet is to return an array or some kind of record structure. By design, in almost all languages, functions only return a single value. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: sanjay [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 9:11 AM To: [EMAIL PROTECTED] Subject: [PHP] return multiple value from function Hi List, I am new to php programming and wanted to know if it is possible to return multiple value from a function like cgi programs. How can I get the following result using php. ($var1, $var2) = myfunction($a,$b); function myfunction($c,$d) { // code // code return ($e,$f); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Security Leak (plaintext)
It's not PHP's place to do this. That being said, check out ADODB. It's a data abstraction layer for several different databases that will give you this functionality. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Joshua b. Jore [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 4:00 PM To: Maxim Maletsky (PHPBeginner.com) Cc: [EMAIL PROTECTED] Subject: RE: [PHP] PHP Security Leak (plaintext) Foo. Somehow I encrypted the last message. --[PinePGP]--[begin]-- I think you misunderstood me. I already have a AuthenticateUser(TEXT,TEXT) function that works great. What I don't understand is how to get PHP to use place holders for data binding. This is more generic database issue. I could have also written: "INSERT INTO foo (a,b) VALUES (?,?)" where again, the values are passed separately and are *not* interpolated into the query. That's the point - not interpolating your values to protect against insertion attack. Joshua b. Jore http://www.greentechnologist.org On Thu, 25 Apr 2002, Maxim Maletsky (PHPBeginner.com) wrote: > Create yourself an SQL function that does that :-) > > > > Sincerely, > > Maxim Maletsky > Founder, Chief Developer > > www.PHPBeginner.com // where PHP Begins > > > > > -Original Message- > > From: Joshua b. Jore [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, April 25, 2002 10:26 PM > > Cc: [EMAIL PROTECTED] > > Subject: RE: [PHP] PHP Security Leak > > > > This brings up another issue, how the heck do you get data binding? > For > > the life of me I don't see where the _query functions support SQL > like: > > > > "SELECT AuthenticateUser(?,?)" where then the first param might be a > > usernamd and the second would be a password. The idea is that without > this > > sort of thing you are vunerable to SQL insertion attacks. > > > > Joshua b. Jore > > http://www.greentechnologist.org > > > > On Thu, 25 Apr 2002, Maxim Maletsky (PHPBeginner.com) wrote: > > > > > > -Original Message- > > > > From: Liam Gibbs [mailto:[EMAIL PROTECTED]] > > > > Sent: Thursday, April 25, 2002 8:20 PM > > > > To: [EMAIL PROTECTED] > > > > Subject: [PHP] PHP Security Leak > > > > > > > > I'm wondering if anyone has any ideas on how to make a > > > > login site more secure. Since I'm not really sure if > > > > I've explained myself well enough and don't really > > > > know how else to say it, I'll just give examples and > > > > then you guys can follow suit and mention some > > > > oversights: > > > > > > > > I have a regular logon: username and password. What it > > > > does is, when the user types in a name and pword, it > > > > forwards to another PHP page (a 'middleman' page that > > > > is there just to compare usernames and pwords), > > > > validates by checking the SQL database, then header > > > > forwards to the login page. A cookie is created, and > > > > voila, you're allowed into what we'll call the > > > > 'account pages'. Now, here's my 'security' (notice the > > > > quotes): > > > > 1. You can't log in when the URL includes a username > > > > and/or a password (so that no one can make direct > > > > links). > > > > 2. Same with an account page: you're redirected to the > > > > login page if you include a username and pword when > > > > linking to an account page. > > > > 3. The 'middleman' page also has this protection: you > > > > cna't directly link to it with a username and pword in > > > > the URL. Basically, users can't get into anything when > > > > they include a username and pword in the URL. > > > > 4. Obviously, you don't get access if your username > > > > and password don't match anything in the database > > > > (thought I'd mention it even though it goes without > > > > saying). > > > > 5. You can't login from a page that isn't on the > > > > server. > > > > > > > > Is there any validation or security holes that I'm > > > > overlooking? > > > > > > > > > > > > > > at least this two: > > > > > > 1. Use SSL > > > 2. Store passwords MD5 encrypted in the DB > > > > > > > > > > > > Sincerely, > > > > > > Maxim Maletsky > > > Founder, Chief Developer > > > > > > www.PHPBeginner.com // where PHP Begins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ASP to PHP
Having moved a moderately sized website last year from ASP to PHP I can say from experience that if you can re-write it, the move will go smoother and you will have fewer lines of code. I ended up with about 1/2 as many lines of code to maintain after the port was done. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 6:38 AM To: [EMAIL PROTECTED] Subject: [PHP] ASP to PHP I got a strange request from a client. He wants to be able to take his ASP pages and move them over to PHP so that he can run them on apache on his linux server. I saw a tool yesterday ASP2PHP, but I am wanting to know does it work, how much is lost, is it easy to use? Is there another way to change ASP file to PHP with out a lot of re-writes? Chuck Payne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with inheritance mechanism.
Add a constructor to the pulldown_db: function pulldown_db($control,$ausgabe){ parent::pulldown(($control,$ausgabe); } // function pulldown_db($control,$ausgabe) Because PHP's ctors are named after the class when you subclass, you have to add one and call the parent's if you want it to fire. Kinda goofy but no more so than the lack of overloading. (I REALLY miss overloading functions!) =C= * * Cal Evans * Techno-Mage * http://www.calevans.com * - Original Message - From: "Steve Dix" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, April 16, 2002 5:59 AM Subject: [PHP] Problem with inheritance mechanism. > > I'm having a bit of a problem with the following classes. > > Class pulldown builds a select box using a set of arrays containing > the relevant data. > > class pulldown_db is written to extend the class to allow the use of > the class with a database. > > Now, the problem appears in pulldown_db. If you notice the code at > the end which tests the objects, $dbpul never seems to get created. > > I'm rather puzzled as to why this should be. > > // Select box building classes written by Steve Dix Feb 2002. > // > // These are replacements for the functions "pulldown_array" and > "pulldown_database" > // They are not DIRECT replacements, having different parameters. > // Please see the bottom for examples of how to initialise and use > the classes. > // > // New input string should be : > // > // array(control), array(ausgabe[ausgabe|wert|zieldatei] > // > // Control array should be enumerated. > > // Class to build and display a selection box for use in a form from > a supplied array. > class pulldown > { > var $ausgabe=array(); > var $control=array(); > > var $mehrfach; > var $onchange_text; > var $class_text; > var $size_text; > > // constructor for class copies supplied arrays - control containing > control information, ausgabe containing data > // then calls the private method build_list() to sort out internal > flags based on the control array. > // note that the control array makes use of associative indexes to > make the source more self-documenting. > > function pulldown($control,$ausgabe) > { > global $DEBUG; > > echo "Initialise\n"; > > while(list($key,$data)=each($control)) > { > $this->control[$key]=$data; > if($DEBUG) echo "$key,$data\n"; > } > > while(list($key,$data)=each($ausgabe)) > { > while(list($k,$d)=each($data)) > { > $this->ausgabe[$key][$k] = $d; > if($DEBUG) echo "$key $k $d\n"; > } > } > >// Mehrfach-Auswahl > > $this->build_list(); > } > > // public method write - writes the complete html select code > function output_select() > { >// Pulldown bauen >echo "$text\n"; > echo " >onchange_text.$this->size_text.$this->class_text.$mehrfach.">\n"; > >// Auswahl > $cnt = count($this->ausgabe[ausgabe]); > > if(DEBUG) echo "cnt $cnt\n"; >for($i=0;$i<$cnt;$i++) > { > // Selektieren > if($this->ausgabe[ausgabe][$i]==$this->control[selektiert]) > { > $select = "selected"; > } > else > { > $select=""; > } > > if($this->ausgabe[wert][$i]!="0" && !empty($this- > >ausgabe[wert][$i])) > { > $wert = $this->ausgabe[wert][$i]; > } > else > { > $wert = $this->ausgabe[ausgabe][$i]; > } > > echo "".$this- > >ausgabe[ausgabe][$i]."\n"; > } > echo "\n"; > } > > // build_list - private method to set various variables according to > the control array. > function build_list() > { >$this->mehrfach = ($this->control[mehrfach]=="1") ? ' multiple' > : ''; > >$this->onchange_text = ($this->control[onchange]!="" && $this- > >control[onchange]!="0") > ? " onChange='".$onchange."' " > : ""; > >$this->class_text = ($this->control["class"] != "") > ? "class='".$this->control["class"]."' " > : ""; > >$this->size_text = ($this->control[size]!="") > ? "size='".$this->control[size]."' " > : ""; > } > } > > > // class pulldown_database extends the above class to deal with > databases > // it deliberately makes use of inheritance so that you can still use > the ausgabe array to add > // options which cannot be found in the database. > > class p
Re: [PHP] variable question
store $name on one line and $welcomemssg on a separate line. Then just remember that all odd numbered liens are names and even numbered lines are messages. =C= * * Cal Evans * Techno-Mage * http://www.calevans.com * - Original Message - From: "Jule Slootbeek" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, April 15, 2002 1:30 PM Subject: Re: [PHP] variable question > > Here's my code, teh $welcomemssg is one of the two variable store in > index.php the other one is $name > > $File = "welcome/index.php"; > $Open = fopen ($File, "r"); > if ($Open) { > print ("$welcomemssg"); > } > fclose ($Open); > ?> > > Jule > > On Monday 15 April 2002 13:49, you typed on your keyboard, and you sent me > the following: > On Tuesday 16 April 2002 00:41, Jule Slootbeek wrote: > > Hey Guys and Gals, > > I'm writing this little script that takes two inputs: $name and > > $welcomemssg from a form and puts them in a text file. Now i only want to > > extract one of those variables open it with welcome.php, how do i go > > about this? when i just do fopen and fwrite it prints both variables. > > any thoughts? > > Show us your code. > > -- > Jule Slootbeek > [EMAIL PROTECTED] > http://blindtheory.cjb.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
RE: [PHP] make a set of variables available to all visitors?
Actually, if they are static variables that rarely or never change, I would stick with the include file. It's faster than making a database connection and selecting them. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: olinux [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 14, 2002 11:40 AM To: [EMAIL PROTECTED] Subject: [PHP] make a set of variables available to all visitors? What would be the best way to make a set of variables available to all visitors? example: if I stick all variables in a separate file and include - include(settings.php); - that works fine. seems that this is a lot of overhead to include these on every page. These variables would never change (they basically turn an alpha string into numeric to speed up queries.) I don't think hard coding would be a great solution either... simplified example: one set of variables to be included on all pages refer to the article type - i would like to use urls that make sense to the visitor rather than number strings so - $article_type = array("news" => 1,"opinion" => 2,"finance" => 3); Maybe it would be best to simply query for WHERE article_type = 'news' etc. Thanks much, olinux __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Multiple Threads?
PHP can fork but the docs say not to do it in a web server environment. basically, it's only usable on *nix machines and in a shell scripting environment. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Matthew Walker [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 13, 2002 10:26 PM To: [EMAIL PROTECTED] Subject: [PHP] Multiple Threads? I dont remember the name of the module offhand, but once upon a time, I used a perl module that would fork multiple threads so that you could execute several web queries at the same time. This saved a lot of time, if, for instance, you had to get information from UPS, FedEx, and the USPS about shipping rates to display on a page. If you had to query them one at a time, the delay would be unacceptable. However, with that perl module, you could query them all at the same time, making it much faster. Does anyone know if such a thing exists for PHP? Matthew Walker Senior Software Engineer ePliant Marketing --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.345 / Virus Database: 193 - Release Date: 4/9/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: RE: RE: [PHP] Including only I want
Ok, if you just want to retrieve values form the file and not PHP code, try opening it as a file instead of 'including' it. Read the lines you want, use the values you read in to set variables or branch or whatever. Personally (because I'm a database bigot) I'd stuff them in a table in a database but that's up to you. If you need to read in and execute PHP code, you MIGHT could get away with reading them in as described above and then using eval() to do execute them one at a time...but I'd steer clear of this. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Alberto Wagner [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 13, 2002 8:13 AM To: [EMAIL PROTECTED]; Php General Mailling List Subject: Re: RE: RE: [PHP] Including only I want I want to make a module system, that open a module and get the first $numberlines of it that will be some configuration variables, the $numberlines will probably be at top of file, at line 1, then I want to script to get the variables and execute them in the kernel.php, allowing me to make modules with configs with only one file 13/04/2002 12:23:50, "Cal Evans" <[EMAIL PROTECTED]> wrote: >I guess it would help if you explained what you are trying to do. the >answer to your initial question is no. > >=C= > >* >* Cal Evans >* Journeyman Programmer >* Techno-Mage >* http://www.calevans.com >* > > >-Original Message- >From: Alberto Wagner [mailto:[EMAIL PROTECTED]] >Sent: Saturday, April 13, 2002 5:09 AM >To: [EMAIL PROTECTED]; Php General Mailling List >Subject: Re: RE: [PHP] Including only I want > > >But its exactely what I don't want > >13/04/2002 11:11:54, "Cal Evans" <[EMAIL PROTECTED]> wrote: > >>Break those lines out into another file... >>=C= >>* >>* Cal Evans >>* Journeyman Programmer >>* Techno-Mage >>* http://www.calevans.com >>* >> >> >>-Original Message- >>From: Alberto Wagner [mailto:[EMAIL PROTECTED]] >>Sent: Saturday, April 13, 2002 4:33 AM >>To: Php General Mailling List >>Subject: [PHP] Including only I want >> >> >>Is there any way to include only the lines that I want in an other PHP >file? >> >>something like Include(); >> >>like lines number 5,6 and 7. >> >>only this ones and not the entire script? >> >> >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> >> >> > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] globals in functions
1: Globals are bad...m'kay. You should never use globals. If your function needs a variable, you should pass it in. There are exceptions to this rule but it's not a good idea to program normally this way. 2: Is this a form? It sounds (from the way you word it) that the variables are part of a form. If so, pass $_POST into your form and it will be able to evaluate them. If it's METHOD=GET then use $_GET. This is also a much more generic way to program since if you add a new variable to the form, you don't have to make it global in this function. if (myFunction($_GET)){ echo "Everything is hunky dory!"; } else { echo "Blow Chow"; } function myFunction($formArray=null){ if (isNull($formArray){ return false; } if (isarray($formArray)){ return true; } else { return false; } } // function myFunction($formArray=null) WARNING: I have not tried the code above. Use at your own risk. But the concepts are there. * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Paul Roberts [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 13, 2002 12:37 PM To: [EMAIL PROTECTED] Subject: [PHP] globals in functions Is there a quick way to set all variables as global so that they are avalible to a function, i'm doing an eval inside, so i need all the submitted variables to be avalible, or do i have to decalre them individualy. Paul Roberts [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] special charicters in form output
If you are using METHOD=GET, your browser is probably doing it. Try METHOD=POST =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Paul Roberts [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 13, 2002 12:14 PM To: php Subject: [PHP] special charicters in form output when i enter sZZsçe in to a form it's changed to sŹZşçę I didn't code it to change it to html special characters, is php doing this? Paul Roberts [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: RE: [PHP] Including only I want
I guess it would help if you explained what you are trying to do. the answer to your initial question is no. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Alberto Wagner [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 13, 2002 5:09 AM To: [EMAIL PROTECTED]; Php General Mailling List Subject: Re: RE: [PHP] Including only I want But its exactely what I don't want 13/04/2002 11:11:54, "Cal Evans" <[EMAIL PROTECTED]> wrote: >Break those lines out into another file... >=C= >* >* Cal Evans >* Journeyman Programmer >* Techno-Mage >* http://www.calevans.com >* > > >-Original Message- >From: Alberto Wagner [mailto:[EMAIL PROTECTED]] >Sent: Saturday, April 13, 2002 4:33 AM >To: Php General Mailling List >Subject: [PHP] Including only I want > > >Is there any way to include only the lines that I want in an other PHP file? > >something like Include(); > >like lines number 5,6 and 7. > >only this ones and not the entire script? > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mailings Lists?
www.list.org * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Randum Ian [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 13, 2002 7:44 AM To: PHP Subject: [PHP] Mailings Lists? Hi there, I want to be able to send an email to '[EMAIL PROTECTED]' and have it sent to everybody in my 'newsletter' database. Are there any resources online that would show me how to do this? Ive searched but found nothing so far. Regards, Ian. ___ Ian Roke Webmaster, DancePortal (UK) Limited [EMAIL PROTECTED] http://www.danceportal.co.uk DancePortal.co.uk - Global dance music media -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Including only I want
Break those lines out into another file... =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Alberto Wagner [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 13, 2002 4:33 AM To: Php General Mailling List Subject: [PHP] Including only I want Is there any way to include only the lines that I want in an other PHP file? something like Include(); like lines number 5,6 and 7. only this ones and not the entire script? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Secure storage of credit card information
Jason, You are of course correct in your statement that running the database on a separate server does not solve the problem. I contend that it is a problem that cannot be solved. The best we can hope for is to make it so difficult that all but the most persistent give up. Move the CC info onto it's own, isolated server, is one step in that direction. I did not mention it but you are again correct, some type of encryption is called for as well. Pick you flavor but by all means, encrypt the info. I would caution against using the users password as the key though because if the user changes his/her password, it may leave the cc numbers mangled for life. Something a bit more permanent like their login (which is usually not changeable), their memberID or possibly a random number generated and stored in the database with the users record but never returned to the browser. My advise was not meant to assist in preventing someone from using malicious web code to access the information. I was trying to help with physical security of the data by adding an additional layer of security on top of anything done in code. Securing the data separately from everything else does have the advantage of not compromising very sensitive data if the rest of the data is compromised. My $0.2 worth, again, not arguing with you...:) =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: SHEETS,JASON (Non-HP-Boise,ex1) [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 10, 2002 12:07 PM To: 'Someone Somewhere'; [EMAIL PROTECTED] Subject: RE: [PHP] Secure storage of credit card information Storing credit card numbers is dangerous, look at the mcrypt functions like previously mentioned. I would encrypt the user's credit card number with a key based on their account password this gives you the ability to not store the encryption key on the webserver. You should mangle it, encrypt it with a temp key, etc. I would mangle their password someway to make it a more secure password, don't trust a user to pick a safe or secure password. Make sure you store the users password as an md5 hash so that if your machine is compromised the bad guys can't easily get your users passwords. Just running the database server on an isolated machine does not solve the problem of keeping the data secure, neither does running a firewall between the two, obviously your web server needs access to the database, that in itself will enable a "bad guy" to access your database once he has access to your web server because the firewall allows access from your webserver to the database server, speed of connection to the database server doesn't really matter, how long does it take to transfer 16 characters?, if you are not using encryption or store the key on your web server he has full access to all of your credit card numbers. Secure both your webserver and your database server and the host os they run on (I would NOT use Windows), run tripwire or another similar program to monitor your PHP scripts, if someone were to hack your machine they could modify your PHP code to email them your users passwords, also conduct all transactions accross at least 128 bit SSL. Do NOT store the credit card number or login password unencrypted in a session, sessions are plain text by default and someone with access to your machine can read the session files or access your database and read the information. Make sure you really need to store credit cards, one bug and some script kiddie has your credit card information. Jason -Original Message- From: Someone Somewhere [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 10, 2002 10:48 AM To: [EMAIL PROTECTED] Subject: [PHP] Secure storage of credit card information I'm working on a e commerce site and I need to store the credit card info of people who purchase stuff, on the site. How can I encrypt the credit card # put it in a dbase and decrypt it when I need to Using Php4.* and Mysql. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Secure storage of credit card information
DISCLAIMER: Use this advice at your own risk. If you take my advice and your cc numbers still get stolen, your fault, not mine. By continuing to read this, you agree to these terms. Put them in a separate database, on a different server, behind a firewall, that is ONLY running MySQL and sh. Shut EVERYTHING else off, lock it down hard, remove all logins other than the ones necessary for the box's operation. Set your hosts.allow to only allow access to the box from the webserver. Then, in your PHP, retrieve them with a separate Select using a memberID or userID as the FK from the main database. Change the mysql password daily. Make sure it's different form the password to get into your main server. Is this secure? No. Does it make it harder to get the CC info? Yes. Harder is all you can hope for. Impossible is...well, impossible. :) HTH, =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Someone Somewhere [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 10, 2002 11:48 AM To: [EMAIL PROTECTED] Subject: [PHP] Secure storage of credit card information I'm working on a e commerce site and I need to store the credit card info of people who purchase stuff, on the site. How can I encrypt the credit card # put it in a dbase and decrypt it when I need to Using Php4.* and Mysql. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] unsetting an instance from within its class
Never actually tried to do this (Never actually thought it was a good idea) but: this = null; may do the trick. Then again it may cause your php page to blow chow all over your screen. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 10, 2002 11:04 AM To: [EMAIL PROTECTED] Subject: [PHP] unsetting an instance from within its class Is there a way to unset or destroy an object instance from a method within its class? I'm trying to write a method that destroys its instance but I'm not sure how to refer to the object itself from within the class. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] arguments against php / mysql?
1 is outdated information. I've had a production server up for a year now without a hitch. (Linux, Apache/MySQL/PHP) I'm sure others have a much longer track-record than mine. #2: True. Don't use IIS, use Apache. Then you can run PHP as a module of Apache, not as a CGI. Better but still has issues. (Then again, just straight IIS has more issues than any option) #3 Write your own or use ht-dig. (is that available on Windows?) I switched a smallish site form NT 4.x/IIS/ASP/M$SQL (2 servers) to Linux/APache/PHP/MySQL. My uptime has dramatically improved and I saved $15,000 in licensing fees that M$ was going to charge me to move to Win2k/SQL2k. (And I missed out on the whole CodeRed thingy!) Why anyone would put up a Windows server on the Internet these days is beyond me. It costs more, it's less reliable and if the argument is 'accountability', go back and read your EULAs. (The word blameless is in there for a reason!) Bottom line, I can't help you argue using PHP/MySQL on a Windows platform. The problem is not the technology, it's the platform. L.A.M.P, however, is the most stable platform I've ever used for web site/web based application development. =C= Get on the M$ treadmill. There's a toll-booth every 10 steps. * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Mallen Baker [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 10, 2002 11:30 AM To: > Subject: [PHP] arguments against php / mysql? Hi - the company we're talking to about doing some work on a simple site / database is trying hard to persuade us that Windows-based PHP / mysql is not the route to go. The arguments are as follows: 1. XXX's experience that MySQL is less than 100% stable when running on a windows platform (main problem being unexpected database shutdowns while applications are being used). 2. The fact that the recommended mode for running PHP on a windows platform (the CGI binary) uses technology that is now reasonably old and will consequently result in a hit to the server performance and memory management and the associated possible lack of scalability. 3. Loss of verity - the powerful search engine bundled with Cold Fusion. Searches may be significantly slower on the new site. I have had some experience using php/mysql on linux/apache - but don't have enough information to know whether this advice is sound or not. Can anyone please advise - is there anything in these arguments? If so, are there ways around the problems. We very much want to use these technologies due to the open source aspects. Thanks - Mallen This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Issues with long SQL inserts
Wow! Nope, I'm stumped now. It does seem to be a problem with PHP handing large blocked of text but as I've personally posted 8k of test from a form into a text field I'll be dogged if I know what's happening. Any possibility that it's a quotes problem? If you view the source, is there a PHP error masked by an HTML tag in there? (grasping at straws here) =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Chris Snyder [mailto:[EMAIL PROTECTED]] Sent: Sunday, March 31, 2002 5:22 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Issues with long SQL inserts Cal Evans wrote: >Sorry, I've reached the end of my tech-support flow-chart. You might want >to try 2 things: > >1: Fire up the MySQL client of choice and do the insert manually. If it >works there. If it does then at least you've isolated the problem to PHP or >your script. If not then you've eliminated your script and PHP form the >list. > I altered the add.php script to print the query to screen instead of sending it to MySQL to try this. It still acted the same, regardless of whether it was sending it to the MySQL server or printing it. In fact, it even had the same reaction when I commented out the print command as well. This appears to be something in the form-handling of PHP. Any ideas now? Thanks for all your help. > >2: post the question, along with the results from the above experiment and >any other relevant information to the mysql list. (www.mysql.com if you are >not a member, there;s info on joining there) My guess is that it's a MySQL >problem and there are people there who could help you better than I. > Well, I guess I won't do that now - MySQL seems to not be the culprit. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Issues with long SQL inserts
Sorry, I've reached the end of my tech-support flow-chart. You might want to try 2 things: 1: Fire up the MySQL client of choice and do the insert manually. If it works there. If it does then at least you've isolated the problem to PHP or your script. If not then you've eliminated your script and PHP form the list. 2: post the question, along with the results from the above experiment and any other relevant information to the mysql list. (www.mysql.com if you are not a member, there;s info on joining there) My guess is that it's a MySQL problem and there are people there who could help you better than I. Sorry I wasn't more help, =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Chris Snyder [mailto:[EMAIL PROTECTED]] Sent: Sunday, March 31, 2002 5:06 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Issues with long SQL inserts Cal Evans wrote: >I'm not up on the exact spec on MySQL but if it has an 'unlimited' text type >then it is a rarity among SQL engines. M$SQL's limit is (used to be?) 8MB >in a single text field. > >FoxPro/dBase had an unlimited text field but that's not so must a SQL engine >as a file format. > >My guess is that you are banging your head against the upper limit. I did >notice that it has a BIGTEXT type. Maybe try that. It still won't solve >the problem but it may give you more room. > Well, not strictly unlimited, but it basically is for my purpose - according to the manual, it's 65535 chars - I'm at around 8000-9000 right now, much lower than the limit. I tried going to mediumtext - limit of 16777215, and it acts the same. Both are quite a bit above what I'm trying to do. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Issues with long SQL inserts
I'm not up on the exact spec on MySQL but if it has an 'unlimited' text type then it is a rarity among SQL engines. M$SQL's limit is (used to be?) 8MB in a single text field. FoxPro/dBase had an unlimited text field but that's not so must a SQL engine as a file format. My guess is that you are banging your head against the upper limit. I did notice that it has a BIGTEXT type. Maybe try that. It still won't solve the problem but it may give you more room. HTH, =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Chris Snyder [mailto:[EMAIL PROTECTED]] Sent: Sunday, March 31, 2002 4:45 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Issues with long SQL inserts Cal Evans wrote: >Have you tried shaving the article off a couple of chrs before the last one >and seeing if the insert works? Also, what is the size limit on a MySQL TEXT >field? > >http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#BL O >B > Thanks for the quick response. I looked at the MySQL doc, and it didn't seem to offer any explanation. The column type is text, with no limit, which theoretically should give me around 8 meg - I'm getting around 8-9K. The docs say that memory might be a problem, but the server has 512 meg, with 40 meg free, and around 450 meg of swap - shouldn't be a problem. >-Original Message- >From: Chris Snyder [mailto:[EMAIL PROTECTED]] >Sent: Sunday, March 31, 2002 3:43 PM >To: [EMAIL PROTECTED] >Subject: [PHP] Issues with long SQL inserts > > >Server is running PHP 4.1.2, APC 1.1.0pl1, MySQL 3.23.47, Apache 1.3.23 >on a built-from-scratch Linux system with kernel 2.4.17, glibc 2.2.5, >and gcc 3.0.4. > >I'm using a fairly simple script to take input from a form, and add it >to a database. The database has the following structure: >ID - mediumint(8), primary key, auto_increment >Added - date >Modified - timestamp(8) >Title - varchar(60) >Text - text > >What's happening is whenever I try to add an article that has text with >a size of over around 9 KB, the browser never finishes loading, and the >article doesn't appear in the list. When I hit the stop button on the >browser, the article will then appear in the article list, but >incomplete - it is always cut off at the same spot. > >This sounds like some kind of buffer issue, but I've looked through all >of the applicable settings that I could find in both my PHP and MySQL >configuration files, and have found nothing. Any ideas? Thanks in >advance. To see the source code for this script, go to >http://test.mvpsoft.com/add.txt . Thanks in advance for any help! > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Issues with long SQL inserts
Have you tried shaving the article off a couple of chrs before the last one and seeing if the insert works? Also, what is the size limit on a MySQL TEXT field? http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#BLO B May give a hint. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Chris Snyder [mailto:[EMAIL PROTECTED]] Sent: Sunday, March 31, 2002 3:43 PM To: [EMAIL PROTECTED] Subject: [PHP] Issues with long SQL inserts Server is running PHP 4.1.2, APC 1.1.0pl1, MySQL 3.23.47, Apache 1.3.23 on a built-from-scratch Linux system with kernel 2.4.17, glibc 2.2.5, and gcc 3.0.4. I'm using a fairly simple script to take input from a form, and add it to a database. The database has the following structure: ID - mediumint(8), primary key, auto_increment Added - date Modified - timestamp(8) Title - varchar(60) Text - text What's happening is whenever I try to add an article that has text with a size of over around 9 KB, the browser never finishes loading, and the article doesn't appear in the list. When I hit the stop button on the browser, the article will then appear in the article list, but incomplete - it is always cut off at the same spot. This sounds like some kind of buffer issue, but I've looked through all of the applicable settings that I could find in both my PHP and MySQL configuration files, and have found nothing. Any ideas? Thanks in advance. To see the source code for this script, go to http://test.mvpsoft.com/add.txt . Thanks in advance for any help! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is it possible to call an external client or server program?
If you are running a PHP script (like a shell script or a batch file) then you can use the back tiks (`) to execute a command on the machine that the PHP script is running on. (On my keyboard the backtik is on the same key as the tilde.) But if you are running this out of a web server then not really. Since the PHP never gets executed on the client machine. The best you could hope for was a JavaScript/VBScript solution. Of the two, I'd look hardest at VBscript since M$ likes it better. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: martinahingis [mailto:[EMAIL PROTECTED]] Sent: Sunday, March 31, 2002 7:05 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Is it possible to call an external client or server program? hmm.. very thanks Cal. I don't have any problem with security settings or another client side setting. Because actually I'm using PHP for an application (but not a web application) just works for the machine which is the server or in the same LAN with the werver. And all settings of their browsers are made by me. So that i can make all settings proper to do so. Also OS is win98 or maybe win2000. Most scanner's user interfaces can absolutely do their job perfect on scanning and sending the output to the caller. But the only problem here I understand is that it's not possible to call an EXE file? "Cal Evans" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Martina, > > If you mean, from within a browser, is it possible to invoke a program on a > client's machine then...yes, with a caveat. If the OS is windows, and the > program has a COM interface and the user has set the security settings to a > moronically low level, it is possible to invoke COM objects via either > VBScript or JavaScript. (JSrcipt). > > It's not a good idea. From your side, since you have little or no control > over it. From the users side, they have to lower their security settings to > allow you to do it. Users who know that means won't want to. Those who > don't will require a lot of hand holding. > > My $.02 worth. Hope you found an answer somewhere among the rant. :) > > =C= > > * > * Cal Evans > * Journeyman Programmer > * Techno-Mage > * http://www.calevans.com > * > > > -Original Message- > From: martinahingis [mailto:[EMAIL PROTECTED]] > Sent: Sunday, March 31, 2002 6:26 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Is it possible to call an external client or server > program? > > > Is it possible to call an external program via PHP. The program will most > probably be in server. > > My aim is to call a scanner input program and want the client to scan a > paper and upload it. > > thanks for help. > > martina. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is it possible to call an external client or server program?
Martina, If you mean, from within a browser, is it possible to invoke a program on a client's machine then...yes, with a caveat. If the OS is windows, and the program has a COM interface and the user has set the security settings to a moronically low level, it is possible to invoke COM objects via either VBScript or JavaScript. (JSrcipt). It's not a good idea. From your side, since you have little or no control over it. From the users side, they have to lower their security settings to allow you to do it. Users who know that means won't want to. Those who don't will require a lot of hand holding. My $.02 worth. Hope you found an answer somewhere among the rant. :) =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: martinahingis [mailto:[EMAIL PROTECTED]] Sent: Sunday, March 31, 2002 6:26 PM To: [EMAIL PROTECTED] Subject: [PHP] Is it possible to call an external client or server program? Is it possible to call an external program via PHP. The program will most probably be in server. My aim is to call a scanner input program and want the client to scan a paper and upload it. thanks for help. martina. -- 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