Re: [PHP] How do I validate input using php?

2002-07-24 Thread JSheble

you're returning a literal true if the condition matches, and nothing if it 
fails...

function validate() { //
 if ( is_numeric($input1) && is_numeric($input2) && 
ctype_alpha($input3) &&
 ctype_alpha($input4) )
 return true;
 else
 return false;
}

At 12:38 AM 7/25/2002 +0200, Øystein Håland wrote:
>I've tried a function like this:
>function validate() { //
>if ( is_numeric($input1) && is_numeric($input2) && ctype_alpha($input3) &&
>ctype_alpha($input4) )
>  return true;
>}
>
>
>And then I call the function:
>
>if (validate() == false) {
> some action;
>}
>
>My problem is I get the action every time, even though the input is of the
>right type. And, is ctype_alpha() the only way to check for only alphabetic
>characters?
>And (this started with one question), anyone got a good solution on
>validating email-adresses with php?
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP] Odd Request: Image 2 HEX

2002-07-09 Thread JSheble

I'm using a Zebra label printer in an application I have and in order to 
display an image on the label, according to the ZPL II printer language, 
any image must be converted to HEX code. Does anyone hvae a code snippet or 
know of a free utility that will take a graphic image (BMP, GIF, JPG, 
etc...) and convert it to HEX values?

Thanx...



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




RE: [PHP] GOTO command. Doest it exist?

2002-06-11 Thread JSheble

I sure hope I'm not going to stir up any trouble, but why exactly would you
need a GOTO statement?  Many languages have no such construct because the
ability to use functions or routines makes GOTO statements obsolete.  They
are most likley only in VB because it's a legacy thing, but AFAIK C, C++,
and some of the more less known languages such as Clipper, FORCE do not have
GOTO statements.  They haven't been missed either.

>>-Original Message-
>>From: David Robley [mailto:[EMAIL PROTECTED]]
>>Sent: Tuesday, June 11, 2002 9:32 PM
>>To: [EMAIL PROTECTED]
>>Subject: Re: [PHP] GOTO command. Doest it exist?
>>
>>
>>In article <001901c21190$c2ffc4e0$017f@localhost>,
>>[EMAIL PROTECTED] says...
>>> Many will tell you that the goto command is extinct.  It isn't,
>>it's just
>>> evolved into the function command.  What you do now is create a
>>function:
>>>
>>> function some_name($variable,$other_variable,...)
>>> {
>>> some code here;
>>> }
>>>
>>> then, call it using :
>>>
>>> call_user_func('some_name',$variable,$other_variable,...)
>>>
>>> It's just like goto, it goes to a specified code block and then
>>returns to
>>> the line below the call, but takes more typing.
>>> Hope this helps.
>>> Hugh
>>
>>What you have described is more like a gosub.
>>
>>Goto jumps execution to the specified point in the code and
>>continues from
>>there. It does not automatically return to the line after the goto call.
>>
>>--
>>David Robley
>>Temporary Kiwi!
>>
>>Quod subigo farinam
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>>---
>>Incoming mail is certified Virus Free.
>>Checked by AVG anti-virus system (http://www.grisoft.com).
>>Version: 6.0.370 / Virus Database: 205 - Release Date: 6/5/2002
>>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.370 / Virus Database: 205 - Release Date: 6/5/2002


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




Re: [PHP] Mail responders

2002-04-26 Thread JSheble

How would you set this up via PHP?  I've wanted to do this, but I always 
thought it was something specific to SendMail, and in a hosted environment, 
mucking about with SendMail generally isn't allowed...

I'd like to send an email to something like [EMAIL PROTECTED]  but have a 
PHP script get the mail and operate on it...

At 11:56 AM 4/26/2002 -0500, you wrote:
>On Fri, 26 Apr 2002, Dennis Gearon wrote:
> > All these lists that have addresses to subscribe, unsubscribe, etc, how
> > do they work? Are they using a cron job to poll the mail inbox through
> > sendmail? Does all mail not to a specific address at the site go to a
> > 'catchall' address, which is then polled?
>
>Usually the mail is delivered directly to a program rather than to a
>mailbox. The program receives the incoming message as input and handles it
>as it pleases.
>
>miguel
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP] mySQL Data Limits

2002-04-23 Thread JSheble

I have a database with a TEXT field in it, and I've been using it this way 
for over three years... today was the first time an INSERT was truncated on 
this field...  It was an unusually large INSERT, and due to the truncation 
I'm now has wondering what are the limits (if any) on inserting data into a 
TEXT field via PHP through an HTML form?  All the data was submitted 
(non-truncated) because an email was composed and sent out based on the 
form data, but the data in the database did not make it completely...

thanx...


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




[PHP] mailing address regexp

2002-04-09 Thread JSheble

I ask this here because PHP developers are notoriously famous for knowing 
RegExp... the project in question isn't for PHP, but perhaps you can still 
be a bit of a help?

I need help in formulating a RegExp that'll detect PO Box addresses...  the 
problem is the many different ways a PO Box can be expressed..

PO Box
PO
P.O. Box
P O
P O Box
PMB
etc...

Anyone care to help out a bit?  I would greatly apperciate it



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




Re: [PHP] Re: php and html image tag...

2002-04-08 Thread JSheble


I don't know if anybody else sent you an email about this or not, but 
there's a much easier way to do what you're doing in this snippet of code...

$record = @mysql_query("SELECT wel_area, ad01, ad02, ad03, ad04, ad05, 
ad06, ad01_t, ad02_t, ad03_t, ad04_t, ad05_t, ad06_t FROM $table",$dbh);

while ($row = mysql_fetch_array($record)) {
 // this should print no
 print( "wel_areas set: " . ( isset( $wel_areas ) ? "Yes" : "No" ));
 extract( $row );
 // this should print yes
 print( "wel_areas set: " . ( isset( $wel_areas ) ? "Yes" : "No" ));
}


this will create variables into the local scope of each element in this 
associative array.  It's a lot easier than typing each assignment out, and 
it also means if you include a new field in your query, your code will not 
have to create a new variable, it'll be automatic...

At 08:29 AM 4/8/2002 -0600, Jas wrote:
>Nevermind I got it fixed... I forgot to include a couple of fields from my
>database into my array.  =).  If you would like to use the code I am putting
>it here...
>$table = "cm_dev_ads";
>$dbh = mysql_connect('localhost','user_name','password') or die('Could not
>connect to database, please try again later');
>mysql_select_db('bignicke') or die('Could not select database, please try
>again later');
>$record = @mysql_query("SELECT wel_area, ad01, ad02, ad03, ad04, ad05, ad06,
>ad01_t, ad02_t, ad03_t, ad04_t, ad05_t, ad06_t FROM $table",$dbh);
>while ($row = mysql_fetch_array($record)) {
>   $wel_area = $row['wel_area'];
>   $ad01 = $row['ad01'];
>   $ad02 = $row['ad02'];
>   $ad03 = $row['ad03'];
>   $ad04 = $row['ad04'];
>   $ad05 = $row['ad05'];
>   $ad06 = $row['ad06'];
>   $ad01_t = $row['ad01_t'];
>   $ad02_t = $row['ad02_t'];
>   $ad03_t = $row['ad03_t'];
>   $ad04_t = $row['ad04_t'];
>   $ad05_t = $row['ad05_t'];
>   $ad05_t = $row['ad05_t'];
>   $ad06_t = $row['ad06_t'];
>   }
>?>
>That is the db connection and the results put into an array...
>require 'db_index.php';
>?>
>This calls to the array script, now to echo them into my java-script it is
>as follows...
>src="" width="200" height="100" vspace="0" hspace="0"
>border="0">
>Hope this helps some other people that might want to do the same type of
>thing...
>Jas
>
>
>
>--
>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] Please help

2002-03-26 Thread JSheble


I realize that this is a newbie list, but isn't this just a tad bit 
ridiculous?  It's not even a PHP question really, it's a SQL 
question.  Here's a question...  I need a form that accepts a name.  Please 
write the code for me so I don't have to bother looking anything up, 
reading anything, and least of all, learn anything...

At 11:57 PM 3/26/2002 +0800, Denis L. Menezes wrote:
>I am a newbie and need some help.
>
>I have a form with three textboxes named "firstname", "lastname" and
>"description"
>
>My table is called "addressbook"
>
>Please tell me the INSERT statement. Also please tell me whether I should
>include the insert statement with a php tag.
>
>Thanks
>Denis
>
>
>--
>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: help with date formatting

2002-03-18 Thread JSheble


I always use the mySQL DATE_FORMAT function in my queries themselves...

SELECT DATE_FORMAT( someDatField, "%m/%d/%Y" ) as thedate FROM someTable


At 12:23 PM 3/18/2002 -0600, Ryan wrote:
>On Mon, 18 Mar 2002 11:51:07 -0600
>Ryan <[EMAIL PROTECTED]> wrote:
>
>By, the way I'm getting the date from a MySQL database.  The posted date
>variable is stored as the date type in the MySQL database so it comes
>out like this 2002-03-06.  Should I convert the date into a time stamp
>or how should I do this.  Let me know what would be the most efficient
>and best way to do this.  Thanks.
>
>
>
> > Hi, I'm trying to create an events page, where it shows the posted
> > events.  I enter data using phpmyadmin.  Currently, the ouput is like
> > this:
> >
> > 
> > Conference in New York
> > 2002-03-06
> >
> > There is going to be a conference in New York next week.
> > 
> >
> > I'm having trouble with the formatting of the date.  I'm using the
> > type date with the function now, so it shows the current date when I
> > post an event.  Here is what I would like:
> >
> > 
> > Conference in New York
> > Wednesday, March 5th, 2002
> >
> > There is going to be a conference in New York next week.
> > 
> >
> > Thanks for any help.
> >
> > --
> > Ryan Spangler
> > 428 N Harmony Ln, Apt. 3
> > Whitewater, WI 53190
> > (262) 473-8392
> > [EMAIL PROTECTED]
>
>
>--
>Ryan Spangler
>428 N Harmony Ln, Apt. 3
>Whitewater, WI 53190
>(262) 473-8392
>[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] putting a url in an anchor tag

2002-03-14 Thread JSheble


Here's a function that was sent to me in response to me needing the exact 
same thing:

function pb_t2h_URLMarkup ($Text, $StyleClass = '', $Target = '')
{
 if ($StyleClass != '')
 $ClassS = " class='$StyleClass'";
 else
 $ClassS = "";

 if ($Target != '')
 $TargetS = " target='$Target'";
 else
 $TargetS = '';

 /* Match for URL strings (the part after 'http://'). Only does quite
  * loose matching. Handles URL parameters and urlencoded chars (%xy).
  * '&' chars have to be treated specially because htmlentities()
  * converts them to '&' */
 $URLSMatch = '([\w\.\/~\?%=\-\&]|&)+)';

 $Patterns = array ('/([^"\']|\A)(http:\/\/' . $URLSMatch . '/',
'/([^"\'])(ftp:\/\/[\w\.\/~\-]+)/',
'/([^"\'\w-\.\/]|\A)(www\.' . $URLSMatch . '/',
'/([^"\'\w\.~\-=]+@[\w\.~\-]+)/');

 $Replacements = array ("\\1\\2",
"\\1\\2",
"\\1\\2",
"\\1");

 return preg_replace ($Patterns, $Replacements, $Text);
}


At 10:35 AM 3/14/2002 -0600, Tyler Longren wrote:
>Hello,
>
>I've been playing with this since lastnight.  I have a string of
>text...Example:
>"This is a test string of test, please go to http://www.google.com now."
>
>I need something that will catch the "http://www.google.com"; part, and make
>into a link instead of just plain text.  Does anyone know how I should go
>about doing this?  I've looked through a few code repositories, but haven't
>found anything.
>
>Thanks,
>Tyler
>
>
>--
>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] Novice Question

2002-02-18 Thread JSheble

with this type of naming convention, how would you write a javascript 
function to access these form elements for client side 
validation?  JavaScript vomits when accessing 
window.document.frmName.poly[].value???

At 03:35 PM 2/18/2002 -0600, Rick Emery wrote:
>name each field with an array name.  I know the following works with
>checkboxes; try it with text fields:
>
>
>
>
>
>
>
>then, in your php script called from the form, you'll access the polynomials
>using poly[0], poly[1], poly[2], poly[3], etc.
>You know how many fields were created, because you created them; so you
>could pass the number of created fields in a HIDDEN value ($NoPols) from the
>form.  As you examine each field, you'll determine if it's empty or not.
>
>for( $idx=0; $idx<$NoPols; $idx++ )
>{
> if( strcmp( "", $poly[$idx] )
> {
> ... do something with field ...
> }
>}
>
>-Original Message-
>From: brendan conroy [mailto:[EMAIL PROTECTED]]
>Sent: Monday, February 18, 2002 3:27 PM
>To: [EMAIL PROTECTED]
>Subject: RE: [PHP] Novice Question
>
>
>I wish to create multiple input fields on a single form, I think(sorry
>..could you advise?)
>
>I'd like a page that has multiple input fields, but I dont know how to
>access the individual inputs.
>
>Say the user wanted to enter three inputs(polynommials in this case)
>so they get a page with three input boxes,
>
>Enter polynommial here:
>
>Enter polynommial here:
>
>Enter polynommial here:
>
>
>How would I dynammicaly create the input boxes and name the inputs. Thanks
>for your time on this, I sorry I didnt explain this clearer in the first
>place,
>
>
>Thanks,
>
>
>Bren
>
>
>
> >From: Rick Emery <[EMAIL PROTECTED]>
> >To: 'brendan conroy' <[EMAIL PROTECTED]>,
> >[EMAIL PROTECTED]
> >Subject: RE: [PHP] Novice Question
> >Date: Mon, 18 Feb 2002 14:54:09 -0600
> >
> >Do you wish to create multiple forms or multiple input fields on a single
> >form?
> >
> >-Original Message-
> >From: brendan conroy [mailto:[EMAIL PROTECTED]]
> >Sent: Monday, February 18, 2002 2:48 PM
> >To: [EMAIL PROTECTED]
> >Subject: [PHP] Novice Question
> >
> >
> >Hi thanks for reading this.
> >
> >This problem is difficult to get across, this is what happens:
> >
> >A) On a html page I ask users how many inputs they wish to enter, say 3.
> >The
> >
> >3 is stored as a variable called $NoPols.
> >
> >B) Then in the code below, a loop creates $NoPols (3) forms to take the
> >users inputs.
> >
> >The problem is that the same name($Yourpol) is used in each of the created
> >forms, and i dont know how to get around this problem.
> >
> >I would like to know if it is possible to create a page which has a number
> >of forms, the number of which is decided by the user(on a start page), so
> >the user can submit as many inputs as they want from one page.
> >
> >
> >Sorry if I've wasted your time,
> >
> >I'd be very grateful for any assisstance with this problem,
> >
> >thanks a million,
> >
> >
> >
> >
> >Brendan
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >npage.php
> >
> >
> >
> >
> >
> >
> >
> > >for($i=1 ;$i<= $NoPols ; $i++)
> >{
> >?>
> >
> >enter polynomial  here:
> >
> >
> > >}
> >?>
> >
> >
> >
> >
> >
> >
> >
> >_
> >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
> >
>
>
>_
>Join the world's largest e-mail service with MSN Hotmail.
>http://www.hotmail.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] IE vertical scrollbars changing color

2002-02-12 Thread JSheble

CSS... here's an example:


BODY { font-size : 10pt; font-family : Arial, Helvetica, sans-serif; 
scrollbar-face-color: MidnightBlue; scrollbar-highlight-color: 
MidnightBlue; scrollbar-shadow-color: Gray; scrollbar-3dlight-color: 
#f3f3f3; scrollbar-arrow-color: #f3f3f3; scrollbar-track-color: #E3E3E3; 
scrollbar-darkshadow-color: MidnightBlue; }


At 02:57 PM 2/12/2002 -0500, Phil Schwarzmann wrote:
>I know this is probably a HTML question and not a PHP question but...
>
>I just upgraded to Internet Explorer 6.0 and I noticed that some
>websites have the ability to change the vertical scrollbar's colors.
>
>Anybody know how to do this??
>
>Thanks!!


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




Re: [PHP] check this new site

2002-02-08 Thread JSheble


looks like every other SLashdot, PHP-Nuke or PHP-Mutant web site out there 
with,just a lot less content...

At 07:52 AM 2/8/2002 -0800, Sagar Chand wrote:
>hi all out there,
>
>just tell me howz this new site
>"www.linuxfornerds.com"
>A site meant for ardent linux lovers but every one r
>invited to post any views on any open source software.
>so get ur voice out
>
>/sagar
>
>__
>Do You Yahoo!?
>Send FREE Valentine eCards with Yahoo! Greetings!
>http://greetings.yahoo.com
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




RE: [PHP] Got a problem I cant figure out

2002-01-28 Thread JSheble


typically this means a missing semi-colon or a control structure that 
wasn't closed somewhere in the code...  it won't tell you where, so you'll 
just have to check and double-check all the lines of code

At 08:28 AM 1/28/2002 -0600, Rick Emery wrote:
>SHOW US YOUR CODE
>
>-Original Message-
>From: Ben Turner [mailto:[EMAIL PROTECTED]]
>Sent: Sunday, January 27, 2002 10:56 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] Got a problem I cant figure out
>
>
>Parse error: parse error in /var/www/docs/tacklebox/404handler.php on line
>47
>
>I am receiving this error on my page but the problem is that line 47 is the
>?> and last line of the page.  Is their something Im missing here??
>
>Thanks,
>Ben
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Uploading a file

2002-01-24 Thread JSheble


the MAX_FILE_SIZE field is OPTIONAL, so just because you didn't see it in 
his code does not mean that's where it was broken at.

At 04:42 PM 1/24/2002 -0600, you wrote:
>If you READ, under the first example posted on the URL I referenced,
>you would see mention of MAX_FILE_SIZE field... which I do not see
>in your HTML code. Additionally, if you look in the HTML posted in
>the example on the URL I referenced you would see the actual syntax
>needed for the MAX_FILE_SIZE field.
>
>Daniel J. Lashua
>
>
>On Thu, Jan 24, 2002 at 02:31:03PM -0800, Todd Cary wrote:
> > Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> > Date: Thu, 24 Jan 2002 14:31:03 -0800
> > From: Todd Cary <[EMAIL PROTECTED]>
> > X-Mailer: Mozilla 4.73 [en] (Windows NT 5.0; U)
> > To: daniel <[EMAIL PROTECTED]>
> > CC: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Uploading a file
> >
> > I though I had followed the example in the manual.  Are you saying that
> > there is something I missed?
> >
> > Todd
> >
> > --
> > Todd Cary
> > Ariste Software
> > [EMAIL PROTECTED]
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] File upload

2002-01-21 Thread JSheble

you could write a bit of JavaScript to run on the form's onSubmit event or 
even the fields onBlur event.  Then in your JavaScript, parse out the file 
name and extension to validate.  It's not 100% accurate since users could 
rename any file to have a JPG extension, but it works for the majority...

At 06:41 PM 1/21/2002 +0200, val petruchek wrote:
> > How can I, using:
> > 
> > specify the file extension.
> > I want the user only to upload *.jpg.
>You can only check $userfile_type to detect the type of uploaded file. You
>can specify nor extension to browse dialog neither default path for
>browsing... Security, you know
>
>
>Valentin Petruchek (aki Zliy Pes)
>http://zliypes.com.ua
>mailto:[EMAIL PROTECTED]
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Date

2001-12-12 Thread JSheble

you could use the mySQL DATE_FORMAT() directly in your query:

SELECT DATE_FORMAT( mydatefield, '%m/%d/%Y ' ) as d_mydatefield from MyTable

At 11:23 PM 12/12/2001 +0100, you wrote:
>Hi to all,
>
>I'm using this to get date from mySQL database:
>
>..
>$p_datum = $row["mydatefield"];
>$mydate = getdate($p_datum);
>$month = $mydate['month'];
>$mday = $mydate['mday'];
>$year = $mydate['year'];
>
>.but I allways get 1/1/1970.
>
>Can anybody help me?
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP to ASP ?

2001-11-26 Thread JSheble

Oh really?  I know ASP, PHP, ColdFusion and a few others.  You really 
shouldn't make such global statements... just because you don't know ASP 
doesn't mean it's not a viable tool, nor is it a good idea as a web 
developer to lock yourself into one singular technology.  Knowing more than 
one makes you a bit more marketable.

Here's your Encrypt function in ASP, the only difference being I passed the 
encryption key in while in the PHP counterpart it was a GLOBAL.  You can 
make it a global type of variable in your ASP too.

function Encrypt( strEncryptThis, strEncryptionKey)
 dim i
 dim strNewString
 dim strCurChar

 for i = 1 to Len( strEncryptThis )
 strCurChar = Asc( Mid( strEncryptThis, i, 1 ))
 strCurChar = strCurChar + Asc( Mid( strEncryptionKey, i, 1))
 strNewString = strNewString & strCurChar
 next

 Encrypt = strNewString
end function

At 09:24 AM 11/26/2001 -0500, Casey Allen Shobe wrote:
>This is a PHP mailing list, I doubt you'll find anyone who knows, or wants to
>know ASP.  Why not use PHP for this, and dump ASP (along with the slow,
>bug-ridden webserver it runs on [unless you're using Apache::ASP])?
>
>On 26 November 2001 9:00, Jean-Arthur Silve wrote:
> > Hi !
> >
> > I work with someone who use ASP :-(( ...
> > Is someone could translate this function to ASP ??
> > I don't think it's hard, but when you don't know ASP...
> >
> > function encrypt($str)
> > {
> > global $STRCRYPT;
> >
> > $i = strlen($str);
> > $newstr="";
> > for ($j=0;$j<$i;$j++)
> > {
> > $car = substr($str,$j,1);
> > $car = ord($car);
> > $car = $car + ord(substr($STRCRYPT,$j,1));
> > $car = sprintf("%03d",$car);
> > $newstr.=$car;
> > }
> > return $newstr;
> > }
> >
> >
> >
> > 
> > EuroVox
> > 4, place Félix Eboue
> > 75583 Paris Cedex 12
> > Tel : 01 44 67 05 05
> > Fax : 01 44 67 05 19
> > Web : http://www.eurovox.fr
> > 
>
>--
>Casey Allen Shobe
>[EMAIL PROTECTED]
>GCS/CM d+ s+:->+: a-- C++() ULU$ P- L+++> E- W++ N++ !o K- w-- !O
>M V- PS++ PE Y+ PGP>++ t+ 5+ X R>+ tv-- b++ DI+ D G++ e h-(*) r--- z--
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] auto form submit

2001-11-20 Thread JSheble


When POST data is sent to a page, it's as if somebody typed the text into a
textarea and hit a submit button.  Even though this is being done
programmatically, the POST method will behave the same.  SOmebody in their
(your)code will have to write something similiar to:

$postData = "xVar=" . rawurlencode( "" );
PostToHost( "http://www.domain.com"; "/phpfile.php", $postData );


then your script would access that XML data through the
HTTP_POST_VARS['xVar'] or $xVar as normal

/* not my function, found on some PHP site */
function PostToHost( $host, $path, $data_to_send ) {
  $cRetVal = "";
  $fp = fsockopen( $host, 80 );

  fputs( $fp, "POST $path HTTP/1.1\n" );
  fputs( $fp, "Host: $host\n" );
  fputs( $fp, "Content-type: application/x-www-form-urlencoded\n" );
  fputs( $fp, "Content-length: " . strlen($data_to_send) . "\n" );
  fputs( $fp, "Connection: close\n\n" );
  fputs( $fp, $data_to_send );

  while( !feof( $fp )) {
$cRetVal .= fgets( $fp, 128 );
  }

  fclose( $fp );
  return $cRetVal;
}

 > > XML file is text file. If I open the file with php like call $fp,
 > > that is a long string with some special char.
 > > post method can send a long string to the server.
 > > how php can receive that long string is my problem.
 > >
 > > if can do that, php can parser the xml file send form remote
 > > computer. I want php parser the SOAP message
 > > --
 > > Yorgo Sun
 > > Project Manager
 > > Technology Dept. Tom.com
 > > Email:[EMAIL PROTECTED]  Mobile:13701243390 Phone:65283399-121 TomQ
 > > ID:yorgo http://www.ruisoft.com
 > > "Johan Holst Nielsen" <[EMAIL PROTECTED]> wrote in message
 > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 > >
 > > > > I think you understand my problem.
 > > > >
 > > > > I will use a client program to POST the XML data to a php file
 > > > > on the server base HTTP
 > > > > in php file will get the post request,
 > > > >
 > > > > the question is, how can i get the xml data in post request
 > > >
 > > > Hmm, I dont think I understand? Where do you want to do with the
 > > > XML? Cant you just make a echo() in a xml document? please
 > > > explain? 
 > > > ...
 > > > ...
 > > > 
 > > >  > > echo $xmldatavar;
 > > > ?>
 > > > ...
 > > > ...
 > > > ...
 > > >
 > > > Regards,
 > > > Johan
 >
 > --
 > PHP General Mailing List (http://www.php.net/)
 > To unsubscribe, e-mail: [EMAIL PROTECTED]
 > For additional commands, e-mail: [EMAIL PROTECTED]
 > To contact the list administrators, e-mail: [EMAIL PROTECTED]
 >
 >
 >


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: how can I get the post content in php

2001-11-15 Thread JSheble


When POST data is sent to a page, it's as if somebody typed the text into a
textarea and hit a submit button.  Even though this is being done
programmatically, the POST method will behave the same.  SOmebody in their
(your)code will have to write something similiar to:

$postData = "xVar=" . rawurlencode( "" );
PostToHost( "http://www.domain.com"; "/phpfile.php", $postData );


then your script would access that XML data through the
HTTP_POST_VARS['xVar'] or $xVar as normal

/* not my function, found on some PHP site */
function PostToHost( $host, $path, $data_to_send ) {
 $cRetVal = "";
 $fp = fsockopen( $host, 80 );

 fputs( $fp, "POST $path HTTP/1.1\n" );
 fputs( $fp, "Host: $host\n" );
 fputs( $fp, "Content-type: application/x-www-form-urlencoded\n" );
 fputs( $fp, "Content-length: " . strlen($data_to_send) . "\n" );
 fputs( $fp, "Connection: close\n\n" );
 fputs( $fp, $data_to_send );

 while( !feof( $fp )) {
   $cRetVal .= fgets( $fp, 128 );
 }

 fclose( $fp );
 return $cRetVal;
}

> > XML file is text file. If I open the file with php like call $fp,
> > that is a long string with some special char.
> > post method can send a long string to the server.
> > how php can receive that long string is my problem.
> >
> > if can do that, php can parser the xml file send form remote
> > computer. I want php parser the SOAP message
> > --
> > Yorgo Sun
> > Project Manager
> > Technology Dept. Tom.com
> > Email:[EMAIL PROTECTED]  Mobile:13701243390 Phone:65283399-121 TomQ
> > ID:yorgo http://www.ruisoft.com
> > "Johan Holst Nielsen" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > > > I think you understand my problem.
> > > >
> > > > I will use a client program to POST the XML data to a php file
> > > > on the server base HTTP
> > > > in php file will get the post request,
> > > >
> > > > the question is, how can i get the xml data in post request
> > >
> > > Hmm, I dont think I understand? Where do you want to do with the
> > > XML? Cant you just make a echo() in a xml document? please
> > > explain? 
> > > ...
> > > ...
> > > 
> > >  > > echo $xmldatavar;
> > > ?>
> > > ...
> > > ...
> > > ...
> > >
> > > Regards,
> > > Johan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] cron or something similar ?

2001-11-03 Thread JSheble


One way would be to choose a web hoster that provides you with cron access.
See JTL Networks at http://www.jtlnet.com

> -Original Message-
> From: Srinivasan Ranganathan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 02, 2001 10:22 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] cron or something similar ?
>
>
> Hi all
>
> Im working on a newsletter using php. Is there any
> way, other than using a cron job? Cuz, when i approach
> a my web host provider, how can i add a cron job to
> his system? how do other newsletter programs do this
> even when they are hosted at remote sites?
>
> Thanks in advance (Urgent plz)
>
> Regards
> Srinivasan Ranganathan
>
> ___
> *NEW*   Yahoo! Messenger for SMS. Now on your Cellforce phone*NEW*
> Visit http://in.mobile.yahoo.com/smsmgr_signin.html
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] sending email to php script

2001-10-26 Thread JSheble

A while ago an email came through here about how to parse out email message 
from a php script.  The thing that was mostly of interest to me is the 
ability to send an email to a php script, I guess through a sendmail 
alias?  I asked how to accomplish this, and never saw an answer come 
through.  So I'd like to ask again :o)

Does anybody know what would be required or necessary to send an email to 
an address that would run a php script?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]