Re: [PHP] Unexpected Notice message

2012-07-05 Thread RGraph.net support
Hi,

 that the code should be fixed.

Or the error reporting turned down... :-)

-- 
Richard, RGraph.net support
JavaScript charts for your website using RGraph
http://www.rgraph.net

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



[PHP] Is this list less busy than it used to be?

2012-07-04 Thread RGraph.net support
Hi,

Is this list less busy than it used to be? Or is it just me? When I
used to be on this list ISTR sometimes being overwhelmed by email.

Cheers

-- 
Richard, RGraph.net support
RGraph: JavaScript charts for your website
http://www.rgraph.net

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



Re: [PHP] Is this list less busy than it used to be?

2012-07-04 Thread RGraph.net support
Hi,

 https://docs.google.com/spreadsheet/ccc?key=0Ak1QF0ijPYbedDNvb19SQl80MHcxUWhhbTZOYm5FUlE

Yikes. That's a littled bit worrying. Or does it really mean that
everyone is getting much better with PHP? :-)

-- 
Richard, RGraph.net support
RGraph: JavaScript charts for your website
http://www.rgraph.net

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



Re: [PHP] Is this list less busy than it used to be?

2012-07-04 Thread RGraph.net support
Hi,

 My guess: The ecosystem has grown. Now much stuff, that were former
 (probably) asked here, is gone to more specific lists, like ZFs, Symfony,
 and so on. Maybe it's even already solveable via Twitter ;)

It would be nice if everyone had grown to be much better with PHP!
Though I think I've left behind now if that's the case... :-(

-- 
Richard, RGraph.net support
JavaScript charts for your website using RGraph
http://www.rgraph.net

COMMERCIAL license: RGraph commercial and government license only £99

FREE LICENSE: Using RGraph under the free license? Write a testimonial:
 http://www.rgraph.net/write-a-testimonial.html

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



[PHP] Hello again

2012-07-01 Thread RGraph.net support
Hi,

Just thought I'd say hello again. Back to brush up on my PHP a little
after a bit of a break - more reading than replying I'd imagine. I
have some pretty bad jokes too that I might surreptitiously insert
here and there...

Cheers.

-- 
Richard Heyes, RGraph.net support
RGraph: JavaScript charts for your website
http://www.rgraph.net

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



Re: [PHP] Re: Create unique non-autoincrement key for 700,000 records?

2008-12-16 Thread support

On Monday, December 15, 2008 7:29 PM, gould...@mac.com wrote:

I have a mySQL database with 700,000 records in it, which are presently 
keyed with an auto-increment field.


What I'd like to do is create another field with a field where each and 
every record number has a unique keyvalue. Example:  su5e23vlskd for 
records 1, and 34fdfdsglkdj4 for record 2.  All that matters is that 
it's unique, and isn't a number that can be guessed or an autoincrement 
number, where a hacker can just figure out the keyvalue by incrementing 
numbers.  It doesn't matter to me if each keyvalue field is just numbers, 
or a number/letter combination - - - all that matters is that each 
keyvalue field is unique.  Is there an automatic way that mySQL could do 
that, or would I need to write a php script to somehow go through each 
record and create this unique value?



Here is my answer to your question.
You can use this same logic to create unique id's for many things.
Hope this comes out okay in an email, if not I also put it online here:
http://www.bigdoghost.com/downloads/php-284646.html

?php

error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
ini_set('display_startup_errors','1');
ini_set('display_errors','1');


function dec2base($dec)
{
$digits = 23456789ABCDEFGHJKLMNPQRSTUVWXYZ;
$value = ;
$base  = strlen($digits);
while($dec$base-1)
{
 $rest = $dec % $base;
 $dec  = $dec / $base;
 $value = $digits[$rest].$value;
}

$value = $digits[intval($dec)].$value;
return (string) $value;
}

/*
// Step 1) define database connection

define('DB_HOST', 'localhost'); // Change this to the proper DB Host name
define('DB_USERNAME', 'myusername');  // Change this to the proper DB User
define('DB_PASSWD', 'mypassword'); // Change this to the proper DB User 
password

define('DB_NAME', 'mydatabase');  // Change this to the proper DB Name

@mysql_connect(DB_HOST, DB_USERNAME, DB_PASSWD) or die(Error: Database 
connection information is incorrect);
@mysql_select_db(DB_NAME) or die(Error: Database connection information is 
incorrect);


*/

/*
// Step 2) create test schema

CREATE TABLE IF NOT EXISTS `test` (
 `id` int(11) NOT NULL auto_increment,
 `mykey` varchar(20) NOT NULL,
 PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

*/


/*
// Step 3) create 700,000 records

for ($i=1; $i = 70; $i++)
{
@mysql_query(INSERT INTO test VALUES ('', ''));
}

*/

/*
// Step 4) update 700,000 records


// The larger this number is detrmines the size of mykey
$int = 100;

$result = @mysql_query(SELECT id FROM test ORDER BY id ASC);

if (@mysql_num_rows($result)  0)
{
while ($row = @mysql_fetch_object($result))
{
 // Add the two numbers together and base it
 $mykey = dec2base($int+$row-id);
 @mysql_query(UPDATE test SET mykey='.$mykey.' WHERE 
id='.$row-id.');

}
}

*/

? 



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



Re: [PHP] Clearing pipe stream and a few other issues.

2006-02-16 Thread Support
Permissions on a virtual server is the reason for running this script as a
cgi. It's not what prefer to do. However, this is only way php will work
under my user name. Perl would probably be a better alternative but I don't
know perl. If I had control of the apache server this would not be a
problem.

I have the script working, I just need to clear up these issues.

Zed

- Original Message - 
From: Chris [EMAIL PROTECTED]
To: zedleon [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Thursday, February 16, 2006 8:27 PM
Subject: Re: [PHP] Clearing pipe stream and a few other issues.



  ?
 
  $fp=popen(cat,r);
  $str=fgets($fp);
  pclose($fp);
 
  print $str;
 
  $arr = array();
  foreach (explode('', $str) as $v) {
  $split = explode('=', $v);
  // urldecode content for readability
  $arr[$split[0]] = urldecode($split[1]); // create assoc. array
  ${$split[0]} = urldecode($split[1]); // form the variables
  }
 
  //echo $sender_name . 'br/' . $arr['sender_name'];
  print_r($arr);
 
  $msg = Sender's Full Name: $sender_name\n;
  $msg .= Sender's E-Mail: $sender_email\n;
  $msg .= Secret Message? $sender_msg\n\n;
  ?
 

 What exactly are you trying to achieve and what problems were you having
 using it as a normal script?


 I'm guessing it's some form of a mailing script.

 What's wrong with using a regular php script with a mail command:

 ?php
 $sender_name = htmlentities($_POST['sender_name']);
 $sender_email = htmlentities($_POST['sender_email']);
 $sender_msg = htmlentities($_POST['sender_msg']);

 $msg = Name: $sender_name\n;
 $msg .= Email: $sender_email\n;
 $msg .= Message: $sender_msg\n;

 mail('');
 ?


 and then your form posts to this script (change the form action to point
 to this new file)...

 -- 
 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] Embedded Player

2006-01-20 Thread ET Support
You may also want to consider using frames, I've found that method to work
well when I want music to play continuously while a visitor surfs through
the site and it won't get stopped by popup blockers.

As for reducing file size, I found a program called CDex v1.51 to be very
effective... you can adjust the bitrate and that can greatly reduce the file
size... the home page for that was http://cdexos.sourceforge.net/ but seems
they need a new project manager, probably if you google CDex you'll find it.

Ben

-Original Message-
From: Brady Mitchell [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 19, 2006 7:03 PM
To: php-general@lists.php.net
Cc: Jedidiah
Subject: RE: [PHP] Embedded Player


 -Original Message-
 My reason for using an embedded player was basically just for
 design purposes, but perhaps that is not a good idea.  I did
 not consider the fact of not being able to leave the site
 while listening, and since these are as long as 40 minutes,
 this might get annoying.

Perhaps keeping your current setup and adding a link that opens an
embedded player in a popup window would be a good compromise.  That way
people who just want to stream the sermons can do so, and with the
player in a popup window they could still surf the web while listening.

As far as file format, it might be worth looking into using the OGG
Vorbis format.  There are players on Windows/Mac/Linux that support the
format and it uses compression, so the file sizes should be a bit
smaller than mp3s.  Take a look at http://www.vorbis.com/ for more info.

Just some ideas..

Brady

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



RE: [PHP] RE: header data being inserted into message

2006-01-18 Thread ET Support
Hi Richard,

Thanks for the response, however I do not want to have to use any special
classes or other software... I want to get it working just using the basic
php functions, which should be possible as far as I understand the php
documentation... if I keep finding that I can't get it working then maybe
I'll go to majordomo2.

Anyone else have some advice for me here?

Thanks,
Ben

-Original Message-
From: Richard Correia [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 17, 2006 12:37 PM
To: ET Support
Cc: php-general@lists.php.net
Subject: Re: [PHP] RE: header data being inserted into message


Hey,

You can use the readymase mailer class from
http://www.weberdev.com/get_example-462.html

and

http://www.weberdev.com/get_example-3724.html

Thanks
Richard


On 1/17/06, ET Support [EMAIL PROTECTED] wrote:
Hello all,

I am having a problem using PHP's mail function to send mail via BCC to
multiple recipients. Here's my code;
--
$get_emails = pg_exec($dbh,SELECT email FROM mailing_list WHERE conf = 1);
$count = pg_numrows($get_emails);
$bcc_count = $envelope_count = 0;
$bcc_limit = 200;
$subject = $body = 'test message';
$from = '[EMAIL PROTECTED]';
$header = From: $from\r\n;
for($x = 0; $x  $count; $x++) {
   $email = pg_result($get_emails,$x,0);
   if($bcc_count = $bcc_limit) {
   if($x  0) {
   $envelope_count++;
   mail($from,$subject,$body,$headers);
   }
   $headers = $header . Bcc: $email\r\n;
   $bcc_count = 1;
   } else {
   $headers .= Bcc: $email\r\n;
   $bcc_count++;
   }
}
# send the last envelope
mail($from,$subject,$body,$headers);
--

The problem is that for some recipients they get a message body like this;

--
Message-Id:  [EMAIL PROTECTED]
Date: Mon, 16 Jan 2006 17:06:40 + (GMT)

test message
--

Any idea why those headers are being inserted into the message body and how
that can be prevented?

Thanks,
Ben King
[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] RE: header data being inserted into message

2006-01-18 Thread ET Support
That did not work, however what does seem to work is changing all my \r\n to
just \n ... which I found after going over the php docs again at
http://www.php.net/manual/en/function.mail.php ... Note:  If messages are
not received, try using a LF (\n) only. Some poor quality Unix mail transfer
agents replace LF by CRLF automatically (which leads to doubling CR if CRLF
is used). This should be a last resort, as it does not comply with RFC
2822.

... we're using FreeBSD 4.11-STABLE so that must be in the category of one
of the poor quality Unix mail transfer agents

Thanks for the input!


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 18, 2006 11:29 AM
To: ET Support
Subject: RE: [PHP] RE: header data being inserted into message


what you're showing indicates that an MTA is getting confused about
the structure of the message and putting the message-id into the
body, rather than header.

you need to have a cr/lf (null line) between the header and the body,
otherwise the/an MTA can get things mixed up. so, when you exit your
bcc loop write out (another) \n.


 Original Message 
 Date: Wednesday, January 18, 2006 10:52:10 AM -0400
 From: ET Support [EMAIL PROTECTED]
 To: Richard Correia [EMAIL PROTECTED]
 Cc: php-general@lists.php.net
 Subject: RE: [PHP] RE: header data being inserted into message

 Hi Richard,

 Thanks for the response, however I do not want to have to use any
 special classes or other software... I want to get it working just
 using the basic php functions, which should be possible as far as I
 understand the php documentation... if I keep finding that I can't
 get it working then maybe I'll go to majordomo2.

 Anyone else have some advice for me here?

 Thanks,
 Ben

 -Original Message-
 From: Richard Correia [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, January 17, 2006 12:37 PM
 To: ET Support
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] RE: header data being inserted into message


 Hey,

 You can use the readymase mailer class from
 http://www.weberdev.com/get_example-462.html

 and

 http://www.weberdev.com/get_example-3724.html

 Thanks
 Richard


 On 1/17/06, ET Support [EMAIL PROTECTED] wrote:
 Hello all,

 I am having a problem using PHP's mail function to send mail via
 BCC to multiple recipients. Here's my code;
 --
 $get_emails = pg_exec($dbh,SELECT email FROM mailing_list WHERE
 conf = 1); $count = pg_numrows($get_emails);
 $bcc_count = $envelope_count = 0;
 $bcc_limit = 200;
 $subject = $body = 'test message';
 $from = '[EMAIL PROTECTED]';
 $header = From: $from\r\n;
 for($x = 0; $x  $count; $x++) {
$email = pg_result($get_emails,$x,0);
if($bcc_count = $bcc_limit) {
if($x  0) {
$envelope_count++;
mail($from,$subject,$body,$headers);
}
$headers = $header . Bcc: $email\r\n;
$bcc_count = 1;
} else {
$headers .= Bcc: $email\r\n;
$bcc_count++;
}
 }
# send the last envelope
 mail($from,$subject,$body,$headers);
 --

 The problem is that for some recipients they get a message body
 like this;

 --
 Message-Id:  [EMAIL PROTECTED]
 Date: Mon, 16 Jan 2006 17:06:40 + (GMT)

 test message
 --

 Any idea why those headers are being inserted into the message body
 and how that can be prevented?

 Thanks,
 Ben King
 [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

-- End Original Message --

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



[PHP] RE: parse string

2006-01-18 Thread ET Support
Hi Ron,

Not aware of an existing function for that task... but - since it looks like
all the value are strictly in quotes (=value) - if you know all the 'var's
ahead of time (such as 'carrier') then you could extract the data fairly
easily going through the data line by line checking with strpos and using
substr to get the values... it'll take some work, but it'll do the job...

Cheers,
Ben

-Original Message-
From: Ron Eggler (Paykiosks) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 18, 2006 2:12 PM
To: php-general@lists.php.net
Subject: parse string


Hi,

I need to parse a String like pasted below for all information (values)
those are included like 'var=value'. How can I do that? Are there any
XML-parsing functions available those'd fit for that job? I've ust found
that one (http://ca.php.net/simplexml) but it seems like i could use it
only for exctracting the 'terms' cause they're in the format that
simplexml
expects.
Thank you for every help!

[String]
xs:response xmlns:xs=urn:pinXpressSchema
SKUlisting
globalInfo slogan=Welcome to PayGo! supportPhone=1-866-339-3299/
carrierInfo carrier=Reconex (test)
icon=https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif; /
carrierInfo carrier=IDT POSA
icon=https://www.pinsprepaid.com/image.aspx?name=; /
carrierInfo carrier=IDT MasterCard
icon=https://www.pinsprepaid.com/image.aspx?name=; /
carrierInfo carrier=PLAYPHONE (Test)
icon=https://www.pinsprepaid.com/image.aspx?name=PlayPhone-200x100.gif; /
carrierInfo carrier=EWI POSA TEST
icon=https://www.pinsprepaid.com/image.aspx?name=PayGo_200_100.gif; /
carrierInfo carrier=IDT POSA
icon=https://www.pinsprepaid.com/image.aspx?name=; /
carrierInfo carrier=IDT Visa
icon=https://www.pinsprepaid.com/image.aspx?name=; /
carrierInfo carrier=Bell Mobility (TEST)
icon=https://www.pinsprepaid.com/image.aspx?name=; /
carrierInfo carrier=Boost Mobile (Test)
icon=https://www.pinsprepaid.com/image.aspx?name=c59-BoostMobile.gif; /
carrierInfo carrier=Cingular (test)
icon=https://www.pinsprepaid.com/image.aspx?name=cing-blue.gif; /
carrierInfo carrier=Page Plus (Test)
icon=https://www.pinsprepaid.com/image.aspx?name=pageplus.gif; /
carrierInfo carrier=T-Mobile (test)
icon=https://www.pinsprepaid.com/image.aspx?name=c29-t-mobile_ticketlogo.gi
f /
carrierInfo carrier=Unefon
icon=https://www.pinsprepaid.com/image.aspx?name=unefon_logo.gif; /
carrierInfo carrier=Verizon (test)
icon=https://www.pinsprepaid.com/image.aspx?name=verizon.gif; /
carrierInfo carrier=Virgin Mobile (test)
icon=https://www.pinsprepaid.com/image.aspx?name=Virgin+Mobile
+200x100.gif /
cardSKU category=Local Dial Tone/Telephone Service distributor=EWI
discontinued=false cardtype=PIN transactionType=PURC
  card cardID=180 carrier=Reconex (test) partNumber=PN-180
region=Optional Services (test) amount=5 wholesalePrice=4.5
icon=https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif;
upc=870368000420
cinfo costPerMinute= lifetime=0 longDistRate= roamingRate=
numberOfMin=/
  /card
  terms
Refer to the Reconex brochure for complete terms and conditions.
  /terms
  pinfo type=Optional Services value=Call Forwarding, Call Waiting,
Caller ID, Three Way Calling, Speed Dialing amp; Non-Published
Number/
/cardSKU
cardSKU category=Local Dial Tone/Telephone Service distributor=EWI
discontinued=false cardtype=PIN transactionType=PURC
  card cardID=181 carrier=Reconex (test) partNumber=PN-181
region=Optional Services (test) amount=10 wholesalePrice=9
icon=https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif;
upc=870368000437
cinfo costPerMinute= lifetime=0 longDistRate= roamingRate=
numberOfMin=/
  /card
  terms
Refer to the Reconex brochure for complete terms and conditions.
/terms
  pinfo type=Optional Services value=Call Forwarding, Call Waiting,
Caller ID, Three Way Calling, Speed Dialing amp; Non-Published
Number/
/cardSKU
cardSKU category=Local Dial Tone/Telephone Service distributor=EWI
discontinued=false cardtype=PIN transactionType=PURC
  card cardID=178 carrier=Reconex (test) partNumber=PN-178
region=Regional Refill (test) amount=52.99 wholesalePrice=47.7
icon=https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif;
upc=870368000413
cinfo costPerMinute= lifetime=0 longDistRate= roamingRate=
numberOfMin=/
  /card
  terms
Refer to the Reconex brochure for complete terms and conditions.
  /terms
  pinfo type=Basic Service value=Includes 30 days of basic service
in
select states.  Also includes variable state, federal amp; service line
fees/
/cardSKU
cardSKU category=Local Dial Tone/Telephone Service distributor=EWI
discontinued=false cardtype=PIN transactionType=PURC
  card cardID=177 carrier=Reconex (test) partNumber=PN-177
region=Regional Starter (test) amount=39 wholesalePrice=35.1
icon=https://www.pinsprepaid.com/image.aspx?name=c38-reconex_logo.gif;
upc=870368000406
cinfo costPerMinute= lifetime=0 longDistRate= roamingRate=
numberOfMin=/
  /card
  terms
Refer to the Reconex 

[PHP] RE: header data being inserted into message

2006-01-17 Thread ET Support
Hello all,

I am having a problem using PHP's mail function to send mail via BCC to
multiple recipients. Here's my code;
--
$get_emails = pg_exec($dbh,SELECT email FROM mailing_list WHERE conf = 1);
$count = pg_numrows($get_emails);
$bcc_count = $envelope_count = 0;
$bcc_limit = 200;
$subject = $body = 'test message';
$from = '[EMAIL PROTECTED]';
$header = From: $from\r\n;
for($x = 0; $x  $count; $x++) {
$email = pg_result($get_emails,$x,0);
if($bcc_count = $bcc_limit) {
if($x  0) {
$envelope_count++;
mail($from,$subject,$body,$headers);
}
$headers = $header . Bcc: $email\r\n;
$bcc_count = 1;
} else {
$headers .= Bcc: $email\r\n;
$bcc_count++;
}
}
# send the last envelope
mail($from,$subject,$body,$headers);
--

The problem is that for some recipients they get a message body like this;

--
Message-Id: [EMAIL PROTECTED]
Date: Mon, 16 Jan 2006 17:06:40 + (GMT)

test message
--

Any idea why those headers are being inserted into the message body and how
that can be prevented?

Thanks,
Ben King
[EMAIL PROTECTED]

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



[PHP] Parsing multiple XML documents as strings. Inbox

2004-12-06 Thread Goformusic Support
Hi,

We worked with Sablotron before but switched over to the libxslt
library on PHP5 to perform XSL transformations. We used the wrapper
code found on http://be.php.net/xsl so that our old xslt_ functions
continued to work.

Now, with Sablotron we used to parse multiple XML documents as strings
and one XSL file from disk. With libxslt it doesn't seem possible
parsing XML documents as strings.

This is the old method which worked fine, using Sablotron:

$args[/list_docu] = contentsome xml/content;
$result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $args, $params);

This node could then be access with XSL:
xsl:for-each select=document('arg:/list_docu')/content

When I run this code using libxslt/PHP5 and the wrapper I get the error:
Warning: I/O warning : failed to load external entity arg:/list_docu

This is because the XML documents must be saved on disk I guess.
Isn't there any way to load the XML documents as strings???

Grtz,

Bart

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



Re: [PHP] Upgrade PHP?

2004-08-01 Thread Support
I've dealt with a similar problem with Mandrake. Some distros have their own
idea of where things should go. I prefer to install major applications like
apache, perl, mysql, php myself and never install from rpm or accept default
distro packages when installing an os from scratch.

IMHO: Although handy for some things, I still can't figure out why people
put up with rpms. :-)

What I finally did is use rpm to uninstall php, apache, and mysql. I also
followed dependencies and deleted them as well.

This approach is not really a great idea if you're not used to building from
source, but I have my own idea of where I like things to go so this works
for me. Usually /usr/local is a good choice for installing.

Since mysql and apache both come with their own start up scripts using
chckconfig to add them to the system is about as easy as it gets.

Jim Grill
Web-1 Hosting
http://www.web-1hosting.net

- Original Message - 
From: Will Collins [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, August 01, 2004 8:03 PM
Subject: [PHP] Upgrade PHP?


 I'm having problems upgrading PHP from 4.2.2 to 4.3.8 on RedHat 9.  I've
 tried simply making the 4.3.8 from source, but RedHat didn't use the
default
 PHP folder structure is seems, since there has been no change in my PHP
 version.  I also tried the ./configure string returned by 'phpinfo()'
 (assuming that the correct path info was included) with no luck.  Does
 anyone have any tips on an easier way to upgrade?



 Thanks,

 Will



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



[PHP] mysqli prepapred SELECT statement

2004-07-16 Thread Support
Anyone working with php5/mysql 4.1 yet with the new ext/mysqli?

This has me stumped:

$stmt = $mysqli-prepare('SELECT * FROM users WHERE userid=?');

$stmt-bind_param('i', $userID);

$stmt-execute();

...now how to get the results??? I can't use bind_result() since I have no
clue how many columns `*' will retreive. I have been reading the docs now
for over two hours and need to get back to work :-)

$stmt-close();

Jim Grill

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



[PHP] Handling a BLOB (zip file) called from MySQL

2003-10-31 Thread SpyProductions Support Team

I am trying to figure out how to best handle a record that contains a zip
file (BLOB) in MySQL.

When I call it out from the table, is the best way to handle the file by
writing it to a temporary directory?

The BLOB represents a '.zip' file,  so should I be using: zip_open /zip_read
/ zip_close when loading and retrieving the file to/from the data table?  Or
would fopen and such in binary mode be sufficient?

I don't need to open the zip file and see what is inside per se - just want
to store into the data table and pull it out as a file that can be
downloaded.

:)

Thanks!

-Mike

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



[PHP] FAQ in PHP

2003-09-15 Thread Suresh Babu.A [Support]
Hi Team,

How to track a posting in a faq using mysql.

Thanks in advance.

Suresh A.

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



[PHP] PHP files processing with Apache

2003-08-21 Thread SpyProductions Support Team

Does anyone know how to get apache to process ALL files for php?  What would
the settings be in a Virtual Host listing (or a plain host listing for that
matter)?

Thanks!

:)

-Mike



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



[PHP] Your details

2003-08-20 Thread support
See the attached file for details
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] HOW TO -- ARRAY UPDATE MYSQL

2003-07-20 Thread Suresh Babu.A [Support]
Hi ALL,

I just want to validate each  row values of a and load the same in MYSQL
Table.

Suresh A.


On Sat, 19 Jul 2003, Curt Zirzow wrote:

 Suresh Babu.A [Support] [EMAIL PROTECTED] wrote:
  
  HI ALL,
  
  I want to update a mulitple row from a HTML Table to MYSQL Database.
  
  L1 V1 T1
  L2 V2 V2
  L3 V3 V3
 Can you expand on this a little more, it's a bit vague.
 
  
 
 -- 
 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] HOW TO -- ARRAY UPDATE MYSQL

2003-07-19 Thread Suresh Babu.A [Support]

HI ALL,

I want to update a mulitple row from a HTML Table to MYSQL Database.

L1 V1 T1
L2 V2 V2
L3 V3 V3


Any help in this regard is much appreciated.

Suresh 


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



[PHP] header(); Issue

2003-06-19 Thread SpyProductions Support Team

I have this in a script:

header(Location: $Relative/outstanding.php?pdd=1pddid=$poid);

It works fine elsewhere in the script without the variables.  Does anyone
know if php 4.06 has issues with this?  Or am I making a boneheaded mistake
here?

$Relative is from an include, and outputs fine.  :)

Thanks!

:)

-Mike



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



[PHP] PHP vs. CGI

2003-03-05 Thread SpyProductions Support Team

Does PHP use less system resources than CGI on a server?

I have a bulletin board which is incredibly active, but there is a PHP
sister to it.

Thanks,

-Mike



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



[PHP] Counting table fields having specific values

2003-02-27 Thread rentAweek support
 I have a table where the row named hide can have a value 0 or 1.
I want to obtain a count of all the rows where hide has value 0.
The following works on mysqladmin:

SELECT SUM( hide = 0 ) FROM `names` LIMIT 0, - 1 

Giving

SUM( hide = 0 ) 
7

The PHP script statements generated are:

$sql = 'SELECT SUM( hide = 0 ) FROM `names` LIMIT 0, -1';
$result = mysql_query($sql);
What assignment statement do I need to write now to obtain the SUM value 
as shown by mysqladmin please?

TIA

Mike





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


Re: [PHP] Text data truncated after first blank character in form fields

2003-02-18 Thread rentAweek support
Errnest

Thanks. I used htlmentities and still have the truncation.

Mike

---

Ernest E Vogelsinger wrote:


At 22:04 17.02.2003, Michael Eacott said:
[snip]


When I have the following in a form:
?php $testvar = a b c; ?
input type=text size=20 name=testvar value=?php echo $testvar; ?
the value shown in the form field is   a and not a b c
why?
and how can I get to see the untrucated text, please?


[snip] 

You should always place quotes around the Value parameter;

input type=text size=20 name=testvar value=?php echo $testvar; ?

Additionally you should always htmlencode the value parameter:

input type=text size=20 name=testvar 
value=?php echo htmlentities($testvar); ?







Re: [PHP] Text data truncated after first blank character in form fields

2003-02-18 Thread rentAweek support
Kevin

I tried flushing and also IE 6 and Netscape  6.2. Still getting truncation.

Mike

---

Kevin Stone wrote:


Hmm.  Don't know what to tell ya.  It works on my computer.  Have you tried
pressing CTRL+F5 to flush your browser cache?
- Kevin

- Original Message -
From: rentAweek support [EMAIL PROTECTED]
To: Kevin Stone [EMAIL PROTECTED]
Cc: Michael Eacott [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Monday, February 17, 2003 3:12 PM
Subject: Re: [PHP] Text data truncated after first blank character in form
fields



Thanks

I tried our your suggestion sic:
input type=text size=20 name=testvar value=?php echo $testvar;


?


Still truncation

Mike
---
Kevin Stone wrote:


It's your HTML  Failing to enclose the value in quotes may lead to
truncation.  Your output looks like this...
input type=text size=20 name=testvar value=a b c

You should always quote every parmeter in the tag just to avoid such
problems.  This should work..
input type=text size=20 name=testvar value=?php echo


$testvar;?


- Kevin

















Re: [PHP] Text data truncated after first blank character in form fields

2003-02-17 Thread rentAweek support
Thanks

I tried our your suggestion sic:
input type=text size=20 name=testvar value=?php echo $testvar; ?
Still truncation

Mike
---
Kevin Stone wrote:


It's your HTML  Failing to enclose the value in quotes may lead to
truncation.  Your output looks like this...
input type=text size=20 name=testvar value=a b c

You should always quote every parmeter in the tag just to avoid such
problems.  This should work..
input type=text size=20 name=testvar value=?php echo $testvar;?

- Kevin















Re: [PHP] Help with POSTing variable array names from a PHP script please.

2003-02-15 Thread rentAweek support
Jason

Thanks for your help .

I've implemented you advice. The problem persists in that I'm trying 
create the following situation:
When the posted action php script runs I want the retrieved $_POST array 
to contain such information that the action script can find out what 
checkboxes were clicked and from there the library books to retrieve.
So what do I need to write:
1. for the checkbox line in the driving script, e.g. 

type=checkbox name=??? value =ON

2. in the action script, e.g.

$result = $_POST[???];

Mike

---

Jason Wong wrote:

On Saturday 15 February 2003 17:05, Michael Eacott wrote:


? php

# Show details of BOOKS

# Performing SQL query

$query = SELECT * FROM `$books` WHERE `title` LIKE '$title' LIMIT 99;
$result = mysql_query($query) or die(Query failed);

$count = 1; $bookslist = ;
while ($rowarray = mysql_fetch_array($result, MYSQL_ASSOC))
{



Your while loop is loop at the wrong place. Look at the HTML source of your 
page ...

   $booksid = $rowarray[booksid];
   $title = $rowarray[title];
   print 'html';
   print 'head';
   print 'meta http-equiv=Content-Language content=en-us';
   print 'meta http-equiv=Content-Type content=text/html;
charset=windows-1252';



[snip]

... these are all repeated for each book. Clearly that's not what you want.


   print 'pClick box get  following book retrieved. 


Your loop should start here:


input
type=checkbox name=book[1][$booksid] value =ON br';



You've setup a counter ($count) so make use of it:

input type=checkbox name=book[$count][$booksid] value =ON 







[PHP] while loop- will this work?

2003-01-30 Thread SpyProductions Support Team


Should this work?

$f1 = rand(999,999);

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

$f1 = rand(999,999);

}


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

Thanks,

-Mike



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




[PHP] URLencode issues - halp!

2003-01-23 Thread SpyProductions Support Team

I am having some issues, apparently, with URL encode.

I've got people signing up for a membership on a site, but some of their
memberships fail because the username, which in encoded, sometimes goes
through fine and sometimes does not.

Are there any special reasons this may happen?

I decided to use this because people are allowed to use *any* key as part of
their name, so a name like rt'$%^*'rt is perfectly allowable.

The strange thing is, more normal names like 'star99' or just 'logmein' are
failing, but the weirder character typed names are making it through fine.

Any ideas?

Oh, and BTW, I do use urldecode().  :)

Thanks,

-Mike



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




RE: [PHP] URLencode issues - halp! - code included

2003-01-23 Thread SpyProductions Support Team

Here is some code:

From a form, I get username as $name and it goes to the processing file for
the form, where a sale happens and it sends the code to a different server
like this:


$data = urlencode($name);
print META HTTP-EQUIV='refresh'
CONTENT='0;URL=http://somedestination.php?name=$data';



That server then processes the person and puts them into the MySQL - but if
the name is bad, it errors out and stops the script:

$name = urldecode($name);
if(!$name) { print You entered an invalid name.  Please stop and call us
at; }
else {  Inserts record into database. }



That's it.  It doesn't seem to matter what the name entered is; there is no
rhyme or reason (seemingly) to the names it fails on (as per my previous
post).

urlencode may just be a flaky thing to use?  Perhaps depending on the
browser?

Thanks,

-Mike







 -Original Message-
 From: David T-G [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 23, 2003 3:31 PM
 To: PHP General list
 Cc: SpyProductions Support Team
 Subject: Re: [PHP] URLencode issues - halp!


 Mike --

 ...and then SpyProductions Support Team said...
 %
 % I am having some issues, apparently, with URL encode.
 ...
 %
 % I decided to use this because people are allowed to use *any*
 key as part of
 % their name, so a name like rt'$%^*'rt is perfectly allowable.

 Makes sense, but I'd use base64_encode (with base64_decode, of course)
 rather than urlencode; it will properly shield everything.  No, I don't
 know why 'normal' names fail and goofy ones don't; without some code and
 some specific examples we can't really tell too well :-)


 HTH  HAND

 :-D
 --
 David T-G  * There is too much animal courage in
 (play) [EMAIL PROTECTED] * society and not sufficient moral courage.
 (work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science
 and Health
 http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!





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




RE: [PHP] URLencode issues - halp! - code included

2003-01-23 Thread SpyProductions Support Team
So what is the decode part for then?  Earlier versions of PHP?

:)

Thanks,

-Mike

  -Original Message-
  From: Leif K-Brooks [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, January 23, 2003 4:43 PM
  To: [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] URLencode issues - halp! - code included


  Take the
$name = urldecode($name);bit out.  The decoding is all handled by PHP before
your script runs.  Also, you should look into using $_GET['name'] instead of
$name.

  SpyProductions Support Team wrote:

Here is some code:

From a form, I get username as $name and it goes to the processing file for
the form, where a sale happens and it sends the code to a different server
like this:


$data = urlencode($name);
print META HTTP-EQUIV='refresh'
CONTENT='0;URL=http://somedestination.php?name=$data';



That server then processes the person and puts them into the MySQL - but if
the name is bad, it errors out and stops the script:

$name = urldecode($name);
if(!$name) { print You entered an invalid name.  Please stop and call us
at; }
else {  Inserts record into database. }



That's it.  It doesn't seem to matter what the name entered is; there is no
rhyme or reason (seemingly) to the names it fails on (as per my previous
post).

urlencode may just be a flaky thing to use?  Perhaps depending on the
browser?

Thanks,

-Mike







  -Original Message-
From: David T-G [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 3:31 PM
To: PHP General list
Cc: SpyProductions Support Team
Subject: Re: [PHP] URLencode issues - halp!


Mike --

...and then SpyProductions Support Team said...
%
% I am having some issues, apparently, with URL encode.
...
%
% I decided to use this because people are allowed to use *any*
key as part of
% their name, so a name like rt'$%^*'rt is perfectly allowable.

Makes sense, but I'd use base64_encode (with base64_decode, of course)
rather than urlencode; it will properly shield everything.  No, I don't
know why 'normal' names fail and goofy ones don't; without some code and
some specific examples we can't really tell too well :-)


HTH  HAND

:-D
--
David T-G  * There is too much animal courage in
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science
and Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!







--
The above message is encrypted with double rot13 encoding.  Any unauthorized
attempt to decrypt it will be prosecuted to the full extent of the law.



Re: [PHP] Date Formatting

2002-12-13 Thread Support @ Fourthrealm.com
Use this:
function makedate($format, $indate)
{
$temp = explode(-, $indate);
$fulldate = mktime(0, 0, 0, $temp[1], $temp[2], $temp[0]);
$temp = date($format, $fulldate);
return ($temp);
}

and call it with this:
makedate(F d, Y, $row-datefield);

where $row-datefield is the variable of the date field in your table.


Peter


At 11:55 AM 12/13/2002 -0600, you wrote:

How can I format a date coming out of a MySQL? I know how to format 
today's date but not a date coming out of MySQL. I have looked through the 
manual, but I must be blind because I cannot figure it out.

Thanks,
Clint

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] Show only user that variable musiccontain pop

2002-11-27 Thread Support @ Fourthrealm.com

If you only have one condition, then get rid of the AND in the where statement;

Select only the fields that you need, instead of *

Like this:

SELECT id FROM $TBL_NEWS WHERE music LIKE '%pop%'  ORDER BY name


Peter

At 03:16 PM 11/27/2002 -0500, Benjamin Trépanier wrote:

Hi, I need information about  a simple command...

I have a DB (of course...) and I need to show only ID that variable
musiccontain  pop

I found this example that is suppose to do a similar thing in a msql
query...

SELECT * FROM $TBL_NEWS WHERE music LIKE '%pop%' AND  ORDER BY name


So it's not working properly...

Thanks for your help

Ben


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


- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] scrolling data from db

2002-11-20 Thread Support @ Fourthrealm.com
Eddie,
I use the attached on a site of mine... works with JavaScript and DIV tags.

There are 2 parts to the file - the javascript, and then the HTML code to 
make it happen.  Tweak according to your needs.

Peter


At 11:00 AM 11/20/2002 -0500, you wrote:
I have a large amount of data to present to the user.  Currently, I am just
putting it in a table and displaying it on the page, if it is more than a
page of course the page just scrolls.  Is there a way o, without using
frames, to put all the data from the db in the middle of the page with a
scroll bar on the side that just scrolls the data, I mean the header and
footer of the php page do not move?  I am sure I will need javascript for
this...right?

Thanks,
Eddie


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


- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -

!-- TWO STEPS TO INSTALL LAYER SCROLLER:

  1.  Insert the first code in a new file, save as popup.html
  2.  Add the opening code to the BODY of your main HTML document  --

!-- STEP ONE: Insert the first code in a new file, save as popup.html  --

HTML
HEAD

SCRIPT LANGUAGE=JavaScript
!-- Begin

//verScroll('up','1','true')

function verScroll(dir, spd, loop) {
loop = true;
direction = up;
speed = 10;
scrolltimer = null;
if (document.layers) {
var page = eval(document.contentLayer);
}
else {
if (document.getElementById) {
var page= eval(document.getElementById('contentLayer').style);
}
else {
if (document.all) {
var page = eval(document.all.contentLayer.style);
  }
   }
}
direction = dir;
speed = parseInt(spd);
var y_pos = parseInt(page.top);
if (loop == true) {
if (direction == dn) {
page.top = (y_pos - (speed));
} else {
if (direction == up  y_pos  10) {
page.top = (y_pos + (speed));
} else {
if (direction == top) {
page.top = 10;
  }
   }
}
scrolltimer = setTimeout(verScroll(direction,speed), 1);
   }
}
function stopScroll() {
loop = false;
clearTimeout(scrolltimer);
}
//  End --
/script
/head
body
div id=contentLayer style=position:absolute; width:300px; z-index:1; left: 39px; 
top: 51px 


insert your text here !!



/div
div id=scrollmenu style=position:absolute;width:200px;height:30px;z-index:1; 
left:400px; top: 40px
table border=1trtd
table
tr
td align=leftUp/td
td /td
td align=rightDown/td
/tr
tr
td colspan=3
a href=# onMouseOver=verScroll('up','25','true') 
onMouseOut=stopScroll()/a 
a href=# onMouseOver=verScroll('up','5','true') onMouseOut=stopScroll()/a 
a href=# onMouseOver=verScroll('up','1','true') onMouseOut=stopScroll()/a |
a href=# onMouseOver=verScroll('dn','1','true') onMouseOut=stopScroll()/a 
a href=# onMouseOver=verScroll('dn','5','true') onMouseOut=stopScroll()/a 
a href=# onMouseOver=verScroll('dn','25','true') onMouseOut=stopScroll()/a
/td
/tr
/table
/td/tr/table
/div
/body
/html







!-- STEP TWO: Add the opening code to the BODY of your main HTML document  --

BODY

center
form name=scrollwindow
input type=button value=Open Scroll Window 
onClick=window.open('popup.html','scrollwindow','top=100,left=100,width=575,height=400');
/form
/center

pcenter
font face=arial, helvetica SIZE=-2Free JavaScripts providedbr
by a href=http://javascriptsource.com;The JavaScript Source/a/font
/centerp

!-- Script Size:  7.99 KB --

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


RE: [PHP] scrolling data from db

2002-11-20 Thread Support @ Fourthrealm.com
Hi Eddie,
iFrames do offer a really nice solution, but they are an IE only 
tag.  Although I can't vouch for the latest Netscape, I know that the older 
versions simply ignore the iFRAME... tag, and leave a blank spot in its 
place.

If you know that your client base will ever only use IE, then go for 
it.  Otherwise, you'll have to avoid the iframe.


Peter

At 03:17 PM 11/20/2002 -0500, Edward Peloke wrote:
Thanks Peter!

I will take a look.  As I am new to javascript, why would someone use
javascript when iframes are easier?  Will I be able to use the javascript on
more browsers?  Are the iframes limited?

Thanks,
Eddie

-Original Message-
From: Support @ Fourthrealm.com [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 20, 2002 11:23 AM
To: Edward Peloke; [EMAIL PROTECTED]
Subject: Re: [PHP] scrolling data from db


Eddie,
I use the attached on a site of mine... works with JavaScript and DIV
tags.

There are 2 parts to the file - the javascript, and then the HTML code to
make it happen.  Tweak according to your needs.

Peter


At 11:00 AM 11/20/2002 -0500, you wrote:
I have a large amount of data to present to the user.  Currently, I am just
putting it in a table and displaying it on the page, if it is more than a
page of course the page just scrolls.  Is there a way o, without using
frames, to put all the data from the db in the middle of the page with a
scroll bar on the side that just scrolls the data, I mean the header and
footer of the php page do not move?  I am sure I will need javascript for
this...right?

Thanks,
Eddie


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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] scrolling data from db

2002-11-20 Thread Support @ Fourthrealm.com
Justin,
Creative thinking to a smart solution.  I will keep that in mind for future 
sites.

Peter

At 10:35 AM 11/21/2002 +1100, Justin French wrote:
 If you know that your client base will ever only use IE, then go for
 it.  Otherwise, you'll have to avoid the iframe.

That sounds a little harsh!

You can put a message in place of the iframe, for those who don't support
it.

iframe src= blah blah
Sorry, your browser does not support iframes, to view the content of this
frame, a href=click here/a.
/iframe

Or better still, you can actually PUT SOME CONTENT IN THERE.

I have an iframe which lists multiple tour dates for a band, sorted in date
order... if the iframe can be used, the user gets ALL upcomming gigs ina
scroller, otherwise they just get the next 3 (using approximately the same
amount of space), with a link to view all gigs.


iframes CAN work in many cases, if you think about it.


- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] date

2002-11-19 Thread Support @ Fourthrealm.com
Eddie,
This is a function that I wrote to handle this same situation:

# --- Function to format date output ---
function makedate($format, $indate)
{
$temp = explode(-, $indate);
$fulldate = mktime(0, 0, 0, $temp[1], $temp[2], $temp[0]);
$temp = date($format, $fulldate);
return ($temp);
}


Call it like this:

echo makedate(m/d/Y, $myrow[departdate]); #  returns  11/30/2002
echo makedate(F d, Y, $myrow[departdate]); #  returns 
November 30, 2002


You can use any of the standard date formatting commands in the function call.

HTH!

Peter



At 10:10 AM 11/19/2002 -0500, Edward Peloke wrote:
I am pulling from a datetime field in mysql.  The actual data looks like
this: 2002-11-30 00:00:00  When I output the data to the page, I want it to
appear as 11/30/2002.  I want to use a php date format.  I do not want it
formatted as it comes out of the db. But date(m/d/y, $myrow[departdate])
returns 12/31/69.  How can I do this?

THanks,
Eddie


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


- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] Seconds to minutes

2002-11-19 Thread Support @ Fourthrealm.com
Bob,
Instead of dividing, use modulus to get the exact number of remaining 
seconds, and then determine the minutes from that.

Here is some code that I've quickly adapted from another language I use, to 
take the total minutes, and convert it to hours:minutes display.

$totalmins = 193;
$showmins = $totalmins%60;
$showhrs = ($totalmins-$showmins)/60;
echo $showhrs.:.$showmins;

I haven't tested this, but it might give you a start.  The same concept 
would apply to converting seconds to minutes...

Peter


At 12:16 PM 11/20/2002 +1100, Bob Irwin wrote:
Its seems far more reliable than what I am using (dividing by 60 for
minutes, 3600 for hours and doing rounding, exploding if its not a round
number etc).

Its only for measuring short times, so Matt's suggestion should work ok.
Ideally though, because it will crop up from time to time, it'd be the go to
do it right the first time.

Anyone else know of a better way?

Best Regards
Bob Irwin
Server Admin  Web Programmer
Planet Netcom
- Original Message -
From: John W. Holmes [EMAIL PROTECTED]
To: 'Matt' [EMAIL PROTECTED]; 'Bob Irwin' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, November 20, 2002 12:09 PM
Subject: RE: [PHP] Seconds to minutes


  You can do something like this:
  ?php
   $seconds = 265;
   $time = date('i s',$seconds);
   $minSecs = explode(' ',$time);
   echo {$minSecs[0]} minutes and {$minSecs[1]} secondsbr\n;
  ?

 That doesn't work for anything over 3599 seconds, though...

 ---John Holmes...



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


 Scanned by PeNiCillin http://safe-t-net.pnc.com.au/

 Scanned by PeNiCillin http://safe-t-net.pnc.com.au/



Scanned by PeNiCillin http://safe-t-net.pnc.com.au/

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


- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




[PHP] Recommend a merchant/store product

2002-10-28 Thread Support @ Fourthrealm.com
Hey everyone,
For years I have used a fantastic merchant ( http://www.ihtmlmerchant.com 
), which is feature packed and easy to setup and use.  It's written in a 
competing language called iHTML ( http://www.ihtml.com ).

As I am getting considerably proficient at coding PHP, I find that I 
require a similar type merchant/store package that I can base future PHP 
e-commerce sites on.  I have mySQL and MS SQL Server available to me.

So... my questions to the list are:

1) What store product/package do you use?  Why?  URL?
2) What is purchase cost?  Is it one-time or per store?
3) What databases does it support?


Many thanks in advance.

Peter

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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



[PHP] Recommend a merchant/store product

2002-10-28 Thread Support @ Fourthrealm.com
Hey everyone,
For years I have used a fantastic merchant ( http://www.ihtmlmerchant.com 
), which is feature packed and easy to setup and use.  It's written in a 
competing language called iHTML ( http://www.ihtml.com ).

As I am getting considerably proficient at coding PHP, I find that I 
require a similar type merchant/store package that I can base future PHP 
e-commerce sites on.  I have mySQL and MS SQL Server available to me.

So... my questions to the list are:

1) What store product/package do you use?  Why?  URL?
2) What is purchase cost?  Is it one-time or per store?
3) What databases does it support?


Many thanks in advance.

Peter

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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



Re: [PHP] running slow on Win2k

2002-10-11 Thread Support @ Fourthrealm.com

More details on this...
As I pay more attention to when it is sluggish or not, I notice that it 
seems to run fine on a typical page, with or without mySQL connections.

But... the slowdown comes whenever I'm into my frame-based Admin, where 2-3 
frames are typically loading at the same time.  The same Admin structure 
written in another language is quick, but the PHP version seems slow.

I hope this can spark some new suggestions...

Thanks in advance...
Peter



At 11:19 AM 10/7/2002 -0400, you wrote:
Hi everyone,
I notice that my PHP runs really slow on Win2k Server w/ IIS 5, and even 
slower when accessing a mySQL database.  It's a PIII-800 with 256MB 
RAM.  It is otherwise a great machine, and fast.

Any suggestions?

Peter

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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




[PHP] Spiders, Sessions, trans SID, and mod_rewrite

2002-10-09 Thread Tech Support

Hello

I'm preparing to start an ecommerce project that will require the use of sessions 
throughout the entire site for referrer and affiliate tracking purposes. I also plan 
to use mod_rewrite to make links to dynamic content search spider friendly. example: 
instead of /somescript.php?var1=value1var2=value2 I'll have 
/somescript/var1/value1/var2/value2

The obstacle I'm facing is the automatic appending of the session id to every link 
upon first entering the site and to every link on every page of the site if session 
cookies are disabled. This will make search spiders either not index the linked pages, 
or worse index them with an old session id!

I am hoping to find two solutions to dealing with this inherent problem with sessions, 
spiders, trans sid, and url rewriting.

1) I am thinking of obtaining and using a list of known spiders to determine if the 
visitor is a spider. If they are a spider I simply won't call session_start() thus 
eliminating the auto appending of the session id to every link. URL rewriting will 
take care of the ugly query strings and I'm in business to get spidered. How ever, 
this could mean a lot of overhead if the site gets busy and a lot of work keeping an 
updated spider list. Does anyone have a solution for this? I want some real world 
experience here please.

2) If I rewrite query strings how will I deal with trans sid? For instance, I have a 
rewritten url that looks like this: /somescript/var1/value1/var2/value2 and the 
session id is going to get appended leaving me with this: 
/somescript/var1/value1/var2/value2PHPSESSID=some_session_id. Is there a way to make 
php add the session id in the slash delimited format? I am aware of 
arg_separator.output directive but that does not fix the = in the query string.

I appreciate any help, tips, and/or pointers. The problem is clear - it's the solution 
that's a little fuzzy!

Thanks for reading,

Jim



[PHP] HTTP_USER_AGENT - list of possibilities

2002-10-08 Thread Support @ Fourthrealm.com

Hey everyone... do you know where I can find a list of the common returns 
of the $_SERVER[HTTP_USER_AGENT] variable?

For example:
I.E. 5.0 = Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0; .NET CLR 
1.0.3705)
Netscape 4.08 = Mozilla/4.08 [en] (WinNT; U ;Nav)


Thanks,
Peter


- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




[PHP] running slow on Win2k

2002-10-07 Thread Support @ Fourthrealm.com

Hi everyone,
I notice that my PHP runs really slow on Win2k Server w/ IIS 5, and even 
slower when accessing a mySQL database.  It's a PIII-800 with 256MB 
RAM.  It is otherwise a great machine, and fast.

Any suggestions?

Peter


- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] running slow on Win2k

2002-10-07 Thread Support @ Fourthrealm.com

Edwin,
I have no interest in getting into a Win2K/Linux debate.  There are 
strengths and reasons for using both systems.

I run other applications (ASP, .NET, iHTML, MSSQL) without any problems, 
and they all work very quickly.  Win2K is my primary development 
environment as it matches the systems my clients use.

So, I just need to know if there are some tweaks I should be considering to 
speed up PHP?


Peter


At 12:31 AM 10/8/2002 +0900, @ Edwin wrote:
Hello,

On Tuesday, October 8, 2002 12:19 AM
Support @ Fourthrealm.com wrote:
  Hi everyone,
  I notice that my PHP runs really slow on Win2k Server w/ IIS 5, and even
  slower when accessing a mySQL database.  It's a PIII-800 with 256MB
  RAM.  It is otherwise a great machine, and fast.
 
  Any suggestions?
 

Perhaps, you can increase your RAM. Better yet, take Win2k and IIS off and
install Linux and Apache. I'm sure next time you'll ask, why is it faster?

- E

  Peter
 
 
  - - - - - - - - - - - - - - - - - - - - -
  Fourth Realm Solutions
  [EMAIL PROTECTED]
  http://www.fourthrealm.com
  Tel: 519-739-1652
  - - - - - - - - - - - - - - - - - - - - -
 
 
  --
  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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




RE: [PHP] Getting started with PHP

2002-09-26 Thread Support @ Fourthrealm.com

Sauron,
Since you're running Win2K, then you can use IIS already installed instead 
of Apache.  I use Win2K Server, with IIS, PHP 4, and mySQL on my local box, 
and it works just fine.

Peter



At 10:55 AM 9/26/2002 -0400, Steve Bradwell wrote:
Welcome Steve,

You'll need to do two things to get started, download apache and php for
windows, and configure 2 files - httpd.conf (apache), and php.ini. A good
tutorial can be found here :

http://softwaredev.earthweb.com/script/article/0,,12014_912381,00.html

After that create a .php file in apache's /htdocs dir (which is where you
will put your pages), the file should look like this:

?
phpinfo();
?

This will show you all of php's configuration settings.

 From there the world is your oyster ;)

HTH,
Steve.

-Original Message-
From: Sauron [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 25, 2002 12:53 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Getting started with PHP


Hi all

I am brand new to PHP, I have a friend that develops in it and I'm
interested in learning more about it. I am familiar with VB at the moment
and that's about it, but I'm always willing to learn!!

What do I need to get developing using PHP? I want to develop completely on
my machine rather than upload files to a web server. I have W2K installed.

Any help is much appreciated,

Regards,

Steve.




--
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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




RE: [PHP] Thoughts on a simple search engine...

2002-09-24 Thread Support @ Fourthrealm.com

Chuck,
Setup your form like this (assuming search.php is the name of your page):

FORM ACTION=search.php METHOD=post
INPUT TYPE=hidden NAME=step VALUE=2
.
/FORM


Then in your search.php page, use this structure:

# --- set $step to passed value, or else set to default ---
if (isset($_GET[step]))   { $step=$_GET[step]; }
elseif (isset($_POST[step]))  { $step=$_POST[step]; }
else{ $step=1; }


if ($step==2)
{
 # --- do the Search query and display results here ---


 # after displaying, then set step=1  to force the search form to 
come up again at the bottom of the page
 $step=1;
}

if ($step==1)
{
 # --- put the form here...  ---
}


I use the step variable all the time in controlling page flow, and 
allowing me to re-use the same .php file for many similar purposes to keep 
the file count of the site low.

HTH,

Peter



At 02:13 PM 9/24/2002 -0500, Jay Blanchard wrote:
[snip]
So I if I create the form, is there way that I can have it echo on the same
page if I am using a form?
[/snip]

Yes, using $PHP_SELF as your form action

HTH

Jay

Ever stop to think, and forget to start again?

*
* Texas PHP Developers Conf  Spring 2003*
* T Bar M Resort  Conference Center*
* New Braunfels, Texas  *
* Contact [EMAIL PROTECTED]   *
*   *
* Want to present a paper or workshop? Contact now! *
*


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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] How do I use a Javascript variable in PHP?

2002-09-23 Thread Support @ Fourthrealm.com

Tom,
JavaScript is a client side language, while PHP is server side.

This means that the PHP is parsed and evaluated before it ever reaches the 
surfers browser.  And since the JavaScript variable will not be available 
until it is created by the browser, there is no way to interact with it.


Peter


At 02:08 PM 9/23/2002 +0100, Tom wrote:
Hi all,



I hope this is the right place to pose my question, so here goes: -



I have a javascript function called calcMonth() and given a number it will
return a date i.e. month = calcMonth( 57 )   -  month will be 'sept 2002'



The problem I`m having is at the beginning of my PHP file I`m calling this
calcMonth() then doing a load of php stuff and then trying to use the
javascript month variable, but to no avail: -



print tdinput type=text class=claimreadonly readonly name=POST_monthdisp
value=javascript:month; size=10 tabindex=99/td;



The result is, the browser displays the words 'javascript:month;' - not a
month number



I`ve looked everywhere for an answer from persistent javascript data to
using framesets to hold the variable but to no avail.



I know its quite a bit of javascript, but its mixed in  with PHP too so I
thought it`d be the right place.



Anyways, I hope someone can provide the answer to my problem.



Thanks in advance,

Tom




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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] How do i assign Integers only and not real numbers?

2002-09-23 Thread Support @ Fourthrealm.com

Hi Tom,
Try this:
$years = round($years + ( $themonth / 12 ));


 From the manual:
float round ( float val [, int precision])
Returns the rounded value of val to specified precision (number of digits 
after the decimal point). precision can also be negative or zero (default).


ceil() and floor() also exist.



Peter


At 03:46 PM 9/23/2002 +0100, Tom wrote:
Hi all,

I have a line of code that assigns a new year number: -

$years = $years + ( $themonth / 12 );

but sometimes $years == 1998.08

or

$year == 2002.75

etc...

I cant find anything like a round() or floor() function in PHP so that year
would be 1998 or 2002 only.

Does anyone know what function would do this?  Sorry if I`m wasting your
time if its a really obvious one!

thanks in advance,
Tom



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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


Re: [PHP] date functions

2002-09-23 Thread Support @ Fourthrealm.com

Patrick

Off the top of my head... Convert both date1 and date2 to unix timestamps, 
and subtract one from the other.  That will give you the number of seconds 
between them.  Then, convert to hours, minutes, etc as required.

Peter


At 10:38 PM 9/23/2002 +0200, Patrick wrote:
i got 2 dates and i want to know how many minutes between em,, like:

$date1 = date(Y-m-j H:i);
$date2 = date(Y-m-j H:i, strtotime(now) + 1800);

$minutes = date_something($date1, $date2);

echo there are $minutes between, $date1 and $date2;

regards
patrick



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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] Re: PHP source code

2002-09-19 Thread Support @ Fourthrealm.com


A solution that I use is to put important information in an include file, 
and store it in a User-Authentication protected folder, ie. /admin/

This adds one extra layer of protection to your files, and keeps the 
average joe-surfer from being able to get the files.

Peter


At 08:24 PM 9/19/2002 +, Stephan Seidt wrote:
Then be sure that nobody is able to read it.
Should be no problem ;)
There is no possibility to read php source,
the webserver will always count it as php file
and the file will be parsed by php.

Sure its possible to get the file over ftp, ssh, imap, etc,
but this is the problem with all the secret-file stuff.

bye,
blizz

On Thu, 19 Sep 2002 20:15:06 +0200, [EMAIL PROTECTED] (Oliver Witt) 
wrote:

  Stephan Seidt schrieb:
 
   On Thu, 19 Sep 2002 16:50:16 +0200
   [EMAIL PROTECTED] (Oliver Witt) wrote:
  
Hi,
Is there any way to read php source code? I didn't think so until I
heard about people you have done that...
Kind regards,
Oliver
   
  
   If you mean php's source, download it ;)
 
  Well, but if I write a script with MySQl, there has to be my user name
  and password in the source code. If anybody could read it, anybody could
  have access to my databases!
  Oliver
 
 
 

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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




[PHP] Date(), adjusted for one year

2002-09-18 Thread Support @ Fourthrealm.com

Hi guys,

What is the easiest way to get the date of one year from today?
Accommodating for leap years is not essential (but would be a nice bonus).

Thanks,
Peter


- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] Date-format

2002-09-18 Thread Support @ Fourthrealm.com

Reformatting before an inserting/updating is one option, but how would we 
change the mySQL database to accept the other format?

Peter


At 04:18 PM 9/12/2002 +0800, Jacob Miller wrote:
Why can't you just reformat it before inserting it into the db?

 $date = 31.12.2002;

 $parts = split(\., $date);
 echo $parts[2].-.$parts[1].-.$parts[0];

- jacob

At 16:13 09/12/2002, Tommi Virtanen wrote:
Well, insert format in wrong, but in Finland enter format is dd.mm.,
so I cannot use other insert format (it have to do other way).

gustavus

 It looks to me like the database is interpreting your date
 incorrectly.  Try changing the format you use to insert, -mm-dd



--
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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




[PHP] Efficiency

2002-09-18 Thread Support @ Fourthrealm.com

Which is more efficient?

a) a sql loop where everything is displayed/formatted using echo stmts, 
like this:

$result = mysql_query(SELECT * FROM news WHERE active=1);
while ($row = mysql_fetch_object($result)) {
 echo TRTD$row-title /TD/TR;
}
mysql_free_result($result);

?


OR
b) a sql loop where you break in and out of php tags as needed:

?php
$result = mysql_query(SELECT * FROM news WHERE active=1);
while ($row = mysql_fetch_object($result)) {
?
TRTD
 ?php echo $row-title; ?
/TD/TR

?php
}
mysql_free_result($result);

?


Obviously, these are really simplified examples.  Typically the html code 
gets much more complicated.


Peter


- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




RE: [PHP] Date-format

2002-09-18 Thread Support @ Fourthrealm.com


Thanks everyone for the helpful answers.

I agree that manuals are useful, but there are times when an example works 
better.

I took all of this information, and some details from earlier posts about 
dates, and produced the following function to make it easy to format dates 
without have to go through and change sql stmts.

# --- Function to format date output ---
function makedate($format, $indate)
{
 $temp = explode(-, $indate);
 $fulldate = mktime(0, 0, 0, $temp[1], $temp[2], $temp[0]);
 $temp = date($format, $fulldate);
 return ($temp);
}


The function gets called like this:

makedate('Y/m/d', $row-articledate);or
makedate(F d, Y, $somedate);


Hopefully this will someone else with their date challenges.


Peter


At 02:55 PM 9/18/2002 -0400, Chuck Payne wrote:

I know everyone love to quote read the manual and forget that we[newbies]
are only asking here because we need help...so here you go...

You can do the following...

DATE_FORMAT IS THE MySQL Command

And let say you want to format your date as the following mm-dd-yy(US) or
dd-mm-yy(the rest of the world).

By the way this are format keys

%m the month in numbers,
%d the days in numbers,
%y the year in number
%M spells out the month
%D gives the date with th, rd, nd all that
%Y gives all four numbers

So you do the following sql statement...

SELECT DATE_FORMAT(yourdate, '%m-%d-%y') as youwanttocallit FROM yourtable;

So in your php code you can do this from your MySQL statement...

$youwantcallit = $myrow[youwanttoit];

? echo $youwanttocallit; ?

Advance note

then if you don't want to show 00-00-00 you can do this...

if ($youwanttocallit == 00-00-00) {
   $youwanttocallit = nbsp;;
}

that way you don't have a bunch of 00-00-00 showing up.

I hope that helps, because that is what the maillisting is for and not to
always quote Read the Book.

Chuck Payne
Magi Design and Support



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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




[PHP] use of mysql_free_result (was Re: [PHP] Efficiency)

2002-09-18 Thread Support @ Fourthrealm.com

Rick, or anyone,

Based on what you said below, can you describe for me when the 
mysql_free_result tag should be used, and when it is not necessary?

I'm fluent in other web languages (iHTML, ASP), but am fairly new to PHP, 
so I'm still learning the intricacies of the language, and the best way to 
use it

Many thanks,
Peter



At 04:02 PM 9/18/2002 -0600, you wrote:
If you aren't doing anything else in a script, mysql_free_result is not needed
in a script like this because the result set will be cleaned up by PHP when
the script ends.

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




[PHP] reuse database connections

2002-09-18 Thread Support @ Fourthrealm.com


Another question about efficiency / using server resources:

In another language I use, I can re-use an ODBC connection to make further 
queries/update/etc to the database to save the overhead of closing and 
reopening the connection to the db over and over.

It works sometime like this (in the other language):
iSQL DBNAME='xxx' LOGIN='xxx' SQL='some query'   # opens the connection
 ... display results...
iSQLMORE SQL='some other query'  # reuses the connection
 display other results
/iSQL   # closes the connection


Is there an equivalent in PHP to this, using the mySQL set of tags?


Peter


- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] Processing PHP in Template File

2002-09-12 Thread Support @ Fourthrealm.com

John

Include your template this way:

$file_name=templates/somefile.php
$New_Content1 = 'This is the new text';
$New_Content2 = 'This is the other text';
include $file_name;


In the template file, have ?php echo $New_Content; ? etc wherever the 
content should appear.

Then you can put other php code in the template file as well.

I use this all the time.


Peter


At 12:00 PM 9/12/2002 -0700, you wrote:

Hello everyone.

I want to implement templates in a site, but am having trouble processing
php within the template file. The application flow is as follow:

-open the template file (which has some place holders) with
$fileHandler =  file($file_name)

-Replace placeholders (within the template files) with
  $fileHandler = ereg_replace(--PlaceHolder--,New content,$Handler)
  //disregard syntax errors...

-Then display the content of the modified template
  $fileHandler = implode('',$fileHandler)
  echo $fileHandler;


The above process works, as far as replace the place holders, and printing
the new content (which is an HTML file). However, it will not process PHP
scripts, within the template.

For example, if my template has

.. ?php echo hello!; ?

blah blah blah
the above process will display the PHP code within the HTML file, without
processing.

How can I process the PHP codes that's in the template?


-john



=P e p i e  D e s i g n s
  www.pepiedesigns.com
  Providing Solutions That Increase Productivity

  Web Developement. Database. Hosting. Multimedia.



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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: Fw: [PHP] Re:[PHP]question

2002-09-11 Thread Support @ Fourthrealm.com

Meltem,

You're much better off to use JavaScript to perform the form 
validation.  This way, when the user clicks on the Submit button, 
JavaScript can make sure that values are filled in, or that they are within 
range, and can then pop up a message advising them of any errors, and that 
they can't continue until the info is corrected.  This saves the hassle of 
you having to create a system that will send details to/from various pages, 
and the user doesn't have to fill in the entire form all over again, as 
their values stay on the page.

I use this site quite often for javascript code:
http://javascript.internet.com/

Peter


At 04:53 PM 9/11/2002 +0300, you wrote:
I think because of my bad english I made you misunderstand..I ment this :
for example  when a person miss an input  to fill on the from  and then
press the submit button I want him to be back to the same form page with a
special message that I entered (something like :you left . place
empty).But I dont want to copy the same form page accoring to the possible
mistakes .. I want to learn if there is an easier way to do this...
thanks to everyone..

meltem
- Original Message -
From: Meltem Demirkus [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, September 11, 2002 4:40 PM
Subject: [PHP] Re:[PHP]question


 
  Thanks ...But I know this way about carrying data from one page to
another..
  I want this message to be seen on the page without my doing
anythingand
  I cant do that?..
 
  - Original Message -
  From: John Wards [EMAIL PROTECTED]
  To: Meltem Demirkus [EMAIL PROTECTED];
  [EMAIL PROTECTED]
  Sent: Wednesday, September 11, 2002 4:36 PM
  Subject: Re: [PHP] question
 
 
   pass the message as a variable
  
   header:location.php?message=$message
  
  
   - Original Message -
   From: Meltem Demirkus [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Wednesday, September 11, 2002 2:31 PM
   Subject: [PHP] question
  
  
Hi,
I am working on a process which turn to the previous page when the
user
enter something wrong in the form on a page .But I also want to warn
the
user with an error message on this page ...I know using heder :
location
   but
I couldn't  add the message ...
can anybody help me ? How can I add this message to the page..
thanks alot
   
metos
   
   
--
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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] help me regarding redirecting a page

2002-09-09 Thread Support @ Fourthrealm.com

Anjali,

Use a BUTTON type element, and some javascript:

INPUT TYPE=button VALUE=Cancel  Return to menu 
ONCLICK=self.location=menu.ihtml'


Peter

At 01:57 PM 9/8/2002 -0700, you wrote:
hello,

i dont know how to redirect a page... i mean i want to
have the effect of submit button without clicking on
the submit button.

thank you
anjali

__
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




Re: [PHP] select box

2002-09-09 Thread Support @ Fourthrealm.com


If you want to put the SELECTED option into your select list while you are 
building the page, use an if statement in the option... ... something 
like this:

OPTION VALUE=1 ?php if ($this==$that) {echo SELECTED; } ? Option 1
OPTION VALUE=2 ?php if ($this==$that2) {echo SELECTED; } ? Option 2


Peter



At 02:05 PM 9/9/2002 +0300, you wrote:
Hi,

Can I put the selected option of select box   later by using php?

thanks



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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




[PHP] Re: [PHP-DB] Radio buttons

2002-08-26 Thread Support @ Fourthrealm.com

Your radio buttons look fine.  I would ensure to add quotes (single or 
double) around the attribute settings, for HTML compliance.  If you must go 
without quotes, then make sure that you don't put spaces in any of the 
attribute values.

INPUT type=radio value=6 name=surf_erf

As for the form not working... do you have a JavaScript that works with 
these radio buttons?

Or, is the radio button name the same as the Submit button?



At 07:25 PM 8/26/2002 +0200, you wrote:
Hello, I get forms posted and working, but as soon as I include radio
buttons, the whole form doesn't function anymore. The code of the radio
button part is included in this posting.
Can you tell me, what I'm doing wrong?
Help would be greatly appreciated!

S. Maier


 TR
   TD width=35%Wie häufig surfen Sie im Internet? /TD
   TD vAlign=center width=15%
 DIV align=rightFONT size=-1selten/FONT/DIV/TD
   TD width=5% bgColor=#cc
 DIV align=centerFONT size=-1INPUT type=radio value=1
 name=surf_erf /FONT/DIV/TD
   TD width=5% bgColor=#cc
 DIV align=centerFONT size=-1INPUT type=radio value=2
 name=surf_erf /FONT/DIV/TD
   TD width=5% bgColor=#cc
 DIV align=centerFONT size=-1INPUT type=radio value=3
 name=surf_erf /FONT/DIV/TD
   TD width=5% bgColor=#cc
 DIV align=centerFONT size=-1INPUT type=radio value=4
 name=surf_erf /FONT/DIV/TD
   TD width=5% bgColor=#cc
 DIV align=centerFONT size=-1INPUT type=radio value=5
 name=surf_erf /FONT/DIV/TD
   TD width=5% bgColor=#cc
 DIV align=centerFONT size=-1INPUT type=radio value=6
 name=surf_erf /FONT/DIV/TD
   TD vAlign=center width=20%FONT size=-1oft /FONT/TD/TR




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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




[PHP] Decode email

2002-08-03 Thread support-bot

Hi

Anyone know a good email decoder (function or class) that can split the
any email to subject, from, to , body and attachments ?


Thank You

   ___
http://www.SaudiABM.com
 ___
About Islam :
http://home2.swipnet.se/~w-20479/Audio.htm
http://sultan.org
  ___


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




[PHP] Php manual

2002-08-03 Thread support-bot

Where can I download the php manual with the user notes (in html format)


Thank You

   ___
http://www.SaudiABM.com
 ___
About Islam :
http://home2.swipnet.se/~w-20479/Audio.htm
http://sultan.org
  ___


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




Re: [PHP] Credit Card Validation With Expiration Date

2002-07-30 Thread Tech Support

That is correct. As long as the expiration date is past present it's fine. I
used to work for another hosting company who would just guess new
expiration dates for monthly recurring customers who had not submitted a
cancellation request but who's cards had expired. As long as the date was
past present they would go through.

P.S. Save the flames. It was not my idea to guess new expiration dates ;-)

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Craig Vincent [EMAIL PROTECTED]
To: Laurent Drouet [EMAIL PROTECTED]; PHP List
[EMAIL PROTECTED]
Sent: Tuesday, July 30, 2002 3:41 AM
Subject: RE: [PHP] Credit Card Validation With Expiration Date


  I'm looking for an algorithm or a free PHP Script which enable me
  to verify
  expiration date with a credit card number.
 
  Does anybody knows this ?

 It doesn't existcredit card number alogrithms do not use the expiry
date
 in their formulas (at least I'm not aware of any that are).  Also there is
 no way to actually check if a credit card is valid without using a company
 that keeps an online database of active credit cards.  The most you can do
 is verify that the number provided could potentially be a credit
card...and
 even then the expiry date has no algorithm attached to it...as long as it
is
 past the present date there's no way to consider it invalid without
 cross-referencing against a database of active cards.

 Sincerely,

 Craig Vincent



 --
 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] searching an array for words starting with 'p'

2002-07-30 Thread Tech Support

try preg_grep()
http://www.php.net/manual/en/function.preg-grep.php

example:

?
$word = array('alpha', 'beta', 'php');
// match anything beginning with upper or lower case p
$matches_array = preg_grep('/^(p|P).*/', $word);
print_r($matches_array);
?

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message - 
From: andy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 30, 2002 10:36 AM
Subject: [PHP] searching an array for words starting with 'p'


 Hi there,
 
 I am wondering how to search an array for words starting with a certain
 character.
 
 E.G:
 
 $word = array('alpha', 'beta', 'php');
 
 I would like to check if there is a word in the array starting with p
 
 Is there alrready a function for this?
 
 Thanx, Andy
 
 
 
 -- 
 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: A somewhat unusual session question...

2002-07-30 Thread Tech Support

That last statement was not entirely true.

The server does not have to know when someone leaves to clean up.

You are right about session.gc_maxlifetime and session.gc_probability.

if the maxlifetime is set to 1200 (20 minutes) and the probability is set to
1 that means that one percent of the time there is session activity on the
server it will perform the garbage clean up routine. If you set probability
to 100 then every time someone refreshed or loaded a page that used sessions
php will look through the session data and remove anything that's older than
our 20 minute maxlifetime.

As for your problem, I do not know what to tell you except that you might
look for an alternative to file type sessions. It is true that php will not
perform garbage clean up if the path is beyond two dirs up from root. MySQL
is a popular alternate choice because it's fast and more secure than any
file that is world readable.

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Lars Olsson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 30, 2002 12:09 PM
Subject: [PHP] Re: A somewhat unusual session question...


 I'm aware that the server cannot know whenever a user just quits
 without logging out, but I was under the impression that the flags
 session.gc_maxlifetime and session.gc_probability in php.ini would
 control when and how often leftover session files would be removed. If
 this isn't true, what are these flags actually used for? Pretty
 confusing if you ask me...

 /lasso



 Scott Fletcher wrote:
  The session.save_path have nothing to do with it.  I have that same
problem
  with the default path, /tmp when the session became a garbage
collection
  when the user quit the browser without logging off.  When the user quit
the
  browser then there's no way for the server to know that, so the session
  stuffs stay active in the session.save_path.  You will have to either
  manually clean it up weekly or use crontab to do the clean up for you at
  night-time with the time-range the website is off-limit to the user.
This
  is where people do the maintaince also.


 --
 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] mcrypt

2002-07-30 Thread Tech Support

Cross posting this with php-dev might not be the best idea. The dev list is
not for support unless you are trying to code part of the php source.

So this is only failing on the decrypt side of the code?

Memory allocation error does not sound like a problem specific to this
function. All the other errors are just because mcrypt_generic_init failed.

Try only encrypting in one script and then only decrypting in another script
and see what happens.

What are the specs of your system? compile options, platform, etc.?

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Purushotham Komaravolu [EMAIL PROTECTED]
To: Tech Support [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, July 30, 2002 1:44 PM
Subject: Re: [PHP] mcrypt


 Hi,
  Thanks for the prompt answer. But I am still getting the same error.

 /
 original: meet at secret place
 encrypted: d40d72f1b224b9bf86a7dbc52402c1d02a5cf90adb9050f0

 Warning: mcrypt_generic_init: Memory allocation error in

/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
 tml/time/cancelsubscription/new.php on line 29

 Warning: mdecrypt_generic(): 2 is not a valid MCrypt resource in

/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
 tml/time/cancelsubscription/new.php on line 30

 Warning: mcrypt_generic_end(): 2 is not a valid MCrypt resource in

/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
 tml/time/cancelsubscription/new.php on line 31
 decrypted:


 ///


 Regards,

 Purushotham Komaravolu
 Software Engineer
 Yaga, Inc. - advanced payment services
 Direct: 415-901-7343
 Fax: 415-901-1586
 http://www.yaga.com



 - Original Message -
 From: Tech Support [EMAIL PROTECTED]
 To: Purushotham Komaravolu [EMAIL PROTECTED]
 Sent: Tuesday, July 30, 2002 11:34 AM
 Subject: Re: [PHP] mcrypt


  Rather than tease you with hints I'll give you some working code ;-)
 
  Documentation for practical usage of mcrypt is weak. I agree.
 
  ?
  // crypto.inc
  $key = secret key crap;
 
  function hex2bin($data)
  {
  $len = strlen($data);
  return pack(H . $len, $data);
  }
 
  function encrypt($string, $key)
  {
   // version 2.4.x of lib mcrypt
   $td = mcrypt_module_open (MCRYPT_TripleDES, , MCRYPT_MODE_ECB,
);
   $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), MCRYPT_RAND);
   mcrypt_generic_init ($td, $key, $iv);
   $crypted = mcrypt_generic ($td, $string);
   mcrypt_generic_end ($td);
   return bin2hex($crypted);
  }
 
  function decrypt($string, $key)
  {
   //version 2.4.x of lib mcrypt
   $string = hex2bin($string);
   $td = mcrypt_module_open (MCRYPT_TripleDES, , MCRYPT_MODE_ECB,
);
   $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), MCRYPT_RAND);
   mcrypt_generic_init ($td, $key, $iv);
   $decrypted = mdecrypt_generic ($td, $string);
   mcrypt_generic_end ($td);
   return trim($decrypted);
  }
  ?
 
 
  usage:
  ?
  include (path/to/crypto.inc);
  $secret = meet at secret place;
  $encrypted = encrypt($secret, $key);
  print original:  . $secret . br;
  print encrypted:  . $encrypted . br;
  $decrypted = decrypt($encrypted, $key);
  print decrypted:  . $decrypted . br;
  ?
 
  Note: if you are encrypting really secret crap like credit card numbers
or
  something of that nature then NEVER include the key anywhere in your
code.
  Make a form where you have to type it in or something in order to
display
  the results.
 
 
  Jim Grill
  Support
  Web-1 Hosting
  http://www.web-1hosting.net
  - Original Message -
  From: Purushotham Komaravolu [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Tuesday, July 30, 2002 12:52 PM
  Subject: [PHP] mcrypt
 
 
  Hello,
I am getting some odd errors trying to get an encrypt/decrypt
  process to
work. Looking at the manual examples and some other literature, I
 have
  tried
the two approaches listed below. For each, I get a
sometimes-works,
sometimes fails result. The manual entry has a string of user
notes
  with
problem like mine, but I still have problems.
 
 
 
Server API Apache
 
 
 
mcrypt
  mcrypt support enabled
  version 2.4.x
  Supported ciphers twofish rijndael-128 rijndael-192
 rijndael-256
saferplus rc2 xtea serpent safer-sk64 safer-sk128 cast-256 loki97
 gost
threeway cast-128 des tripledes enigma arcfour panama wake
  Supported modes ofb cfb nofb cbc ecb stream
 
 
--]
 
 
 
The first attempt used the following code:
 
 
--
?php
$key = this is a secret key;
$input = Let us meet at 9 o'clock at the secret place.;
 
 
$td = mcrypt_module_open ('tripledes', '', 'ecb', '');
$iv

Re: [PHP] PHP5?

2002-07-29 Thread Tech Support

You could join the developer's list and just read. I joined just to keep up
with what's coming in future releases and it's also pretty interesting. They
are constantly talking about what features/bugs need work and when they want
to do a release and who will be on vacation and can't help and blah blah
blah. I wouldn't recommend asking many questions though unless you want to
get flamed. :-)

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Chris Boget [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 29, 2002 3:23 PM
Subject: [PHP] PHP5?


 In the following article:

 http://www.computerwoche.de/index.cfm?pageid=254artid=38819category=84

 Zeev says that PHP5 is expected as early as 1stQ next year.  Is there
anything
 anywhere that discusses the new version and any new possible features?

 Chris



 --
 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] Public Scripts in a commercial product

2002-07-29 Thread Tech Support

There are many types of licensing and it really depends on what the author
licensed it under. Most are GPL. Normally the first few lines of the LICENSE
file typically included with the dist will explain the details of the
license. If there is not one always assume that if you use any part of it in
a commercial work you must also provide the original source code and the
original license. This does *not* mean that you have to include *your*
source code, but only the original source code. Some licenses are even more
free than that but that is the standard.

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Chris Boget [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Monday, July 29, 2002 3:29 PM
Subject: [PHP] Public Scripts in a commercial product


 If someone is going to be using scripts that they grabbed
 from a public forum (PHP Builder, PHPClasses, etc) in a
 commercial product (that is going to be compiled with the
 Zend encoder and released), what is the protocol, if any?
 Do you have to get permission from the author or anything?
 I've read a bit of the GNU Public liscence but I didn't come
 away knowing any more than went I started reading it.  So
 I figure I'd ask here where I'm sure many of you have this
 type of experience.

 Chris



 --
 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] Public Scripts in a commercial product

2002-07-29 Thread Tech Support

Uhhh but you really should ask the author too. ;-)

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Tech Support [EMAIL PROTECTED]
To: Chris Boget [EMAIL PROTECTED]; PHP General
[EMAIL PROTECTED]
Sent: Monday, July 29, 2002 5:38 PM
Subject: Re: [PHP] Public Scripts in a commercial product


 There are many types of licensing and it really depends on what the author
 licensed it under. Most are GPL. Normally the first few lines of the
LICENSE
 file typically included with the dist will explain the details of the
 license. If there is not one always assume that if you use any part of it
in
 a commercial work you must also provide the original source code and the
 original license. This does *not* mean that you have to include *your*
 source code, but only the original source code. Some licenses are even
more
 free than that but that is the standard.

 Jim Grill
 Support
 Web-1 Hosting
 http://www.web-1hosting.net
 - Original Message -
 From: Chris Boget [EMAIL PROTECTED]
 To: PHP General [EMAIL PROTECTED]
 Sent: Monday, July 29, 2002 3:29 PM
 Subject: [PHP] Public Scripts in a commercial product


  If someone is going to be using scripts that they grabbed
  from a public forum (PHP Builder, PHPClasses, etc) in a
  commercial product (that is going to be compiled with the
  Zend encoder and released), what is the protocol, if any?
  Do you have to get permission from the author or anything?
  I've read a bit of the GNU Public liscence but I didn't come
  away knowing any more than went I started reading it.  So
  I figure I'd ask here where I'm sure many of you have this
  type of experience.
 
  Chris
 
 
 
  --
  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] Help reg. create user and allocate space

2002-07-28 Thread Tech Support
Are you asking us how to write an entire online community program???

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: "umesh" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, July 28, 2002 6:40 AM
Subject: [PHP] Help reg. create user and allocate space


 Hi Gurus,

 I am using PHP-4.1.1, postgresql on Linux.

 I want the following functionality, I dont know how to implement it.

 Each time a new user registeres, I want to create mail account by the name
 he specifies and allocate him some space of the server, say 2mb.

 How this is incorporated ?

 Please help.

 Thanking you all in anticipation.


 Regards

 Umesh.
 *
 Umesh A. Deshmukh.
 Manas Solutions Pvt. Ltd.
 [EMAIL PROTECTED]
 http://www.manas-solutions.com
 Ph. : 91+020+4006358,4223991/92
 *




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


Re: [PHP] php 'mail()' security

2002-07-28 Thread Tech Support

There is no substitute for good data verification such as strip_tags() or
some regular expressions to limit valid input. I also would recomend
checking the referrer to be sure someone doesn't hijack you form and try to
modify it and submit it from a remote location. Here is an example:

if (validReferrer() === false)
 die(invalid referrer);

function validReferrer()
{
 $_valid_referrers =
array(www.yoursite.com,www2.yoursite.com,yoursite.com);
 $referer = str_replace('//', '/', $_SERVER['HTTP_REFERER']);
 $ref = explode('/', $referer);
 if ( in_array($ref[1], $_valid_referrers) )
  return true;
 else
  return false;
}

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Dennis Gearon [EMAIL PROTECTED]
To: Bob Lockie [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, July 27, 2002 10:54 PM
Subject: Re: [PHP] php 'mail()' security


 What I meant was, how to sanitize the input on the forms so that
 malicious stuff cannot be put as commands, etc. in the email address, or
 body, or 'extra' field of the 'mail()' function in PHP.
 --
 -
 Joy is just a thing (to be).. raised on,
 Love is just the way to Live and Die,
 John Denver.
 -
 He lost a friend, but kept his Memory (also John Denver),
 Thank you...John Corones...my friend always.
 -
 Look lovingly upon the present,
 for it holds the only things that are forever true.
 -
 Sincerely, Dennis Gearon (Kegley)

 --
 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/MySQL Search Engine Query Question

2002-07-28 Thread Tech Support

Here is an idea

?
// make array out of words in search string
$search_array = explode(' ', $search);

// make regexp pattern '.*(this|or|that).*'
$string = .*( .  implode('|', $search_array) . ).*;

$query = SELECT * FROM my_table WHERE body REGEXP '$string';
$result = mysql_query($query, $connection);
$res = mysql_num_rows($result);
if ($res  1)
die(no match for $search);
?

using this method car would match car, carwash, scar, scarred,
etc.
Since this result will contain the entire boy of text you could some more
matching or scoring for relevancy

?
while ( $row = mysql_fetch_assoc($result) )
{
   $num = sizeof($search_array);
   for ($i = 0; $i  $num; $i++)
  {
 if ( preg_match(/.*\b$search_array[$i]/i, $row[body]) )
{
 // it was found so score 25 to start
 $score[$row[page_title_or_something]] += 25;
 $body_size = strlen($row[body]);
 // this is the first case-insensitive occurance of the word
 $temp = @stristr($row[body], $search_array[$i]);
 $pos = @strlen($row[body])-strlen($temp);
 if ($pos == $body_size)
 $pos = 0;
 // score higher
 $percent = ( ($pos / $body_size * 1000) / 10 );
 $score[$row[page_title_or_something]] += ((100 -
number_format($percent)) / 2);
 // this is the first occurance of the word by it's self
 preg_match(/[^a-z0-9]?($search_array[$i])([^0-9a-z])?/i,
$row[body], $matches);
 $temp = @stristr($row[body], trim($matches[0]));
 $pos_clean = @strlen($row[body])-strlen($temp);
 if ($pos_clean == $body_size)
 $pos_clean = 0;
 // score higher
 $percent = ( ($pos_clean / $body_size * 1000) / 10 );
 $score[$row[page_title_or_something]] += (100 -
number_format($percent));
 // this is how many times it occured in total
 $reps = substr_count($row[body], $search_array[$i]);
 // score higher
 $score[$row[page_title_or_something]] += ($reps * 5);
 // this is how many times it occured by it's self
 $rc = preg_grep(/[^a-z0-9]?($search_array[$i])([^0-9a-z])?/i,
explode( , $row[body]) );
 $reps_clean = sizeof($rc);
 // score higher
 $score[$row[page_title_or_something]] += ($reps_clean * 10);
}
}
?

I had that code from a previous working project. I copied it and changed
some var names to make it more clear. I did not test it in this format but
it is a good example and you could certainly improve it or build on it.

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Paul Maine [EMAIL PROTECTED]
To: PHP PHP [EMAIL PROTECTED]
Sent: Saturday, July 27, 2002 9:31 PM
Subject: [PHP] PHP/MySQL Search Engine Query Question


 I am currently working on a website that is implemented using PHP and
MySQL.

 The site currently has a simple search engine that allows a shopper to
type
 in a search string that is stored in $search. For example, if a shopper
 types in 1972 Ford Mustang
 $string =1972 Ford Mustang

 Using the following SQL statement:
 SELECT * FROM whatevertable WHERE whatevercolumn LIKE '%$search%

 Records are returned that have this exact string and in this exact order
 (I'm aware a wild card character is included on the front and back of the
 string).

 My desire is to be able to logically AND each token of the search together
 independent or the order of the tokens.
 I want to return all records that have Mustang AND 1972 AND Ford.

 Since a shopper inputs the search string in advance I don't know how many
 tokens will be used.

 I would appreciate any suggestions.

 Regards,
 Paul


 --
 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 'mail()' security

2002-07-28 Thread Tech Support

I think you are looking for something different.

do this:

print pre;
print_r($_SERVER);
print /pre;

You will see a whole bunch of useful globals. As a matter of fact, try this
one out too:

print pre;
print_r($GLOBALS);
print /pre;

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Bob Lockie [EMAIL PROTECTED]
To: Dennis Gearon [EMAIL PROTECTED]; Tech Support
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, July 28, 2002 1:19 PM
Subject: Re: [PHP] php 'mail()' security



 There is no substitute for good data verification such as strip_tags() or
 some regular expressions to limit valid input. I also would recomend
 checking the referrer to be sure someone doesn't hijack you form and try
to
 modify it and submit it from a remote location. Here is an example:
 
 if (validReferrer() === false)
  die(invalid referrer);
 
 function validReferrer()
 {
  $_valid_referrers =
 array(www.yoursite.com,www2.yoursite.com,yoursite.com);
  $referer = str_replace('//', '/', $_SERVER['HTTP_REFERER']);
  $ref = explode('/', $referer);
  if ( in_array($ref[1], $_valid_referrers) )
   return true;
  else
   return false;
 }

 That is a good idea.
 $_SERVER['HTTP_REFERER'] is the web server identifier, right?
 My web server is 10.0.0.5 from the internal LAN.
 I am hesitant to allow HTTP_REFERERs from 10.0.0.5 because it seems to me
that it would be easy enough to configure a strange box
 to imitate 10.0.0.5.
 Can I somehow check that the HTTP_REFERER = localhost?








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




Re: [PHP] failure notice (fwd)

2002-07-27 Thread Tech Support

That's what happens when ISP's aren't careful about what happens on their
network. Getting your IP's on the black list is probably one of the worst
things you can let happen as an ISP. They warn you and give you time to
rectify the situation (cancel accounts/access of offenders) before they
actually add you to the list, which is impossible to get removed from.

Many sysadmins rely on the black list to keep their users from getting tons
of spam. It's funny to see the current list of ISP's who ignored the
warnings and got added. Another example of how clueless some of these big
companies really are.

http://blackholes.us/

I am totally surprised to see rackspace on the list. I always thought they
ran a pretty tight ship since they are probably one of the only large collo
companies actually making profit.

That is a drag! You shouldn't give up on the list though. It's not like
php.net has anything against rackspace users. They are just one of many who
make use of the blacklist. Use another email account or get a hotmail
account or something. The list needs you! :-)

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Miguel Cruz [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, July 27, 2002 2:24 PM
Subject: [PHP] failure notice (fwd)


 Is this for real? Rackspace hosts an awful lot of good-hearted people
 (including myself). Is there a specific reason why the entire ISP's
 customer base has been blocked from posting to php-general? I guess I have
 to give up participating on the PHP list...

 miguel

 -- Forwarded message --
 Date: 27 Jul 2002 19:21:15 -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: failure notice

 Hi. This is the qmail-send program at stoic.net.
 I'm afraid I wasn't able to deliver your message to the following
addresses.
 This is a permanent error; I've given up. Sorry it didn't work out.

 [EMAIL PROTECTED]:
 216.92.131.4 does not like recipient.
 Remote host said: 553 209.61.128.0/18 blocked by rackspace.blackholes.us
 Giving up on 216.92.131.4.

 --- Below this line is a copy of the message.

 Return-Path: [EMAIL PROTECTED]
 Received: (qmail 22694 invoked by uid 508); 27 Jul 2002 19:21:11 -
 Received: from localhost ([EMAIL PROTECTED])
   by localhost with SMTP; 27 Jul 2002 19:21:11 -
 Date: Sat, 27 Jul 2002 14:21:11 -0500 (CDT)
 From: Miguel Cruz [EMAIL PROTECTED]
 To: Tony Harrison [EMAIL PROTECTED]
 cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Re: Date() Problem
 In-Reply-To: [EMAIL PROTECTED]
 Message-ID: [EMAIL PROTECTED]
 MIME-Version: 1.0
 Content-Type: TEXT/PLAIN; charset=US-ASCII

 On Sat, 27 Jul 2002, Tony Harrison wrote:
  I tried using UNIX stamps but it dont work, and why the hell does it
default
  to that date anyway? I thought it was supposed to default to the current
  time?

 Be very happy it works the way it does. Since it defaults to an
 easily-recognizable date and time, you can quickly tell when you've messed
 up your code.

 If you don't provide a second argument to date() at all, then it'll
 default to the current date and time.

 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




Re: [PHP] CURL SSL

2002-07-27 Thread Tech Support

cURL needs to be compiled with SSL support.

./configure --with-ssl=SSLPATH where SSLPATH is the actual path to where
openssl can be found.

./configure --with-ssl=/usr works for me.

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Oscar F [EMAIL PROTECTED]
To: Jonathan Rosenberg [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, July 27, 2002 1:42 PM
Subject: Re: [PHP] CURL  SSL


 Jonathan,

 The exact same thing is happening to me right now, only that I'm working
 with the Concord people, not with authorize... it says SSL is enabled
when
 I ask for the info.

 The reason why you're not getting the values, is that cURL is telling PHP:
 curl: (1) libcurl was built with SSL disabled, https: not supported!

 You can see this if you have shell access, and type on command line: curl
 https://...;.

 I've tried all that I have found on the cURL mailing list history (make
 distclean, ./configure --with-ssl=SSLPATH, make install)..etc..etc.. but
 nothing works... Anyone has a solution?.

   Oscar F.-

 - Original Message -
 From: Jonathan Rosenberg [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, July 27, 2002 1:50 PM
 Subject: [PHP] CURL  SSL


  I am on a server that has CURL  OpenSSL enabled.  I assumed that this
 meant
  that I could do https: requests via CURL.  But for some reason, my
 attempts
  to do this are not working.
 
  If I do a CURL http: request, everything works fine (i.e., I get the web
  page, as expected).  But if I use an https: request, no value is
returned.
 
  Do I need to do something else to make https: requests work in CURL?
 
  Here's the code in question:
 
  $ch = curl_init(https://secure.authorize.net/gateway/transact.dll;);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $result = curl_exec($ch);
 
  In this case, $result is the null string (if you try that URL in your
  browser, you will that some text is returned).  If I replace the
curl_init
  with
 
  $ch = curl_init(http://www.cnet.com;);
 
  I get the expected string in $result.
 
  Any thoughts?
 
  --
  JR
 
 
 
  --
  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] Sending a File to User's Browser

2002-07-27 Thread Support

This works on everything I've tested so far.

$file = /some/path/to/file;
header(Content-Disposition: inline; filename= . basename($file));
header(Content-Type: application/octet-stream);
header(Content-Type: application/force-download);
header(Content-Type: application/download);
header(Content-Transfer-Encoding: binary);
header(Content-Length:  . filesize($file));
header(Pragma: public);
header(Expires: 0);
header(Cache-Control: must-revalidate, post-check=0, pre-check=0);
readfile($file);
exit();

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net

- Original Message -
From: Oscar F [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, July 27, 2002 5:46 PM
Subject: [PHP] Sending a File to User's Browser


Hello,

I need a user to save an image file to their disk. Normally when someone
clicks on an link to a .jpg file, the fil will display on the same browser
window, since it is capable of displaying such files. Now, I don't want this
to happen, I need to be able to show the user the Save As.. dialog when
they click the link. I know it can be done bc I've seen it in phpMyAdmin,
when you want to save the database dump. If you dont click Save as file it
just displays the text in your browser.

Any ideas??.. :)

  Oscar.-



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




Re: [PHP] Help: header function

2002-07-26 Thread Tech Support

If you have session cookies disabled in your browser then you have to add
the session ID to the redirect. If you have your cookies enabled and you are
still losing the session then there must be some other problem.

no cookie compatible:

header(Location: http://someplace.com/somepage.php?PHPSESSID=; .
session_id() );
exit();

if you have session.use_trans_sid = 1 or you compiled
with --enable-trans-sid the session id will be automatically added to
relative get or post. Both links that are not a relative URI and header
redirects require that you manually append the session id to the query
string to keep the session without the need for a session cookie.

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: k a m e s h [EMAIL PROTECTED]
To: Tech Support [EMAIL PROTECTED]
Cc: Matt [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, July 26, 2002 1:21 PM
Subject: Re: [PHP] Help: header function



 thanks for the help..

 There was no problem with the syntax.. I used the correct syntax in my
 code: the quotes and both the host name and the script name.. i didnt
mention
 it properly in the mail..
 i have also tried it with absolute URL.. as you have mentioned the problem
 is: session information is not transmitted in redirection.. is there any
 way of resolving this problem?
 i wrote a single script that will allow a user to update the db, if he is
 logged in or it will display the login form if he is not logged .. once he
 logs in successfully, i call the script again so that he will be able
 to update the db.. pls help me..

 regards
 kamesh


   _
   s kameshwaran
  eEL, Dept of CSA, IISc, Bangalore - 560012
Homepage: http://www2.csa.iisc.ernet.in/~kameshn
  Phone: +91-80-3942368-111 (Lab), +91-80-3942624 (Hostel: U-95)
  
  Eternity abides in the present.. NOW


 --
 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] Installed PHP on home Win98se, now how can I get browser to see it?

2002-07-26 Thread Tech Support

You need a web server like M$ IIS or Apache. I would rather chew tin foil
than run an IIS server even if it was on a win machine.

You can install the win version of the Apache web server and then just
browse to http://localhost/ to view your work.

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Marcus Unlimited [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 26, 2002 5:18 PM
Subject: [PHP] Installed PHP on home Win98se, now how can I get browser to
see it?


 Hello,

 I just installed the nice and easy one click PHP install to my Windows
 98se machine.

 I just want to be able to test and practice My basic PHP /MySQL stuff
 without up loading.

 So now what do I do.

 I ran the php info scripts and got bunch of weird messages.

 How do I get the PHP to work in my browsers IE, NN just as it does when
 uploaded to my hosting co's servers?

 Thanks,
 -Marcus

 --


||

 Marcus Unlimited
 http://marcusunlimited.com
 Multimedia Internet Design and Education


||

 ---
 Also visit:
 -  http://www.chromaticus.com
 -  http://ampcast.com/chromaticus



 --
 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] High Resolution Images

2002-07-26 Thread Tech Support

This may sound silly, but you are uploading in binary mode right?

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 26, 2002 5:24 PM
Subject: [PHP] High Resolution Images


 Hello,

 I am creating a script that takes an uploaded image, creates a thumbnail
 from it, and saves both files.

 The script works great, but the problem is, the files It will have to
 handle, are high-resolution files (300dpi, 24 bit-depth).. it works fine
on
 regular files (72 dpi), but when I upload a 300dpi image, it says that the
 image is not a valid JPEG file.

 Warning: imagecreatefromjpeg:
 '/home/sites/site1/web/uploadedHi-Res/mo_0001.jpg' is not a valid JPEG
file
 in /home/sites/site1/web/site/designers/doSubmit.php on line 6

 The image appears to be valid here, it opens on photoshop, and everywhere,
 however, once uploaded, the image seems to be corrupted somehow, bc if I
 download it again, it won¨t open anywhere. Has this happened to anyone
else
 on this list?.. if so, please advise!.

 Here is the code for the script if it helps:


 function createThumbnail($path, $filename) {
 $src_img=ImageCreateFromJpeg($path); //HERE IT SAYS IMAGE NOT VALID
 if (imagesx($src_img)   imagesy($src_img)) {
  $new_w=69;
  $new_h=40;
  $t1 = imagesx($src_img);
  $t2 = imagesy($src_img);
 } else {
  $new_w=40;
  $new_h=69;
  $t1 = imagesy($src_img);
  $t2 = imagesx($src_img);
  }
 header(Content-type: image/jpeg);
 $dst_img=imagecreate($new_w,$new_h);
 imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,$t1,$t2);
 ImageJpeg($dst_img,
 /home/sites/site1/web/uploadedHi-Res/$filename-thumb.jpg, 50);
 }


 if (($filename_type != image/jpeg)  ($filename_type != image/jpg) 
 ($filename_type != image/pjpeg)) {
 header(Location:submitError.php); exit;
 } else {
 srand((double)microtime()*100);
 $randomfile = substr(md5(rand(0,999)), 0, 6);
 $upload = /home/sites/site1/web/uploadedHi-Res;
 $upload_path = $upload/$filename_name;
 if (is_uploaded_file($filename)) {
  Exec(cp $filename $upload_path);
   $link = @mysql_connect(localhost, 'x', '')
or die(Unable to Connect to Database);
  mysql_select_db();
  $sql = INSERT INTO  VALUES ('$designer_valid', '$filename_name',
 NOW(), 'Pending');
  $result = mysql_query($sql) or die(Query Failed);
  createThumbnail($upload_path, $filename_name);
  header(Location:designSubmitted.php); exit;
 } else {
header(Location:submitError.php); exit;
   }
 }



 --
 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 redirect

2002-07-26 Thread Tech Support

I know what you mean about everything being M$.

I'm a die hard GNU fan and therefore hate everything M$, but I can think of
more than one occasion where that attitude cost me some money. I somehow
still believe that if I stick to my beliefs and maybe try to convert some M$
people to host their sites/apps on *nix we will eventually take down the
evil Redmond devil and open source software will rule the world.
/dream

The box read, 'windows 9x or better' so I installed Linux!
hehe

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Justin French [EMAIL PROTECTED]
To: David Buerer [EMAIL PROTECTED]; 'Jay Blanchard'
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, July 26, 2002 11:20 AM
Subject: Re: [PHP] php redirect


 Well the current web-dev environment here in Melbourne, Australia is VERY
 Microsoft oriented at the moment.  I'm happily freelancing, but have been
 keeping my eye on the big job websites, just in case that perfect job
comes
 up.

 I get emailed about a few jobs every day, and 90% of them are for a M$
 environment.

 I guess that would be some form of motivational tool for someone to learn
 ASP -- if there aren't any PHP jobs, then what's the point in knowing PHP?


 I'm sure it's just a temporary problem here at the moment, and it'll sort
 itself out... but if I ever get a week without much work, I'll try and
learn
 a bit of ASP, just so that when a client/employer ask me to use ASP, I can
 fumble through it, or better still, recommend PHP as an educated
 alternative.


 Justin French




 on 27/07/02 1:14 AM, David Buerer ([EMAIL PROTECTED]) wrote:

  What's ASP
 
  I don't know if and haven't learned it so it couldn't be.  After all,
how
  many programming languages does one need to know??
 
 
  -Original Message-
  From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
  Sent: Friday, July 26, 2002 8:27 AM
  To: 'David Buerer'; [EMAIL PROTECTED]
  Subject: RE: [PHP] php redirect
 
 
  [snip]
  This is the only way I've figured out how to do it.  It seems to work
really
  well.
 
  if (mysql_db_query ($dbname, $query, $link)) {
  gotourl(myurl1);}
  } else {
  gorourl(myurl2);}
 
  function gotourl(myurl)
  {
  echo SCRIPT language=javascript;
  echo   window.location=$myurl;;
  echo /SCRIPT\n;
  }
  [/snip]
 
  Isn't this ASP? ;^]
 
  Jay
 
  My other car is a broom
 
  *
  * Want to meet other PHP developers *
  * in your area? Check out:  *
  * http://php.meetup.com/*
  * No developer is an island ... *
  *
 
 


 --
 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 UPGRADE on LINUX

2002-07-26 Thread Tech Support

It really depends on what version you have now.

I'd say the biggest thing to look out for is the register_globals, which is
now defaulted to Off. This will break lots of sites!!! Turn it on unless
you want your phone to ring for days. Users should, however, be urged to get
used to coding with it off. It can be turned off on a per directory basis
using .htaccess.

I have not actually tried this but one of our users reported a problem with
setcookie. He was doing this:
setcookie('username', $username, , $protected_dir);
The manual says you must use an integer for the expire argument and cannot
escape with an empty string so I'm surprised it ever worked at all, but he
says it did work before the upgrade. I had him switch to this:
setcookie('username', $username, 0, $protected_dir);

Other than that you might have some Redhat specific problems that I'm
unaware of. I don't see why you people put up with that rpm crap. :-)


Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: karthikeyan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 26, 2002 3:55 PM
Subject: [PHP] PHP UPGRADE on LINUX


Hi,

  We have to upgrade our PHP to the latest stable version on Redhat Linux
7.3.  We have lots of user using our PHP so what are all the precautions and
steps involved while doing this operations without disturbing their existing
program.

  All responses are welcome.

karthikeyan.

-
Judge not, that ye be not Judged - Abraham Lincoln's favorite quote

-




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




Re: [PHP] Help: header function

2002-07-26 Thread Tech Support

Kamesh's trouble was he was refering to something like http://mypage.php .
I figured it would save time to just get rid of the protocol and go
relative.

I'm aware of the spec for header, but I have always used a relative URI and
just about all the code I've seen uses relative also. I would be interested
to know of any possible problems as well. I suppose it would be good
practice to start using it correctly. I mean, even with trans-sid set to
on session ID's are never sent in header redirects or anything containing
a full URI anyway so it's not like it's going to mess anything up... unless
you moved your code from one site to another and hard coded your full URI in
all your header redirects... yikes!!. That's when a main config file would
come in real handy :-)

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Matt [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, July 26, 2002 11:27 AM
Subject: Re: [PHP] Help: header function


 From: Tech Support [EMAIL PROTECTED]
  To: k a m e s h [EMAIL PROTECTED];
[EMAIL PROTECTED]
 Sent: Friday, July 26, 2002 11:20 AM
 Subject: Re: [PHP] Help: header function


  Try just header(Location: $PHP_SELF); or header(Location:
 $SCRIPT_NAME)
  ...leave out http:// ...and your quotes are in the wrong place too.

 I know that works but the spec for http/1.1 says it's supposed to have the
 absoluteURI including the scheme, and host,
 see http://www.php-faq.com/httpheaders.php#14.30.  Kamesh's trouble was he
 was refering to something like http://mypage.php -- which was missing the
 host name. I've coded lots of headers() with relative URIs [i.e.
 header('Location: mypage.php')] without trouble (at least that I know of).
 Has anyone run into trouble using only the page name?  Is this something
to
 worry about or not?




 --
 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] Help: header function

2002-07-26 Thread Tech Support

Try just header(Location: $PHP_SELF); or header(Location: $SCRIPT_NAME)
...leave out http:// ...and your quotes are in the wrong place too.

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: k a m e s h [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 26, 2002 2:56 AM
Subject: [PHP] Help: header function


 Hi:

 After validating the login, i am  using the header function to call the
same
 page again. The page uses session_start(). But the session variable,
 namely the login id is not changed. When i refresh the page manually
 session variable is changed. What is the problem? the header function i
 use is header(location:http://PHP_SELF;)

 regards
 kamesh

   _
   s kameshwaran
  eEL, Dept of CSA, IISc, Bangalore - 560012
Homepage: http://www2.csa.iisc.ernet.in/~kameshn
  Phone: +91-80-3942368-111 (Lab), +91-80-3942624 (Hostel: U-95)
  
  Eternity abides in the present.. NOW



 --
 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 question

2002-07-26 Thread Tech Support

Congrats! Good choice!

Take a look here:
http://www.convert-in.com/acc2sql.htm
or here:
http://www.google.com/search?hl=enlr=ie=ISO-8859-1q=convert+access+databa
se+to+mysql

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Christian Calloway [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 26, 2002 3:30 PM
Subject: [PHP] mysql question


 Sorry this may be a little offtopic, but I am currently moving a site I
was
 developing from coldfusion+MSAccess to PHP+MySQL. I remembered reading
 somewhere that there is a utility that will convert/transfer (data and
 structure) a MSAcess database to Mysql, and vice versa. Anyone know?
Thanks

 Chris



 --
 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] sessions

2002-07-26 Thread Tech Support

okay... if register_globals is off then your session handling is going to
change dramatically.

You can read more on it here:
http://www.php.net/manual/en/ref.session.php

Basically, You still use session_start(); at the top of your page, but you
never use session_register, session_is_registered, or session_unregister.

To register a variable in a session use:
$_SESSION['user'] = $username;
or you can use multi-dimensional arrays... recommended to help keep
organized.
$_SESSION['user']['username'] = $username;
$_SESSION['user']['pasword'] = $password;

You can also use $HTTP_SESSION_VARS. I'm not quite sure if there is any
major difference in the two except that $_SESSION is new post ver 4.0.6

To end a session simply
$_SESSION = array();
session_destroy();

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Tyler Durdin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 26, 2002 1:35 PM
Subject: Re: [PHP] sessions


 Here is the code that starts and registers the session. It is  login page
 that logs in to itself so the form that produces $_POST[username] is
 actually on the same page, but nothing happens until the user logs in. It
 there is something in this code that is not correct or making the other
code
 from the previous mssages not work please let me know. Thanks again for
all
 of the help.



 ?
 session_start();
 $username = $_POST[username];
 $password = $_POST[password];

 if ($username  $password)
 {
 //user has just tried to login

 $db_conn = mysql_connect(server, user, pass);
 mysql_select_db(DB_name, $db_conn);
 $query = SELECT * FROM members WHERE username='$username'and
 password='$password';
 $result = mysql_query($query, $db_conn);
 if (mysql_num_rows($result) 0 )
 {
 //if they are in the db register the username
 $valid_user2 = $username;
 session_register(valid_user2);
 }
 }
 ?



 _
 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] preg_match() occurence position

2002-07-25 Thread Tech Support

How about this:

$text = this is test;

preg_match can return the first match in an optional array I'll call
$matches
http://www.php.net/manual/en/function.preg-match.php

preg_match('/test/', $text, $matches);

strpos returns the numeric position of the first occurrence
http://www.php.net/manual/en/function.strpos.php

$pos = strpos($text, $matches[0]);

die($pos); // should be what you want... 10


Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: lallous [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 25, 2002 7:40 AM
Subject: [PHP] preg_match() occurence position


 Hello,

 Can I get the starting position of my string occurence when using any
 regexps searching functions in PHP ?

 for example:
 $mem='this is a test';
 preg_match('/test/', ...) should return me somehow: 10


 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] Sessions, how they exist and die

2002-07-25 Thread Tech Support

Hi Matt,

The user's browser will retain the session cookie as long as it is open
unless session.cookie_lifetime is set to something other than zero in the
php.ini or you can also set it in your script like this:

// set session cookie to expire in 30 minutes.
ini_set(session.cookie_lifetime,1800);

If they don't close their browser they can leave and come back to your site
and still have the same session. In I.E. you can even pop a new browser and
the child browser will have the same session cookie as the parent
feature or bug??? who knows.

As far as the files in /tmp are concerned... There are two variables that
control them in the php.ini

1) session.gc_maxlifetime
2) session.gc_probability

if session.gc_maxlifetime is set to 1800 then php will see any files left in
/tmp as garbage after 30 minutes. session.gc_probability is a percentual
probability that any garbage will be deleted. Since any files left in /tmp
will be useless to a browser that exceeded our 30 minutes they are not
harmful but will need to be culled eventually to keep it from growing
forever. If session.gc_probability was set 100 then every single time there
was session activity the garbage files would be deleted. This could get to
be too much extra overhead on a busy server so you could set it to something
like 1 so that only every 1 out of a hundred times there was session
activity the garbage files would be deleted.

NOTE: if session.gc_maxlifetime is set to something less than
session.cookie_lifetime and gc_probability is high (or you just get unlucky
and the number comes up) session data on the server could be deleted and the
user's browser would still have the old session cookie to a session that no
longer exists. This means that the user will not be able to get another
session and can make a mess of an ecommerce deal. I believe all three ini
variables can be set by user via ini_set and I would strongly recommend
taking advantage of that if you are on a shared server and cannot control
what's in php.ini.
http://www.php.net/manual/en/function.ini-set.php

Sorry for the book. But sessions can be difficult to grasp if your new and I
thought this was important.

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Matt Babineau [EMAIL PROTECTED]
To: 'PHP' [EMAIL PROTECTED]
Sent: Thursday, July 25, 2002 9:15 AM
Subject: [PHP] Sessions, how they exist and die


 My question is, if I have a user on my web site, and they leave and come
 back does their session still exist? the file in the /tmp folder exists
 until it is deleted by the OS? If the user comes back will they get
 assigned the same session they had before? I know the questions are
 pretty newbish but I have had experiences in other languages in the past
 where this is the case. The session cookie stayed in the users browser,
 so they kept getting the same session and not a new session if they left
 and came back a day later.

 Matt Babineau
 MCWD / CCFD
 -
 e:  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 p: 603.943.4237
 w:  http://www.criticalcode.com/ http://www.criticalcode.com
 PO BOX 601
 Manchester, NH 03105





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




Re: [PHP] String Manipulation

2002-07-25 Thread Tech Support

I tested this out with success.
$string = ereg_replace('(.*(\(|\[)|(\)|\]).*)', '', $string);

###
// Here is actual working code
$string1 = (Something) - is wrong with me;
$string2 = something - (is wrong with me);
$string3 = something - (is wrong with me;
$string4 = [something] - is wrong with me;
$string5 = something - [is wrong with me];
$string6 = something - [is wrong with me;
for ($i = 1; $i  7; $i++)
{
 $data = string . $i;
 $data = ereg_replace('(.*(\(|\[)|(\)|\]).*)', '', ${$data}); // the magic
line. feed it the string(s).
 print b$i)/b $databr;
}
###

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Mike [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: Thursday, July 25, 2002 10:13 AM
Subject: [PHP] String Manipulation


 Hello all,
 I know that this has probably been discussed before and that you will
 tell me to go through all the back messages on the list but I really
 don't have time to do that because I am on a really tight schedule, but
 I was wondering if anyone could give me some pointers on how to pull
 some information out of a string. I have something like this:
 (Something) - is wrong with me
 or
 something - (is wrong with me)
 or
 something - (is wrong with me

 what I need to know how to do is take the stuff that is inside the
 Brackets (or partial brackets) and put them into another string
 the way I am currently doing it is like this:
 Variable names have been changed per my boss(My Boss wanted me to change
 them for some reason)
 ?
 $parenpos = strpos($tartist,));
 $bracketpos = strpos($tartist,]);
 if($parenpos){
 $artist = trim(substr($tartist,0,$parenpos));
 $title  = trim(substr($tartist,$parenpos+3));
 $secondparenpos = strpos($title,();
 $secondbracketpos = strpos($tartist,[);
 $title = trim(substr($title,0,$secondparenpos));
 }elseif($bracketpos){
 $artist = chop(substr($tartist,1,$bracketpos-1));
 $title  = trim(substr($tartist,$bracketpos+3));
 }
 ?

 I know that there has to be a shorter version of this, can anyone help
 me out with it?

 Thank You,
 Mike
 [EMAIL PROTECTED]
 [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] pulling records from mysql

2002-07-25 Thread Tech Support

This query will return only the 16th row

SELECT firstname FROM table_name LIMIT 16, 1

This query will give you all rows up to 15

SELECT firstname FROM table_name LIMIT 1, 15


Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Tyler Durdin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 25, 2002 10:18 AM
Subject: [PHP] pulling records from mysql


 I have a column in my table named firstname with twenty records in it. How
 can i use php to pull out individual records (say for ex. record 16)?
Also,
 how could i pull out all records upto number 15? Thanks in advance.



 _
 Send and receive Hotmail on your mobile device: http://mobile.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] String Manipulation

2002-07-25 Thread Tech Support

okay... the break down

the regexp: '(.*(\(|\[)|(\)|\]).*)'
.* = any character from zero to infinite number of times
(\(|\[) = either ( or [ (they are escaped with a \ bcz they have other
meaning
then I have another pipe | meaning or
(\)|\]) = either ) or ]
.* = again... any char any # of times
if you want only the parenthesis or the brackets removed just leave out the
.* in the regexp.

the ${$data}was only there in my example working code bcz I had 6 vars named
$string1 through $string6. I wanted to call each of them in a loop but you
can't say $string$i. I said $data = string . $i., which would translate to
just a string like this string1. I could have just used $$data, which is
the same as saying $string1 but I hate to use the double $$ because it
looks bad. Sorry if I threw you off. You can just do it like this:

$text_out = ereg_replace('(.*(\(|\[)|(\)|\]).*)', '', $text_in);


Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Mike [EMAIL PROTECTED]
To: 'Tech Support' [EMAIL PROTECTED]; PHP List
[EMAIL PROTECTED]
Sent: Thursday, July 25, 2002 10:48 AM
Subject: RE: [PHP] String Manipulation


 Ok, It works and everything, but I just was wondering:
 $data = ereg_replace('(.*(\(|\[)|(\)|\]).*)', '', ${$data});
 --^  ^
 what does this do exactly, I see that you are replacing all the
 characters [] and () but what is the ${$data} for?
 Also for future reference is there a way that you could return the
 string with all the parentheses stripped out?
 Thank You again,
 Mike
 [EMAIL PROTECTED]


 And what would be
 -Original Message-
 From: Tech Support [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 25, 2002 11:39 AM
 To: Mike; PHP List
 Subject: Re: [PHP] String Manipulation

 I tested this out with success.
 $string = ereg_replace('(.*(\(|\[)|(\)|\]).*)', '', $string);

 ###
 // Here is actual working code
 $string1 = (Something) - is wrong with me;
 $string2 = something - (is wrong with me);
 $string3 = something - (is wrong with me;
 $string4 = [something] - is wrong with me;
 $string5 = something - [is wrong with me];
 $string6 = something - [is wrong with me;
 for ($i = 1; $i  7; $i++)
 {
  $data = string . $i;
  $data = ereg_replace('(.*(\(|\[)|(\)|\]).*)', '', ${$data}); // the
 magic
 line. feed it the string(s).
  print b$i)/b $databr;
 }
 ###

 Jim Grill
 Support
 Web-1 Hosting
 http://www.web-1hosting.net
 - Original Message -
 From: Mike [EMAIL PROTECTED]
 To: PHP List [EMAIL PROTECTED]
 Sent: Thursday, July 25, 2002 10:13 AM
 Subject: [PHP] String Manipulation


  Hello all,
  I know that this has probably been discussed before and that you will
  tell me to go through all the back messages on the list but I really
  don't have time to do that because I am on a really tight schedule,
 but
  I was wondering if anyone could give me some pointers on how to pull
  some information out of a string. I have something like this:
  (Something) - is wrong with me
  or
  something - (is wrong with me)
  or
  something - (is wrong with me
 
  what I need to know how to do is take the stuff that is inside the
  Brackets (or partial brackets) and put them into another string
  the way I am currently doing it is like this:
  Variable names have been changed per my boss(My Boss wanted me to
 change
  them for some reason)
  ?
  $parenpos = strpos($tartist,));
  $bracketpos = strpos($tartist,]);
  if($parenpos){
  $artist = trim(substr($tartist,0,$parenpos));
  $title  = trim(substr($tartist,$parenpos+3));
  $secondparenpos = strpos($title,();
  $secondbracketpos = strpos($tartist,[);
  $title = trim(substr($title,0,$secondparenpos));
  }elseif($bracketpos){
  $artist = chop(substr($tartist,1,$bracketpos-1));
  $title  = trim(substr($tartist,$bracketpos+3));
  }
  ?
 
  I know that there has to be a shorter version of this, can anyone help
  me out with it?
 
  Thank You,
  Mike
  [EMAIL PROTECTED]
  [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







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




Re: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble

2002-07-25 Thread Tech Support

4.2.2 will not work with apache 2.X from what I've read. However, I have
heard that if you get the latest CVS of both php and apache it will work. I
have not, and probably will not, go down that road just yet :-)

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Chad Day [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 25, 2002 11:38 AM
Subject: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble


 Simple build, no real complicated configure options
 (--with-mysql, --with-apxs2..) ..

 During make:

 php_functions.c:93: syntax error
 *** Error code 1

 Stop in /usr/local/php-4.2.2/sapi/apache2filter.

 etc
 etc


 Any idea what the problem would be?  I googled around for a little and
heard
 there might be problems getting the latest php to work with apache 2.0.39,
 but that was a couple weeks ago.. I thought the new 4.2.2 build might
 address it, but I guess if it's only a security fix like the site says,
 maybe not.. does 4.2.* just not work with Apache 2.0.39, or is something
 else amiss?

 Thanks,
 Chad


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






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




Re: [PHP] an array_key_exists() substitute for php 4.0 4.1 ?

2002-07-25 Thread Tech Support

http://www.php.net/manual/en/function.array-key-exists.php
The name of this function is key_exists() in PHP version 4.0.6.

Damn those elusive manual pages :-/

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message - 
From: David D [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 25, 2002 11:53 AM
Subject: [PHP] an array_key_exists() substitute for php 4.0 4.1 ?


 hello all,
 
 I download a gni script path2vars that manipulate query_string for web
 crawlers.
 But I have php 4.06 that doesnt support function :
 uses array_key_exists() (PHP = 4.1.0).
 Is there a way to substitude it ?
 Is there a way to detect php version and incluse the functions or it
 substitute ?
 
 
 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] mySQL Queries using PHP's SESSION variables

2002-07-25 Thread Tech Support

well, you could simply loop through the session vars and build the query as
you go.

$query = SELECT * FROM Inventory WHERE;

// I'm assuming you keep your item numbers in a items or something similar
foreach ($HTTP_SESSION_VARS['items'] as $pid)
$subquery .=  ItemNumber = '$pid' OR ;
// get rid of last _OR_
$subquery = ereg_replace('[:space:]OR[:space:]$', '', $subquery);
// put the query together
$query = $query . $subquery;

// add more crap to query if you want
$query .=  and some_other_column='something_else';


Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Anup [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 25, 2002 1:51 PM
Subject: [PHP] mySQL Queries using PHP's SESSION variables


 Hello, I am stuck here. In the name of efficiency I want to lower the
number
 of callls to the database. So I am trying to give the most stringent query
 possible. This is the problem: I have stored the surfers shopping cart,
 where each item is stored as a session variable.Now on the database I have
 ALL inventory items, but I want to only display the details of what the
user
 has in his cart.
 eg. : I want something like this:

 $result = mysql_query(SELECT * from Inventory where ItemNumber is in
 $HTTP_SESSION_VARS);
 //  I need proper syntax to replace is in

 where Inventory has, ItemNumber (unique), Price, ItemName.
 So say the surfer has three items in the Session, then I stored the three
 unique ItemNumbers.
 Then with the above query I can get the rest of the information to
represent
 to the user.
 I am looking down the avenues of a Set datastyp or maybe Enum, but I don't
 know if it will 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] GD Library

2002-07-25 Thread Tech Support

I'm not a windoze user but if that line has a ; at the beginning of it
like you have it in your message then it is commented out! LOL. :-)

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Ryan Moore [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 25, 2002 1:44 PM
Subject: [PHP] GD Library


 I am trying to use GD Library on a windows 2000 installation of PHP.
 php_gd.dll is in the extensions folder and the line:
;extension=php_gd.dll
 is in my php.ini file, but I recieve the error: Fatal error:  Call to
 undefined function:  imagecreate() when I try to use the
 imagecreate(100,100) function. Any ideas?

 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] Trouble with \

2002-07-24 Thread Tech Support

If the \ are showing up in form posted data just do this:

$newtext = stripslashes($oldtext);

The slashes are put before any single or double quote by a nifty little php
feature called magic quotes. By escaping quotes in form posted data you
greatly reduce the risk of sql injections and other types of sneaky stuff.

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: [EMAIL PROTECTED]
To: PHP List (E-mail) [EMAIL PROTECTED]
Sent: Wednesday, July 24, 2002 5:30 PM
Subject: [PHP] Trouble with \


 Anyway, with asides to the snooty RTFM reply I got, I thought I'd share.

 Turns out the \'s that I was having problems getting rid of were written
 there from a form post that was used to collect the data. I still haven't
 found a way to remove them after reading them from the file, but I did
 manage to change them before they were posted by doing a strtr.

 If someone has a way to clearn \'s out of a string brought in from a file,
 I'm all ears, but it's working now.



 --
 The Health TV Channel, Inc.
 (a non - profit organization)
 3820 Lake Otis Pkwy.
 Anchorage, AK 99508
 907.770.6200 ext.220
 907.336.6205 (fax)
 Web: www.healthtvchannel.org


 --
 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 do you make a directory

2002-07-23 Thread Tech Support

How about a trailing slash after the directory name ;-)

like this:
$dirpath = /home/sites/home/users/demodocs/web/userforum/ . $username;

you had:
$dirpath = /home/sites/home/users/demodocs/web/userforum . $username;
which would try to create a new directory inside the web directory.

die($dirpath); // excellent for debugging :-)

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Roger Lewis [EMAIL PROTECTED]
To: Php-General [EMAIL PROTECTED]
Sent: Tuesday, July 23, 2002 10:12 PM
Subject: [PHP] How do you make a directory


 I'm trying to learn to create a directory in php, and from everything I've
 read I created this simple test that I put into the file add_user_dir.php.
 Unfortunately I can't get it to work.  I am getting the error message:

 Warning: MkDir failed (Permission denied) in
 /home/sites/home/users/demo/web/Admin/add_user_dir.php on line 20.

 Obviously, it has something to do with permissions.  I have chmod for the
 directory 'userforum' set to 0777.  I tried playing around with umask, and
 changing the chmod, but I can't get anything to work.

 I am using PHP 4.0.6 with Apache 1.3.20

 Here is the script:

 form action=? echo $PHP_SELF; ? method=post name=FormName
 pUser Nameinput type=text name=username size=24 border=0
 input type=submit name=submitButtonName value=Make Directory
 border=0/p
 /form

 ?php
 $dirpath = /home/sites/home/users/demodocs/web/userforum . $username;
 mkdir($dirpath, 0777);
 ?

 Can anyone see what I am doing wrong?  Thanks.

 Roger Lewis


 --
 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] problem with submit-event script from php.net

2002-07-03 Thread Dave - Technical Support

Hi there, this is my first time posting. I've set up the event calendar
script that http://www.php.net uses on their front page. The only problem
I'm having is getting the information from the mysql database to the
backend.csv file that it uses. Everything is working properly included the
submitting of the events, and the data is being imported correctly. Has
anyone used this script before, or maybe has some ideas on what I need to
check? Thanks in advance.

Dave



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




  1   2   >