RE: [PHP] Re: $PHP_SELF question
Try and create a new php file with the following code and read the result: ?php phpinfo(); ? thats it, a lot of useful info there! Regards Lars -Original Message- From: Joel Colombo [mailto:[EMAIL PROTECTED]] Sent: 18 April 2002 16:03 To: [EMAIL PROTECTED] Subject: [PHP] Re: $PHP_SELF question did u try $HTTP_REFERER ? that might do it... havent tested with an include though. Joel Theodore Brinkman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I've got an include file that provides the basic framework for every page on my site, and at the bottom of each page, I want to spit out when the page was last updated. I used $PHP_SELF inside the include file, and got the include file's path. Is there a variable equivalent to $PHP_SELF that returns the path for the file that is being executed? Basically, if I'm running index.php, and I include template.php is there any way, from inside template.php, to get index.php short of passing it as a parameter? - Theo -- 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] using .htaccess to repoint
Hi, This might be helpful http://rob-mike.php4hosting.com/mike/htaccess/ Lars -Original Message- From: Adrian Murphy [mailto:[EMAIL PROTECTED]] Sent: 10 April 2002 12:29 To: [EMAIL PROTECTED] Subject: [PHP] using .htaccess to repoint Hi, my isp uses wildcard dns to point to the root. I want to put a .htaccess file in the root to repoint the wildcard requests to a sub-folder but leave the normal request alone. plese help or tell me an article i can read(i've looked but haven't found one specifically dealing with this.) adrian. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Custom 404
http://rob-mike.php4hosting.com/mike/htaccess/ -Original Message- From: Andrew Brampton [mailto:[EMAIL PROTECTED]] Sent: 02 April 2002 13:50 To: [EMAIL PROTECTED] Subject: Re: [PHP] Custom 404 .htaccess :) Andrew - Original Message - From: Craig Donnelly [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 02, 2002 1:36 PM Subject: [PHP] Custom 404 Custom 404 -- 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] Making a simple borderless pop up window with a Close button
Hi, I have a script that might do what you want, I don't have time to explain but have a look at: http://www.epson.co.uk/product/printers/inkjet/styc80/flash/index.html and launch the site! ** SCRIPT /* CHROMELESS WINDOWS v.31.0 [ 4.50K ] (c) Gabriel Suchowolski,2000 | www.microbians.com Licensed under GNU LGPL (www.gnu.org) */ function chromeless(u,n,W,H,X,Y,cD,cU,cO,cL,tH,tW,wB,wBs,wBG,wBGs,wNS,fSO){ var c=(document.allnavigator.userAgent.indexOf(Win)!=-1)?1:0 var w=window.screen.width; var h=window.screen.height var W=W||w; W=(typeof(W)=='string'?Math.ceil(parseInt(W)*w/100):W); W+=2*c var H=H||h; H=(typeof(H)=='string'?Math.ceil(parseInt(H)*h/100):H); H+=23*c var X=X||Math.ceil((w-W)/2) var Y=Y||Math.ceil((h-H)/2) var s=,width=+W+,height=+H if(c){ var cTIT='\n'+ 'htmlheadMETA HTTP-EQUIV=imagetoolbar CONTENT=no\n'+ 'script\n'+ 'var iclod=new Image();iclod.src='+cD+';var iclou=new Image();iclou.src='+cU+';var icloo=new Image();icloo.src='+cO+';var iload=new Image();iload.src='+cL+';\n'+ 'document.onselectstart=new Function(return false;);document.ondragstart=new Function(mWIN();return false;);document.oncontextmenu=new Function(return false;);document.onmousemove=mWIN\n'+ 'b=-1;\n'+ 'function wLoa(){if(top.loaded){bloa.style.visibility=hidden;sRes()}else setTimeout(wLoa(),500)}\n'+ 'function sRes(){bclo.style.pixelLeft=document.body.clientWidth-18;bloa.style.pixelLef t=document.body.clientWidth-38}\n'+ 'function mWIN(){\n'+ 'if(b==0){document.body.bgColor='+wBG+';parent.bM.document.body.bgColor=' +wB+';parent.bT.document.body.bgColor='+wB+';parent.bB.document.body.bgCo lor='+wB+';parent.bL.document.body.bgColor='+wB+';parent.bR.document.bod y.bgColor='+wB+';b=-1}\n'+ 'if(b==2){px=event.screenX-ofx-1;py=event.screenY-ofy-1;top.window.moveTo(px ,py);}\n'+ 'if(b==1){document.body.bgColor='+wBGs+';parent.bM.document.body.bgColor= '+wBs+';parent.bT.document.body.bgColor='+wBs+';parent.bB.document.body.b gColor='+wBs+';parent.bL.document.body.bgColor='+wBs+';parent.bR.documen t.body.bgColor='+wBs+';ofx=event.x;ofy=event.y;b=2}\n'+ '}/script/head\n'+ 'body onresize=sRes() bgcolor='+wBG+'\n'+ 'div style=position:absolute;left:0px;top:4px'+tH+'/div\n'+ 'img id=bmov style=position:absolute;left:-50px;top:-50px onmousedown=b=1;mWIN() onmouseup=b=0;mWIN() border=0 src= width=150% height=500\n'+ 'img id=bclo style=position:absolute;top:4px;left:'+(W-20)+'px; src='+cU+' border=0 width=11 height=11 onmouseover=this.src=icloo.src onmouseout=this.src=iclou.src onmouseup=this.src=iclou.src onmousedown=this.src=iclod.src onclick=top.window.close()\n'+ 'img id=bloa style=position:absolute;top:4px;left:'+(W-40)+'px; src='+cL+' border=0 width=11 height=11\n'+ 'scriptwLoa()/script\n'+ '/body\n'+ '/html' cTIT=cTIT.replace(/\//g,\\\/).replace(/\/g,\\\).replace(/\n/g,\\n) var cFRM='TITLE'+tW+'/TITLE\n'+ 'script\n'+ 'top.loaded=false\n'+ 'function mTIT(){\n'+ ' if(frames.length6){\n'+ ' fT.document.bgColor='+wBG+';fT.document.write('+cTIT+');fT.document.clos e()\n'+ ' bM.document.bgColor='+wB+';bL.document.bgColor='+wB+';bR.document.bgColo r='+wB+';bB.document.bgColor='+wB+';bT.document.bgColor='+wB+'\n'+ ' } else setTimeout(mTIT(),20)\n'+ '}\n'+ 'mTIT()\n'+ '/script\n'+ 'frameset onselectstart=return false onload=top.loaded=true border=0 framespacing=0 frameborder=0 cols=1,100%,1\n'+ ' frame name=bL src=about:blank scrolling=no noresize\n'+ ' frameset border=0 framespacing=0 frameborder=0 rows=1,20,1,100%,1\n'+ ' frame name=bT src=about:blank scrolling=no noresize\n'+ ' frame name=fT src=about:blank scrolling=no noresize\n'+ ' frame name=bM src=about:blank scrolling=no noresize\n'+ ' frame name=main src='+u+' '+fSO+'\n'+ ' frame name=bB src=about:blank scrolling=no noresize\n'+ ' /frameset\n'+ 'frame name=bR src=about:blank scrolling=no noresize\n'+ '/frameset\n'+ '/HTML' var CWIN=window.open(,n,fullscreen=1+s) CWIN.moveTo(5000,0) CWIN.resizeTo(W,H) CWIN.document.write(cFRM) CWIN.document.close()
RE: [PHP] Object reference
Hi, Use to reference one variable to another! $b = $a; Lars -Original Message- From: Lucijan [mailto:[EMAIL PROTECTED]] Sent: 21 March 2002 10:20 To: [EMAIL PROTECTED] Subject: [PHP] Object reference I can't understand why this works like it does. class MyObj { var $Name; function MyObj($Name) { $this-Name = $Name; } } $a = new MyObj('MyObjName'); $b = $a; $b-Name = 'NoName'; echo $a-Name; Last line will output 'MyObjName' instead of 'NoName' (like I was expecting) I'd expect $a and $b to behave like reference pointers (change in $b is reflected in $a and vice versa) instead of copiing $a to $b (beiing a Delphi programmer this is as natural to me as the Sun raising in east and setting in west :-) So, is there a way to do this; pointers or something maybe? Lucijan -- 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] why doesnt this work???
Hi, I am not an expert, but try if( $line[0]='$bruker' and $line[1]='$passord') {echo hei $bruker.;} else {echo FEIL;} atb Lars -Original Message- From: chris [mailto:[EMAIL PROTECTED]] Sent: 20 March 2002 14:22 To: [EMAIL PROTECTED] Subject: Re: [PHP] why doesnt this work??? nope... that did not do the trick... -Chris Rick Emery [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... if( $line[1]='$bruker' and $line[2]='$passord') {echo hei $bruker.;} else {echo FEIL;} -Original Message- From: chris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 8:15 AM To: [EMAIL PROTECTED] Subject: [PHP] why doesnt this work??? this script receives vars b and p from a form. If b and p matches the echo on IF, then it works just fine. The problem is that if the vars dont match the ELSE ECHO does not apear... why not? ? $bruker = $HTTP_POST_VARS[b]; $passord = $HTTP_POST_VARS[p]; $hostname = ; $username = ; $password = ; $dbname = ; MSSQL_CONNECT($hostname,$username,$password); mssql_select_db($dbname); $query = select * from medlemmer where bruker = '$bruker' and passord = '$passord'; $result = mssql_query( $query ); for ($i = 0; $i mssql_num_rows( $result ); ++$i) { $line = mssql_fetch_row($result); if( $line[1]='$bruker' and $line[2]='$passord') echo hei $bruker.; else echo FEIL; } ? -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] why doesnt this work???
Please try this :) for ($i = 0; $i mssql_num_rows( $result ); $i++) { $line = mssql_fetch_row($result); if (($line[0] == $bruker) ($line[1] == $passord)) { echo hei $line[0]; } else { echo FEIL; } Lars Stampe -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: 20 March 2002 14:30 To: 'chris'; [EMAIL PROTECTED] Subject: RE: [PHP] why doesnt this work??? First: you need == not = to test equivalence. Second, use not '; otherwise $vars will not expand if( $line[1]==$bruker and $line[2]==$passord) {echo hei $bruker.;} else {echo FEIL;} -Original Message- From: chris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 8:22 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] why doesnt this work??? nope... that did not do the trick... -Chris Rick Emery [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... if( $line[1]='$bruker' and $line[2]='$passord') {echo hei $bruker.;} else {echo FEIL;} -Original Message- From: chris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 8:15 AM To: [EMAIL PROTECTED] Subject: [PHP] why doesnt this work??? this script receives vars b and p from a form. If b and p matches the echo on IF, then it works just fine. The problem is that if the vars dont match the ELSE ECHO does not apear... why not? ? $bruker = $HTTP_POST_VARS[b]; $passord = $HTTP_POST_VARS[p]; $hostname = ; $username = ; $password = ; $dbname = ; MSSQL_CONNECT($hostname,$username,$password); mssql_select_db($dbname); $query = select * from medlemmer where bruker = '$bruker' and passord = '$passord'; $result = mssql_query( $query ); for ($i = 0; $i mssql_num_rows( $result ); ++$i) { $line = mssql_fetch_row($result); if( $line[1]='$bruker' and $line[2]='$passord') echo hei $bruker.; else echo FEIL; } ? -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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] why doesnt this work???
Hi, Let me explain what is wrong with this line: if( $line[1]='$bruker' and $line[2]='$passord') when you use = instead of == it will always be true because you set $line[1] to $bruker, you have to compare them by using ==. Also looking at your sql query $line[0] would contain your username and $line[1] your password! try after $line = mssql_fetch_row($result); echo DEBUG : $line[0] - $line[1] - $line[2]; if( $line[1]='$bruker' and $line[2]='$passord') echo hei $bruker.; else echo FEIL; Regards Lars Stampe -Original Message- From: chris [mailto:[EMAIL PROTECTED]] Sent: 20 March 2002 14:41 To: [EMAIL PROTECTED] Subject: Re: [PHP] why doesnt this work??? Thanx for all the help guys, but i have tried all of the sugestions but the one that works best is the one i startet with... but that one does not work 100% either...im so confused my head is about to fall of i just dont get it... Robert Collins [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Try this if($line[1] == '$bruker' $line[2] == '$passord'){ echo hei $bruker.; }else{ echo FEIL; } Robert W. Collins II Webmaster New Orleans Regional Transit Authority Phone : (504) 248-3826 Email : [EMAIL PROTECTED] -Original Message- From: chris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 8:33 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] why doesnt this work??? it all works just fine exept that when the vars is wrong i get a blank page...wich means that the else echo doesnt work for some reason... and if i use == the correct vars become wrong... but it does print the else echo... hmm... Robert Collins [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... instead of 'and' use '' if($line[1] == $bruker $line[2] == $passord){ echo hei $bruker.; }else{ echo FEIL; } Robert W. Collins II Webmaster New Orleans Regional Transit Authority Phone : (504) 248-3826 Email : [EMAIL PROTECTED] -Original Message- From: R'twick Niceorgaw [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 8:25 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] why doesnt this work??? You need two = signs for comparision not just one . Also I think you need to enclose the variables in double quote. if( $line[1]==$bruker and $line[2]==$passord) echo hei $bruker.; else echo FEIL; -Original Message- From: chris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 8:15 AM To: [EMAIL PROTECTED] Subject: [PHP] why doesnt this work??? this script receives vars b and p from a form. If b and p matches the echo on IF, then it works just fine. The problem is that if the vars dont match the ELSE ECHO does not apear... why not? ? $bruker = $HTTP_POST_VARS[b]; $passord = $HTTP_POST_VARS[p]; $hostname = ; $username = ; $password = ; $dbname = ; MSSQL_CONNECT($hostname,$username,$password); mssql_select_db($dbname); $query = select * from medlemmer where bruker = '$bruker' and passord = '$passord'; $result = mssql_query( $query ); for ($i = 0; $i mssql_num_rows( $result ); ++$i) { $line = mssql_fetch_row($result); if( $line[1]='$bruker' and $line[2]='$passord') echo hei $bruker.; else echo FEIL; } ? -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 -- 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] PHP Books
http://www.wrox.com/ I really found Beginning PHP from Wrox very helpful, had a hard time stopping reading it! Great useful real life examples! Lars -Original Message- From: Daniel [mailto:[EMAIL PROTECTED]] Sent: 08 May 2001 00:59 To: [EMAIL PROTECTED] Subject: [PHP] PHP Books Hi, I'm just starting PHP and am looking for some books that you'd all recommend. I've used quite a few of the SAMS books before and have found them to be really good, i also have access to The PHP Dictionary which i've also found to be really good. But are there any books which you would recommend?? Thanks in advance Daniel -- 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] textarea -- what happens to my new lines
I am making a e-card page, and I am having a problem with with my message box which is a textarea when I am previewing or saving/recalling the text all the newline characters are gone. Any good ideas! Thanks Lars Stampe
RE: [PHP] textarea -- what happens to my new lines
Thanks for the idea, it didn't work, let me just explain a bit further! this is a simple version of the code input.htm:: form name=form method=get action=show.php textarea name=textfield cols=45 rows=5 wrap=HARD/textarea p input type=submit name=Submit value=Submit /form show.php:: ?php echo $textfield; ? When I put in : 1 2 3 4 I get: 1 2 3 4 how do I fix this ( want it to appear like it was typed!)? Regards Lars Stampe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 03 May 2001 12:44 To: Stampe, Lars; [EMAIL PROTECTED] Subject: Re: [PHP] textarea -- what happens to my new lines At 13:10 03.05.01 +0200, you wrote: I am making a e-card page, and I am having a problem with with my message box which is a textarea when I am previewing or saving/recalling the text all the newline characters are gone. Any good ideas! Thanks Lars Stampe Try textarea name=foo rows=10 cols=50 wrap=physical/textarea this make hard LF´s Oliver -- 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]