php-general Digest 18 Feb 2007 14:35:54 -0000 Issue 4632
Topics (messages 248987 through 248993):
$_FILES path on client's machine?
248987 by: Skip Evans
248991 by: Sancar Saran
Help with sessions on Log in and Log out
248988 by: Ashish Rizal
Re: LOL, preg_match still not working.
248989 by: Beauford
needed Yahoo like window for db query.
248990 by: Chris Carter
Re: PHP Startup: Unable to load dynamic library
248992 by: Haydar TUNA
Re: reverse http authentication
248993 by: Haydar TUNA
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 ---
Hey all,
I get the feeling from not finding an argument for
the path on the client's machine for the complete
path of a file in $_FILES that it might not be
available for security reasons?
The reason I am interested in this is to restore
the value of a input type='file' field in a form if
the user has to return to the form for validation
reasons.
I'd like to restore the full value so the user does
not have to browse the file again.
Is there a way to do this?
I thought perhaps there might be a
$_FILES['image']['path'] value or something.
Thanks!
--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240
=-=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and versatile
PHP/MySQL development framework.
http://phpenguin.bigskypenguin.com
--- End Message ---
--- Begin Message ---
Hi,
No solution from php...
If you find you way to read form file tag path via js you ma send this value
to server and may store sql then send back.
Aslo I'm not sure to sending back those stored info to client solve the
problem.
If you really want to do this.
You have to write your own file browser uploader form via Flash...
regards
On Sunday 18 February 2007 04:19, Skip Evans wrote:
> Hey all,
>
> I get the feeling from not finding an argument for
> the path on the client's machine for the complete
> path of a file in $_FILES that it might not be
> available for security reasons?
>
> The reason I am interested in this is to restore
> the value of a input type='file' field in a form if
> the user has to return to the form for validation
> reasons.
>
> I'd like to restore the full value so the user does
> not have to browse the file again.
>
> Is there a way to do this?
>
> I thought perhaps there might be a
> $_FILES['image']['path'] value or something.
>
> Thanks!
> --
> Skip Evans
> Big Sky Penguin, LLC
> 61 W Broadway
> Butte, Montana 59701
> 406-782-2240
>
> =-=-=-=-=-=-=-=-=-=-=
>
> Check out PHPenguin, a lightweight and versatile
> PHP/MySQL development framework.
>
> http://phpenguin.bigskypenguin.com
--- End Message ---
--- Begin Message ---
I am having some problem working with my script on session
stuffs. Well, i have a login page which authenticates users by
using sql script then if login is successful i have
PHP Code:
$_SESSSION['logged in']=true; and $_SESSION[userid]=$userid
and when login is true i have included the page based on the
access level of users . Like if it is a regular user i have
include "user.php" ; exit() and if admin i have included admin page.
Also i have a log out script which unsets the sessions variable
and distroy the session at last.
Also when admin loggs in to admin page i have a small php script
that checks for those session variables and if the are set and
"is true" then the pages are displayed.
My problem is when admin just comes out to the login page again
without log out it allows to login to the main page but in main
page if any < a href> link is clicked it goes back to login page.
So then i will have to go back and log out first and then log
in.. I am not sure why this strange things happens.
Also is there any way i can have a feature like when the users
click back button it wont allow to go back to that page unless he
is using the back button provided by the web interface.
I am new at the session stuffs, so i am not sure what i am doing
is really a safe way to code a php page. are there any other
things that i need to be aware of while using sessions.
Any suggestions or thoughts would be highly appreciated.
Thanks
--- End Message ---
--- Begin Message ---
Mails been down since this morning (sorry, that's yesterday morning).
Anyway, not sure if this went through, so here it is again.
------
The bottom line is I want to allow everything in the expression and nothing
else. The new line does not seem to be an issue - I can put as many returns
as I want, but as soon as I add some punctuation, it falls apart.
As I said before, the ! and the period from my original example are reported
as invalid - as they are in the expression they should be valid, I'm sure
there are other examples as well, but you can see what the problem is. If I
take out the ! and period from my example and leave the new lines in, it
works fine.
Thanks
> -----Original Message-----
> From: Gregory Beaver [mailto:[EMAIL PROTECTED]
> Sent: February 17, 2007 12:21 PM
> To: Beauford
> Cc: PHP
> Subject: [PHP] Re: LOL, preg_match still not working.
>
> Beauford wrote:
> > Hi,
> >
> > I previously had some issues with preg_match and many of
> you tried to help,
> > but the same problem still exists. Here it is again, if
> anyone can explain
> > to me how to get this to work it would be great - otherwise
> I'll just remove
> > it as I just spent way to much time on this.
> >
> > Thanks
> >
> > Here's the code.
> >
> > if(empty($comment)) { $formerror['comment'] = nocomments;
> > }
> > elseif(!preg_match('|[EMAIL PROTECTED]&*();:_.\\\\ /\t-]+$|',
> > $comment)) {
> > $formerror['comment'] = invalidchars;
> > }
> >
> > This produces an error, which I believe it should not.
> >
> > Testing 12345. This is a test of the emergency broadcast system.
> >
> > WAKE UP!!!!!!
>
> Hi,
>
> Your sample text contains newlines. If you wish to allow newlines,
> instead of " \t" you should use the whitespace selector "\s"
>
> <?php
> $comment = 'Testing 12345. This is a test of the emergency
> broadcast system.
>
> WAKE UP!!!!!!';
> if(!preg_match('|[EMAIL PROTECTED]&*();:_.\\\\\s/-]+$|', $comment)) {
> echo 'oops';
> } else {
> echo 'ok';
> }
> ?>
>
> Try that code sample, and you'll see that it says "ok"
>
> What exactly are you trying to accomplish with this
> preg_match()? What
> exactly are you trying to filter out? I understand you want to
> eliminate "invalid characters" but why are they invalid? I
> ask because
> there may be a simpler way to solve the problem, if you can
> explain what
> the problem is.
>
> Thanks,
> Greg
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--- End Message ---
--- Begin Message ---
Need some help on getting some database result in a css popup like yahoo. The
requirement is to open a div or a window similar to yahoo one. As you can
see from the link below.
http://news.yahoo.com/s/ap/20070218/ap_on_go_co/us_iraq
On this if you click on the Images next to the links "Iraq", "President
Bush", "Hillary Rodham Clinton", "Pentagon", etc. This opens a div within
the page with the search result. They are using some JavaScript to achieve
this.
Is there anyone with idea of where to find a code for a similar kind of
window. I need to present data from database in a similar kind or window.
Any link, text to search in google or code would do :-|
Thanks in advance,
Chris
--
View this message in context:
http://www.nabble.com/needed-Yahoo-like-window-for-db-query.-tf3247592.html#a9027932
Sent from the PHP - General mailing list archive at Nabble.com.
--- End Message ---
--- Begin Message ---
Hi,
I think , you work on a Linux machine and you install together PHP
and Apache in the source code. Can I give your ./configure paratemether. I
think there is a problem in the configuration parameters.
"Noah" <[EMAIL PROTECTED]>, haber iletisinde sunlari
yazdi:[EMAIL PROTECTED]
>
> Hi,
>
> I am running apache-2.2.4 and php5-5.2.1-2
> and I am find some php related errors accumulating in
> /var/log/messages - look below.
>
> I've rebuilt php5 and apache2.2.4 and still the same issues. what else
> could be going on here.
>
> also 'apache restart' is fine but 'apache graceful' core dumps.
>
> any clues,
>
> Noah
>
>
> here they are:
>
> Feb 17 17:07:03 typhoon httpd: PHP Warning: PHP Startup: Unable to load
> dynamic library '/usr/local/lib/php/20060613-debug/ftp.so' - Cannot open
> "/usr/local/lib/php/20060613-debug/ftp.so" in Unknown on line 0
> Feb 17 17:07:03 typhoon httpd: PHP Warning: PHP Startup: Unable to load
> dynamic library '/usr/local/lib/php/20060613-debug/ldap.so' - Cannot open
> "/usr/local/lib/php/20060613-debug/ldap.so" in Unknown on line 0
--- End Message ---
--- Begin Message ---
You can use this programming part in here. If you have any question, you can
send mail
<?php
if ( ( !isset( $PHP_AUTH_USER )) || (!isset($PHP_AUTH_PW)) || (
verify($PHP_AUTH_USER,$PHP_AUTH_PW) == false) )
{
header( 'WWW-Authenticate: Basic realm="Header of the password box"' );
header( 'HTTP/1.0 401 Unauthorized' );
echo "<h1>Authorization Required.</h1>";
exit;
}
else
{
session_start();
session_register("user");
$_SESSION["user"]= $PHP_AUTH_USER;
header( 'Location: http://www.doain.com');
}
function verify($username, $password)
{
$usercount = 1;
$myusername = array (0=>"username");
$mypassword = array (0=>"password");
$auth = false;
for ($i = 0; $i < $usercount; $i ++)
if ( ($myusername[$i] == $username) && ($mypassword[$i] == $password) )
$auth = true;
return $auth;
}
?>
Haydar TUNA
Republic Of Turkey - Ministry of National Education
Education Technology Department Ankara
Web: http://www.haydartuna.net
"Chris W" <[EMAIL PROTECTED]>, haber iletisinde sunlari
yazdi:[EMAIL PROTECTED]
>I want to read a page that is protected with http authentication. How do I
>pass the user name and password to be authenticated with my php code?
>
> --
> Chris W
> KE5GIX
>
> "Protect your digital freedom and privacy, eliminate DRM, learn more at
> http://www.defectivebydesign.org/what_is_drm"
>
> Gift Giving Made Easy
> Get the gifts you want & give the gifts they want
> One stop wish list for any gift, from anywhere, for any occasion!
> http://thewishzone.com
--- End Message ---