php-general Digest 23 Feb 2005 10:47:44 -0000 Issue 3302

Topics (messages 209200 through 209221):

Re: Hi ALL
        209200 by: Rory Browne

Having problem with "ob_start('gz_handler');" (seg fault)
        209201 by: Chris W. Parker
        209212 by: Burhan Khalid

Re: ranking product based on votes in a given week
        209202 by: Ligaya Turmelle

uploading > remote server
        209203 by: Sebastian
        209204 by: Jason Barnett

Re: Problem: mysqli class not found
        209205 by: sylikc

String validation
        209206 by: Ashley M. Kirchner
        209207 by: John Holmes
        209210 by: Ligaya Turmelle
        209215 by: Bostjan Skufca . domenca.com

Formatting e-mail using mail()
        209208 by: Jacques
        209211 by: Burhan Khalid
        209216 by: Jochem Maas

Bug or undocumented functionality of unset()?
        209209 by: karl.posmaster.com.au

Putting Evaluated Contents Of Include File Into Varialble
        209213 by: Michael Stearne

Windows DB Connection
        209214 by: Feris Thia

hiding password in form
        209217 by: William Stokes
        209218 by: M. Sokolewicz
        209219 by: William Stokes
        209220 by: Jochem Maas

Copy?
        209221 by: Wiberg

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
How to use this list best:

Search the archives at lists.php.net for [NEWBIE GUIDE] It was written
by Jay Blanchard earlier this year I believe. Read it.

Then read this: http://www.catb.org/~esr/faqs/smart-questions.html

Then try learning PHP from the PHP manual. If you come across a
problem, then explain the problem, AND WHAT STEPS YOU HAVE TAKEN TO
SOLVE THE PROBLEM YOURSELF BEFORE POSTING TO THE LIST.

Give a little back. After you've learn't a little, and you see someone
else posting a question that you know the answer to an feel you can
explain well, then hit your email clients reply button.

If you want to fit in, and you want to be taken seriously, and most
importantly if you want to learn, then consider the above points.



On Tue, 22 Feb 2005 23:21:48 +0100, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Bret Hughes wrote:
> > On Tue, 2005-02-22 at 05:27, Dhanasekar T wrote:
> >
> >>hi all,
> >>i m new to this group ...now i want to learn php.
> 
> right now? not in five minutes.
> 
> >>i want all u r guidence  to utilise this group...
> >>thanks in advance
> >>dhanas
> >
> Dhanas,
> 
> do you have php installed ?
> can you access http://php.net ? the best place to start
> reading/learning....
> 
> >
> >
> > I would start by looking at and dare I say reading the manual at
> > php.net.  Then surf around for a beginners tutorial, and start coding.
> >
> > I suspect the learning curve shape depends on whether you have any
> > previous programming experience or not.
> 
> hey! I was looking forward to being utilized. ;-)
> 
> >
> > Bret
> >
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

--- End Message ---
--- Begin Message ---
Hello,

I'm having a mysterious problem with phpMyAdmin 2.6.1. I've already
consulted the phpMyAdmin forum on sourceforge but so far I've not had
any answers come my way.

All of a sudden this morning I found that the program stops dead in its
track's during a call to "ob_start('gz_handler');". There are no errors
displayed on screen but there is one error logged to the error_log. It
is:

[Tue Feb 22 15:38:38 2005] [notice] child pid 2909 exit signal
Segmentation fault (11)

I realize this is not phpMyAdmin's problem, however it was the software
I was using when I found this problem.

I have not made any configuration changes whatsoever for quite a long
time now on my server so I don't see why it would all of a sudden stop
working.

I'm running Apache/2.0.40,  MySQL 3.23.54, and PHP 4.2.2.

I read that this might be related to hardware???? I SURE HOPE NOT! Ugh.

Any help would be appreciated.


Thanks,
Chris.

--- End Message ---
--- Begin Message ---
Chris W. Parker wrote:
[ snipped ]

I'm running Apache/2.0.40, MySQL 3.23.54, and PHP 4.2.2.


You need to upgrade to the latest PHP version, which is 4.3.10 and while you are at it, consider upgrading MySQL to 4.0.
--- End Message ---
--- Begin Message ---
how about a WHERE clause.

Maybe something like:
$query = "SELECT WEEK(date) as week, count(*) as hits, listingID as lidcount FROM invotestotal WHERE WEEK(date) = 8 ORDER BY hits DESC";

Ryan Schefke wrote:
I am trying to echo the ranking of votes (highest to lowest) that a product
received in a given week. See example of desired output.



In the  query below, It's working great and outputs ID, votes, and week;
however, I can't figure out how to get the ranking for a given week. In the
example below, how would I be able to output values in the Ranking column
for week 8 so that ID 1 is ranked 1, ID 3 is ranked 2, etc. Help?



Example ranking:

ID         Votes    Ranking            Week

1          29         1                      8

3          23         2                      8

7          2          3                      8

1          2          1                      10





-------------------- QUERY ------------------------------

$query = "SELECT WEEK(date) as week, count(*) as hits, listingID as lidcount
FROM

invotestotal GROUP BY week, lidcount ORDER BY week DESC, hits DESC";

$result  = @mysql_query($query);

while ($row = mysql_fetch_array($result, MYSQL_NUM)) {

$printweek = $row[0];

$countinvotes = $row[1];

$lidnumber = $row[2];



Then, echo values in table rows...



}

-------------------- QUERY ------------------------------





-------------------- DEFINITIONS IN QUERY ------------------------------

WEEK(date) as week :: week vote took place

count(*) as hits :: counts total votes

listingID as lidcount :: ID of the product that received the vote

-------------------- DEFINITIONS IN QUERY ------------------------------







Best regards,

Ryan



-- Respectfully, Ligaya Turmelle

"Life is a game.... so have fun"
--- End Message ---
--- Begin Message ---
i have some php forms which uploads files/images and i would like to know if
its possible to upload them to a remote server instead, if so, how?

cheers

--- End Message ---
--- Begin Message ---
Sebastian wrote:
> i have some php forms which uploads files/images and i would like to know if
> its possible to upload them to a remote server instead, if so, how?
> 
> cheers

Yes it is possible.  This is a bit of reading, but it is exactly what
you need to read:

http://php.net/manual/en/features.file-upload.php
http://php.net/manual/en/features.remote-files.php

After you read the above links you should have a pretty clear idea of
how it works (in general).  If you have a specific question about your
FTP server or whatever, feel free to come back and ask us that detailed
question instead.  :)

-- 
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message ---
David,


> I have an install of PHP 5 on Windows 2003 Server with Apache 2 and when I
> reference mysqli in my php code, I get an error that the mysqli class is not
> found.

I've wrestled with Windows 2000 Server with Apache 2 configuration,
and hopefully this will apply for 2003 as well.


> I looked at the php.ini file and I added a line for php_mysqli in the
> extensions section and I edited the extension_dir directive to point to
> c:\php\ext folder (I used "/php/ext" as the value assigned to the directive.
> 
> I made sure that the c:\php\ext folder actually had a file called
> php_mysqli.dll, which it did.

Somehow PHP ISAPI can't seem to find your extensions folder.  In my
setup, I also have PHP installed into c:\php\ext, and in effect, in my
PHP.INI I set

extension_dir = C:\php\ext

...which works just fine.  I don't think you need to use the UNIX path
structure, and that may be the root of your problem.

Another thing to check would be NTFS permissions on the PHP.INI file. 
If the user that Apache2 is running under cannot read the PHP.INI
file, then none of your extra configuration directives would appy.

Also, I think there is a bulletproof way to ensure everything works,
just in case you installed some additional extension that requires
some extra DLLs you don't want to drop into your SYSTEM32 directory. 
You can add "c:\php\ext" into your global windows environment
variable.  I've found that to work out well in the long run if you
have additional extensions and dependencies.


> No I can't start my Apache server.
> 
> I had done a default install of both Apache 2 and PHP 5.
> 
> Any ideas as to how I can get the mysqli class identified and allow my
> Apache server to start.

Apache can't start properly when the extension can't be found.  But,
if the above works and you're able to start up Apache, write a small
script and put in

<? phpinfo(); ?>

and run through the wealth of information that is displayed to make
sure "mysqli" is installed as an extension.


/sylikc

--- End Message ---
--- Begin Message ---
How can I check that a string is no more than 6 characters long and only contains alpha characters (no numbers, spaces, periods, hyphens, or anything else, just letters.)
--- End Message ---
--- Begin Message --- Ashley M. Kirchner wrote:

How can I check that a string is no more than 6 characters long and only contains alpha characters (no numbers, spaces, periods, hyphens, or anything else, just letters.)


if(preg_match('/^[a-zA-Z]{0,6}$/',$string)) { echo 'good'; } else { echo 'bad'; }

Change to {1,6} if you want to ensure the string isn't empty.

--

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message --- or if you aren't into regex (which I find confusing and still am trying to learn):

if ((strlen(trim($string)) <=6) && ctype_alpha(trim($string)))
{ echo 'good'; }
else
{ echo 'bad'; }



John Holmes wrote:

Ashley M. Kirchner wrote:


How can I check that a string is no more than 6 characters long and only contains alpha characters (no numbers, spaces, periods, hyphens, or anything else, just letters.)


if(preg_match('/^[a-zA-Z]{0,6}$/',$string)) { echo 'good'; } else { echo 'bad'; }

Change to {1,6} if you want to ensure the string isn't empty.


-- Respectfully, Ligaya Turmelle

"Life is a game.... so have fun"
--- End Message ---
--- Begin Message ---
> or if you aren't into regex (which I find confusing and still am trying
> to learn):

Read the book "Mastering Regular Expressions" or first 300 pages of it - trust 
me, it is worth the labour (personal experience)!



On Wednesday 23 February 2005 07:44, Ligaya Turmelle wrote:
>
> if ((strlen(trim($string)) <=6) && ctype_alpha(trim($string)))
> { echo 'good'; }
> else
> { echo 'bad'; }
>
> John Holmes wrote:
> > Ashley M. Kirchner wrote:
> >>    How can I check that a string is no more than 6 characters long and
> >> only contains alpha characters (no numbers, spaces, periods, hyphens,
> >> or anything else, just letters.)
> >
> > if(preg_match('/^[a-zA-Z]{0,6}$/',$string))
> > { echo 'good'; }
> > else
> > { echo 'bad'; }
> >
> > Change to {1,6} if you want to ensure the string isn't empty.

-- 
Best regards,

Bostjan Skufca
system administrator

Domenca d.o.o. 
Phone: +386 4 5835444
Fax: +386 4 5831999
http://www.domenca.com

--- End Message ---
--- Begin Message ---
Can I format an e-mail message with html tags inside the mail() function? 
If not, how can I go about it? I would like to format the layout of the 
e-mail message using tables, colors and perhaps images.

Regards - Jacques 

--- End Message ---
--- Begin Message --- Jacques wrote:
Can I format an e-mail message with html tags inside the mail() function? If not, how can I go about it? I would like to format the layout of the e-mail message using tables, colors and perhaps images.

Please, FFS RTFM > http://www.php.net/manual/en/function.mail.php
--- End Message ---
--- Begin Message --- Burhan Khalid wrote:
Jacques wrote:

Can I format an e-mail message with html tags inside the mail() function? If not, how can I go about it? I would like to format the layout of the e-mail message using tables, colors and perhaps images.


Please, FFS RTFM > http://www.php.net/manual/en/function.mail.php


and when your done brushing up on the mail function and related material have a google for 'phpmailer' - a lovely class that abstracts out all the headache stuff associated with formatting an email properly (headers, multi-part MIME, boundaries, etc)

Tip: don't go stuffing HTML tagsoup into the body of an email mail()ing it. not
everyone likes html email - some can't read it [AOL users/email-apps are a 
nightmare]
its better to offer a plaintext version of the message as well as the singing 
and
dancing version (best/safest is to go purely plaintext but then again you 
probably
have one of those insistent marketing depts on you back ;-)....
don't assume that because Outlook can view your html email as intended that 
other
programs can too! Another thing - if you intend to include images beware that 
there
are 2 ways to do it.

1 include the image file in the msg (make use of a 'cid:' src value for the IMG 
tag
in the HTML)
2. reference images that are on your public webserver.... this is way better it 
terms
of bnadwidth, sometimes there is a requirement for offline reading (in which 
case you
may have to embed the files instead)

--- End Message ---
--- Begin Message ---
Hi All,

Does unset() create a copy of the array and then overwrite the 
original
somehow 
destroying the reference?
In the example below, no item has it's value set to 'foo', however if 
the
$stuff array is 
accessed directly (see commented line) rather than by reference it 
works
fine.  In 
addition to this, if the unset(); line is commented, the reference 
will
also work.

Anyone know why?

Thanks,

Karl.
-----------------------------------------------
<?php
$stuff = array(array('one','two'),
array('one','two'),
array('three','four'),
array('five','six'),
array('seven','eight'),
array('nine','ten'));

print '<pre>'; print_r($stuff); print '</pre>';

foreach ($stuff as $key => &$values) {
    print "on key:$key<br>";
        if(($key%2)==0){
            print "Running unset for $key <br>";
            unset ($stuff[$key]);
        }else{
            print "Running change for $key <br>";
            $values[1]='foo';
//          $stuff[$key][1] = 'foo';
        }
}
print '<pre>'; print_r($stuff); print '</pre>';
?>

--- End Message ---
--- Begin Message ---
Hi,

I have an file that contains PHP code..variables, db, etc.  Is it
possible to include the evaluted contents of that file into a variable
in another, the calling PHP script?

Essentailly I am looking to do something like

include("myCode.php") -> HTML Output -> $myVariable.

I know could do this with something like
$myVariable=file_get_contents("http://localhost/myCode.php";) but I am
not allowed to use urls in file opens.

Any suggestions?

Thanks,
Michael

--- End Message ---
--- Begin Message ---
Hi,

I'm currently running Apache+PHP under Linux environment. And now
trying to connect to Ms Access (.mdb) database file which is shared by
a Windows station. What library I have to install & use ?

Thanks,
Feris

--- End Message ---
--- Begin Message ---
Hello,

How can hide the typed password in web form with *** (asterix)? I dont wan't 
everyone to seen evereone passwords in plain text.

Thanks
-Will 

--- End Message ---
--- Begin Message --- William Stokes wrote:
Hello,

How can hide the typed password in web form with *** (asterix)? I dont wan't everyone to seen evereone passwords in plain text.

Thanks
-Will
<input type="password">
and it's an asterisk, not asterix (the comic)

--- End Message ---
--- Begin Message ---
OK ;-)

"M. Sokolewicz" <[EMAIL PROTECTED]> kirjoitti 
viestiss�:[EMAIL PROTECTED]
> William Stokes wrote:
>> Hello,
>>
>> How can hide the typed password in web form with *** (asterix)? I dont 
>> wan't everyone to seen evereone passwords in plain text.
>>
>> Thanks
>> -Will
> <input type="password">
> and it's an asterisk, not asterix (the comic) 

--- End Message ---
--- Begin Message --- William Stokes wrote:
Hello,

How can hide the typed password in web form with *** (asterix)? I dont wan't everyone to seen evereone passwords in plain text.

use a form element with type="password" e.g:

<input name="WilliesPwdField" type="passwd" />

not really a php question this, also I'd put money on getting a answer via
google on any relevant search... like so:

google on:
hide text in password field HTML

click two links:
(second link in goog results) then..
(Using Forms) http://www.weijers.net/guide/forms.html

find this:
http://www.weijers.net/guide/forms.html

read it,
rinse and repeat.


Thanks
-Will


--- End Message ---
--- Begin Message ---
Hi there!

How do I copy a file from an URL to my server?
I url fopen wrappers is NOT enabled, and I'm not allowed to do that.

/G
@varupiraten.se
-- 
Internal Virus Database is out-of-date.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 2005-02-10

--- End Message ---

Reply via email to