Re: [PHP] Making a simple borderless pop up window with a Close button

2002-03-20 Thread Joe Webster

Using the options parameter will allow you to get rid of toolbarts and
scrollbars, but NOT the window's border, which the question was asking.

-Joe

Bvr [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...


 The 3rd parameter to JavaScript function window.open() allows you to
 disable a number of window elements every browser has,
 these include the toolbar (buttons), location, status, menubar,
scrollbars.
 This functionality is provided by the most common browsers and versions
 (MSIE and Netscape) and will also work in Mozilla and Netscape 6.  I
 don't know about the JavaScript implementation in Opera, but if it
 supports JS it is likely to support these options too (or at least
 ingores them).

 bvr.


 Joe Webster wrote:

 It only works in IE -- it makes use of the 'Full Screen' (F11) option and
 tricks IE into doing so... hope you don't want it to work in NS, Opera...
or
 anything else
 





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




[PHP] Re: PHP - mssql

2002-03-20 Thread Joe Webster

I doubt msSQL differs from MySQL --

$link = mssql_connect( $host, $user, $pass ) or die( Can't connect to the
DB! );
mssql_select_db( $dbname, $link ) or die( Can't select database );

$query = SELECT * FROM members WHERE user='$user' AND pass='$pass';;
$result = mssql_query( $query, $link );
if(!mssql_num_rows( $result )){
die( Username/Password no good );
}
else{
die( Everything is okay! );
}

like i said, i think all the mysql functions in php have a mssql equiv. --
like mssql_num_rows().


-Joe

Chris [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi. I have a table that contains lots of names in mssql. and i want to
make
 a page
 where each of theese individuals can login with that spesific username and
 password.
 So my question is : what is the proper (best) command to use for sending
and
 returning the info?

 ?PHP
 $link = mssql_connect($hostname,$username,$password);
 $dblink = mssql_select_db($dbname, $link);
 if ( $link  $dblink )
 {
 $query = select * from members where user = '$user' and pass = '$pass';
 $result = mssql_query( $query );
 if ( $result ) echo correct login;
 else echo wrong login;
 }
 ?

 This is not working... i have tried everything i can think of that can
work
 but with no luck.
 So if someone have a solution for me... i would apriciate it :)

 (and yes i do have defined all the vars in the script they are just not
that
 important here)

 -Chris






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




[PHP] Re: Search for words

2002-03-19 Thread Joe Webster

if(stristr( $file_data, $word )) die( word found );

that will work for one word -- for many words -- I would use:

if(preg_match(/word1|word2|word3/i, $file_data)) die( one or more words
found );

However, that does use preg -- which is MUCH faster than EREG but neither is
as fast as a straight out text search.

if you go the preg route you need to make sure you form your expression
correctly... but for words ... just | will do you fine.

-Joe

Martin Kampherbeek [EMAIL PROTECTED] wrote in message
006701c1cecb$806e9be0$[EMAIL PROTECTED]">news:006701c1cecb$806e9be0$[EMAIL PROTECTED]...
Hi,

Someone submits an URL to me. Now I want a script that checks for some words
in the file right after submitting. When the word is in the file it must
stop.
For example the words: house and school.






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




Re: [PHP] Hi! Is there any equivalent function with header?

2002-03-19 Thread Joe Webster

I wouldn't say you NEED a full url, it should handle relative URL's as well.
I don't know if it's part of the specification, but it will work.
As far as your problem I hope that line break isn't in the string and it's
just there because of the email.

-Joe

Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 On Tuesday 19 March 2002 22:20, Balaji Ankem wrote:
  Hi friend,
  Is there any equivalent statement to header (Location:
  user.php);
  Because I am getting problem with that line in fresh browser
  context.


 The correct usage is:

 header (Location: http://www.domain.com/user.php;);


 ie you need the full URL.

  How to see the php error log? And how to display an error
  messages in php?

 Read the chapter on Error Handling




 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk

 /*
 A man without a woman is like a statue without pigeons.
 */



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




Re: [PHP] Making a simple borderless pop up window with a Close button

2002-03-19 Thread Joe Webster

It only works in IE -- it makes use of the 'Full Screen' (F11) option and
tricks IE into doing so... hope you don't want it to work in NS, Opera... or
anything else

=)

-Joe

Erik Price [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 On Tuesday, March 19, 2002, at 07:12  AM, Denis L. Menezes wrote:

  I am making a database website where I need to add a small help button
  for
  every field on the form. Whenever the user clicks the small help
  button, I
  wish to show a titleless popup window containing the help text and a
  close
  button. Can someone  help me with the php script for this.

 This kind of trick isn't done in PHP but rather in JavaScript.  Search
 google for javascript tutorial and if you want to narrow that down
 some add window open resize.  As has been mentioned on this list five
 times over the past 24 hours, JavaScript is code that is executed by the
 user's browser (as opposed to PHP which is code executed by the server),
 which provides the ability to manipulate browser objects like windows.

 I don't know much JavaScript so I can't answer your question directly,
 sorry.


 Erik




 

 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]




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




[PHP] Re: Variable Variables and Mulitdimensional Arrays

2002-03-16 Thread Joe Webster

You seem to have three different ideas/questions... let me attempt to answer
them:

 Hi. I want to be able to access a key in a multidimensional array at some
 depth n without knowing before runtime what the keys are.

let's take a multidimensional array $x
$x = array(
somevar,
array(
otherval,
evenmore
)
);

echo $x[0]; should print 'somevar'
echo $x[1]; should print 'Array'
echo $x[1][0]; should print 'otherval'
echo $x[1][1]; should print 'evenmore'


 I thought this might be possible using variable variables. Here's some
 sample code using variable variables and multidimensional arrays:
 $y = 'a';
 $z = 'b';
 $t = 'c';
 $x = array(a=array(b=array(c=TRUE)));


 // I want to be able to concatenate the array indexes into one variable
 variable. This would be done in a loop at runtime.
if you want to concat all the key's of an array with a loop you could do:

reset($x); //just to make sure we are at the first key
while(list($key,$val) = each($x)){
$my_keys .= $key
}
echo $my_keys;

should result in: (using $x from my code above)

1 (I think it might even come out as 01 -- but probally 1 since it will be
treated as a int maybe =) )


 Any help would greatly be appreciated,

 Charlie



Hope that helps, still not sure what your question was or if i answered it
;)

-Joe



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




[PHP] Re: vectoring/switchyard php file

2002-03-14 Thread Joe Webster

RewriteRule ^([[:digit:]]+)(/*)$ /__obj.php\?id\=$1 [QSA]

We use this rule to rewrite

/1234

to become

__obj.php?id=1234

and pass and Query String Arguments (QSA) like ?foo=bar and so on.

-Joe


Dennis Gearon [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I seem to be getting closer to finding out how to make all requests for
 html,php,etc go through ONE particular file, and then do content
 management via that file and permissions. It involves 'mod_rewrite' in
 Apache.

 Whoa! What a learning curve for the module, though!

 So, before I start, I want to make sure it is what I want. Does anybody
 have experience in using 'mod_rewrite' and can answer this question?

 Does all the cookie, post, and get varibles plus all headers get
 preserved in a 'mod_rewrite' action?
 --

 If You want to buy computer parts, see the reviews at:
 http://www.cnet.com/
 **OR EVEN BETTER COMPILATIONS**!!
 http://sysopt.earthweb.com/userreviews/products/



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




Re: [PHP] Targetted redirection?

2002-03-13 Thread Joe Webster

If you were going to use javascript to do that, use _parent as the target --
that should reuse the window rather than making a new window.


-Joe


Erik Price [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 On Wednesday, March 13, 2002, at 03:15  PM, Ben Cheng wrote:

  I have a page within a frame that uses Header() to redirect to another
  page.
  However, I don't want the redirection to take place just within that
  frame
  set.  I want the page that it redirects to to cover over the frame.  Is
  this
  possible?

 Hm... I don't think that frames were ever intended to be manipulated at
 the level of headers!  Otherwise you could use a target attribute or
 something.  If you're willing to use a bit of JavaScript, you might be
 able to reference a new window or something like a target=_blank and
 THEN call the header() function from there... but that's more of a
 workaround than a solution.

 Good luck, sorry I don't have any other ideas.


 Erik




 

 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]




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




[PHP] Re: Checking for characters in string

2002-01-04 Thread Joe Webster

This one had me for a min, thank god for the lookahead =)

$password_string being the password in quesiton, $is_valid = true when it is
valid, false when it's not valid.

$is_valid = preg_match(/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])./,
$password_string);

I've said it before and I'll say it again, preg is ~40x faster than
ereg/eregi and (IMO) better.


Enjoy,
Joe

Richard Black [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Hi,

 I'm writing a page which will allow user's to register for an online
service. They register a username and password.

 I want the password to contain at least one lowercase letter, at least one
upper case letter, and at least one digit. So

 passW0rd would be valid, but password would not.

 Whats the most compact way to do this? substr? ereg?

 Richy

 ==
 Richard Black
 Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
 Tel: 0141 435 3504
 Email: [EMAIL PROTECTED]




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




[PHP] Re: PHP dependent on connection speed?

2002-01-03 Thread Joe Webster

Uh no,

Php is completely server-side. Any kind of request will be built up,
processed, and sent out to be sent to the user. If the user has a slow
connection it will take longer to get that information, but PHP is done.

-Joe

Charlesk [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Is the php engine slowed by users with a slow connection?

 Charles Killmer
 NetgainTechnology.com
 IIS 5.0 Win 2000 Server PHP 4.1.0



-- 
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] Re: More on images...

2002-01-03 Thread Joe Webster

$GLOBALS[ HTTP_REFERER ];


Matthew Walker [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Related to my last question about the cookies in images, is there any
way to get the referrer from the calling page without passing it as an
argument to the image generation script?

Matthew Walker
Ecommerce Project Manager
Mountain Top Herbs


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.310 / Virus Database: 171 - Release Date: 12/19/2001




-- 
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] Re: Extract a string from a string

2002-01-02 Thread Joe Webster

$find = hi;
$contents = implode(null, file($logfile));
$contents = preg_replace(/($find)/i, b
style=\color:black;background-color:#FFCC66\\\1/b, $contents);
echo $contents;

that will replace any $find with your highlighted b. Notice the i at the end
preg expression, that tells it to ignore case. The nice part about that is
that if you search for HI, if finds hi, it will highlight hi, not HI.

Enjoy.

-Joe

Qartis [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I've got a search script, where you can search for a string and it will
 return links to the HTML files that contain the string. I've also written
a
 function, where it will highlight each instance of the searched string by
 using:


 $asdf = fopen($logfile, r);
 $contents = fread($asdf,filesize($logfile));
 fclose($asdf);
 $contents=stri_replace($hi,b
 style=\color:black;background-color:#FFCC66\.$hi./b, $contents);
 echo $contents;


 (stri_replace because I wrote a function to do that)
 Where $hi is the string that is to be highlighted. Of course, if the user
 searched for HI, and Hi was found, it would show up as a highlighted HI,
 becuase it only uses $hi as the highlighted word, not the original string.
 I'm fairly sure that I could do this with ereg functions, but I've spent
too
 long looking and now it just about makes me sick just looking at it.

 Pleeease, can anybody help?


 -qartis





-- 
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] Setting PHP vars in Apache Directives

2002-01-02 Thread Joe Webster

We are deciding which language we will move in to, PHP or Perl. Once thing
that Perl allows is the setting of variables from an Apache directive
(Vhost, Directory, Location, etc).

I've been looking thru the mod_php module, but I havn't see this ability of
PHP. It's looking like it's possible to modify the mod_php module for Apache
to support this, but I wanted to see if anyone has hit this problem before.

using mod_perl it would be done as:

Location /
PerlSetVarfoobar
/Location

using mod_php it would be nice to have it as:

Location /
php_set_varfoobar
/Location

I do know of the php_value, php_flag, php_admin_value, php_admin_flag but
these are only for INI settings.

Thanks for any help before I attempt to modify mod_php ;)
Joe Webster



-- 
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] Re: Regular Expression

2002-01-02 Thread Joe Webster

preg_match(/body\s([^]*)/i, $html, $args);
$body_props = $args[1];

preg is much faster/better than ereg.
note the /i at the end of the preg, that makes it case insative, drop the i
if you want it to be case sensative on the match.

-Joe

John Monfort [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Hello everyone!

 I'm trying to get the text inside the BODY tag, using regular
 expression.

 $area = eregi('(body)(.*))',$str);

 Where $str is the string containing
 body bgcolor=#99 tex=#... ...

 When I print  $area, the string contains the entire content of $str. I
 get something like:

 body ...
 p
 .
 .
 .
 /body
 /html



 __John Monfort_
 _+---+_
  P E P I E  D E S I G N S
www.pepiedesigns.com
 The world is waiting, are you ready?
 -+___+-





-- 
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] Re: Test

2002-01-02 Thread Joe Webster

dork
John Monfort [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Test: cannot send mail, but can read.
 Please ignore.





-- 
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] INI file parsing

2002-01-02 Thread Joe Webster

If so that would be totally shitty (in the respects of effecienty)


Charlesk [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am running IIS 5.0 Windows 2000 Server.  Changes made to the ini take
effect immediately.  So it seems that php in Windows and IIS reloads the ini
every time a page is requested?

 Charles Killmer

 -- Original Message --
 From: Joe Webster [EMAIL PROTECTED]
 Date: Wed, 2 Jan 2002 15:46:32 -0500

 no you need to restart apache to change an in setting. So it loads the
 settings once per server start (at least with apache).

 Charlesk [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]...
  Does PHP parse the ini file every time a file is requested?  I am trying
 to track down a problem on various pages where the timelimit will expire.
 These are not complex pages and when I go to them they work fine.
  I have used the same browser that the user eses when the timeout occurs.
 Nothing strange for me.
  I have looked at the line that the error log specifies and it is just
 random lines.  sometimes it is a '}'.  As if the script just ran out of
time
 on that line.  BTW '}' is the closing of an if statement so it isnt stuck
in
 a loop.  And when I go to the page I make sure to use the same querystring
 that the user sent.
 
  Another thought, is the php engine slowed by users with a slow
connection?
 
  Charles Killmer
  NetgainTechnology.com





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