php-windows Digest 17 Jul 2001 07:53:01 -0000 Issue 655 Topics (messages 8335 through 8346): Can i use PHP to make Voice Chat? 8335 by: Timthothy php inside the html? 8336 by: Lukas Noskievic 8337 by: Paul Smith The problem of cookie 8338 by: science 8339 by: Flint Doungchak 8340 by: science 8341 by: science I am going out of my mind, can anyone help 8342 by: Nintendoodle 8344 by: Ivan Milanez Castellanos A strategy for dealing with the cookie 8343 by: science Income on the Net! 8345 by: Noel Hadfield I have a function wrote by myself, try it. 8346 by: tttk 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] ----------------------------------------------------------------------
If you have any other idea, also tell me...thanks a lot timchan
Can you anybody help? I can't run the script inside the html document. <body> <? echo "Hello world" ?> </body> Pages written in php and saved as xxx.php works good so i think php.ini and httpd.conf (Apache WebServer) are OK. Section 'short_open_tag' in php.ini is setting to 'on'. Please help...
In order for any php tag to be acted upon, the server needs to know to look for it. If you're putting PHP tags in HTML documents it will not look for them and therefore will not act on them. What you need to do is either set up your server to process HTML files (which slows the server down a lot if you don't have many HTML pages with php in them) or you can rename all your HTML files that have PHP tags in them to .php. I hope that made sense. Reply if you have any problems. Lukas Noskievic wrote: > Can you anybody help? I can't run the script inside the html document. > > <body> > <? echo "Hello world" ?> > </body> > > Pages written in php and saved as xxx.php works good so i think php.ini and >httpd.conf (Apache WebServer) are OK. Section 'short_open_tag' in php.ini is setting >to 'on'. > > Please help... > > -- > PHP Windows 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] -- Paul Smith [EMAIL PROTECTED] http://www.dostuff.net
Hi all, I set the cookie and retrieve it at the same page but when I click botton twice, it only appear once. No matter how many times I click, it is always one time short. How can I solve this problem? When I click the botton, it will get the variable from cookie then connect to the database to retrive the data. But the value of the variable is always empty at the last time. When I checked the cookie, the variable got the value already. I don't know if I can set and retrieve cookie at the same page. Thanks a lot Dper
Dper, You can't set and retrieve the cookie on the same page. Please see: http://www.netscape.com/newsref/std/cookie_spec.html for an explanation of the specification. You basically have to reload the page before the cookie variable you set is avaiable. Try using sessions if you can. -Flint -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, July 16, 2001 4:58 AM To: [EMAIL PROTECTED] Subject: [PHP-WIN] The problem of cookie Hi all, I set the cookie and retrieve it at the same page but when I click botton twice, it only appear once. No matter how many times I click, it is always one time short. How can I solve this problem? When I click the botton, it will get the variable from cookie then connect to the database to retrive the data. But the value of the variable is always empty at the last time. When I checked the cookie, the variable got the value already. I don't know if I can set and retrieve cookie at the same page. Thanks a lot Dper -- PHP Windows 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]
Flint, Thanks for answering. Well, I'll figure out how to solve it at the same page. In addition, Session can't solve this problem, I tried this way before. Thanks again Dper "Flint Doungchak" <[EMAIL PROTECTED]> ????? [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Dper, > > You can't set and retrieve the cookie on the same page. Please see: > > http://www.netscape.com/newsref/std/cookie_spec.html > > for an explanation of the specification. You basically have to reload the > page before the cookie variable you set is avaiable. Try using sessions if > you can. > > -Flint > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 16, 2001 4:58 AM > To: [EMAIL PROTECTED] > Subject: [PHP-WIN] The problem of cookie > > > Hi all, > I set the cookie and retrieve it at the same page but when I click botton > twice, it only appear once. > No matter how many times I click, it is always one time short. How can I > solve this problem? > > When I click the botton, it will get the variable from cookie then connect > to the database to retrive the data. > But the value of the variable is always empty at the last time. When I > checked the cookie, the variable got the value already. I don't know if I > can set and retrieve cookie at the same page. > > Thanks a lot > > Dper > > > > -- > PHP Windows 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]
Flint, Thanks for answering. Well,I'll try to figure out how to solve it. In addition, Session can't solve this problem. I tried this way before. Thanks again Dper "Flint Doungchak" <[EMAIL PROTECTED]> ????? [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Dper, > > You can't set and retrieve the cookie on the same page. Please see: > > http://www.netscape.com/newsref/std/cookie_spec.html > > for an explanation of the specification. You basically have to reload the > page before the cookie variable you set is avaiable. Try using sessions if > you can. > > -Flint > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 16, 2001 4:58 AM > To: [EMAIL PROTECTED] > Subject: [PHP-WIN] The problem of cookie > > > Hi all, > I set the cookie and retrieve it at the same page but when I click botton > twice, it only appear once. > No matter how many times I click, it is always one time short. How can I > solve this problem? > > When I click the botton, it will get the variable from cookie then connect > to the database to retrive the data. > But the value of the variable is always empty at the last time. When I > checked the cookie, the variable got the value already. I don't know if I > can set and retrieve cookie at the same page. > > Thanks a lot > > Dper > > > > -- > PHP Windows 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]
Ok, I am working on the from page of my content management system, but I keep getting a parse error on my script around line 30. I am new to this, so please dont mock me. If anyone could point out what the hell I've done wrong, I would really apprieciate it. ______________________________________ <html> <head><title>Nintendoodle Editors' Eden</title></head> <body> <?php if ( isset($name)) : ?> <h2>Write an article?</h2> <p><a href="newseditor.php?name=<?php echo(urlencode($name)); ?>">News Editor</a></p> <p><a href="previewseditor.php?name=<?php echo(urlencode($name)); ?>">Previews Editor</a></p> <p><a href="reviewseditor.php?name=<?php echo(urlencode($name)); ?>">Reviews Editor</a></p> <p><a href="featureseditor.php?name=<?php echo(urlencode($name)); ?>">Features Editor</a></p> <p><a href="cheatseditor.php?name=<?php echo(urlencode($name)); ?>">Cheats Editor</a></p> <h2>Something to discuss?</h2> <p><a href="http://www.nintendoodle.com/phpBB/viewforum.php?forum=3&5">Staff Forums</a></p> <p><a href="http://www.nintendoodle.com/phpBB/viewforum.php?forum=4&2">VGLN Forums</a></p> <h2>Chat with the editors</h2> <p><a href="http://www.nintendoodle.com/java/chatroom>Editors Chatroom</a></p> <?php else : ?> <FORM ACTION=<?php echo($PHP_SELF); ?> METHOD=GET> Select name: <SELECT NAME="name"> <OPTION SELECTED VALUE>You are? <?php include("security.inc"); ?> <?php $names = mysql_query(SELECT author FROM authors); while ($row = mysql_fetch_array($names)) { $name = $row["author"]; echo("<OPTION VALUE='$name'>$name\n"); } ?> </SELECT> <p> <br> Enter password: <INPUT TYPE=TEXT NAME="password" <INPUT TYPE=SUBMIT VALUE="Go"> </FORM> <?php endif; ?> </body>
I think your problem is the endif at the last line, if's in php work this way. If (<expresion>) { <expresion> <expresion> <expresion> } Iván -----Mensaje original----- De: Nintendoodle [mailto:[EMAIL PROTECTED]] Enviado el: Lunes, 16 de Julio de 2001 07:18 p.m. Para: [EMAIL PROTECTED] Asunto: [PHP-WIN] I am going out of my mind, can anyone help Ok, I am working on the from page of my content management system, but I keep getting a parse error on my script around line 30. I am new to this, so please dont mock me. If anyone could point out what the hell I've done wrong, I would really apprieciate it. ______________________________________ <html> <head><title>Nintendoodle Editors' Eden</title></head> <body> <?php if ( isset($name)) : ?> <h2>Write an article?</h2> <p><a href="newseditor.php?name=<?php echo(urlencode($name)); ?>">News Editor</a></p> <p><a href="previewseditor.php?name=<?php echo(urlencode($name)); ?>">Previews Editor</a></p> <p><a href="reviewseditor.php?name=<?php echo(urlencode($name)); ?>">Reviews Editor</a></p> <p><a href="featureseditor.php?name=<?php echo(urlencode($name)); ?>">Features Editor</a></p> <p><a href="cheatseditor.php?name=<?php echo(urlencode($name)); ?>">Cheats Editor</a></p> <h2>Something to discuss?</h2> <p><a href="http://www.nintendoodle.com/phpBB/viewforum.php?forum=3&5">Staff Forums</a></p> <p><a href="http://www.nintendoodle.com/phpBB/viewforum.php?forum=4&2">VGLN Forums</a></p> <h2>Chat with the editors</h2> <p><a href="http://www.nintendoodle.com/java/chatroom>Editors Chatroom</a></p> <?php else : ?> <FORM ACTION=<?php echo($PHP_SELF); ?> METHOD=GET> Select name: <SELECT NAME="name"> <OPTION SELECTED VALUE>You are? <?php include("security.inc"); ?> <?php $names = mysql_query(SELECT author FROM authors); while ($row = mysql_fetch_array($names)) { $name = $row["author"]; echo("<OPTION VALUE='$name'>$name\n"); } ?> </SELECT> <p> <br> Enter password: <INPUT TYPE=TEXT NAME="password" <INPUT TYPE=SUBMIT VALUE="Go"> </FORM> <?php endif; ?> </body>
First of all, Thanks Flint for answering. Well, Session can't solve that problem too. I tried that before. A strategy is: When you set/retrieve the cookie at the same page, it can't retrieve the last data from the cookie. But it recorded all the data. Probably, we can just handle the variable to deal with this. Thanks again Dper
Here is an opportunity that you can take up FREE. If you join as an affiliate, we'll teach you how to build a profitable business on the Internet, using our system to create an income stream and earn income globally, 24 hours a day. Don't let this opportunity slip past you - our organization is already well over 1 million strong and growing at around 6,000 each day! Join us and let's work together to get a share of all those members. Just hit: mailto:[EMAIL PROTECTED]?Subject=Opportunity To be removed from this list, hit: mailto:[EMAIL PROTECTED]?Subject=Remove
Hello, Today I wasted some time just for the same question met in javascript. I don't think there are an existed function to solve it, so I write one by myself. Hope to give you some help. Followed code is wrote in javascript, I don't want to rewrite in PHP, so do yourself. // begin function function arr_wipe(arrSrc, from, length){ var len = arrSrc.length; if (from<0 || from>len || from+length>len) return false; var newArr = new Array(); var j=0; for (i=0; i<arrSrc.length; i++){ if (i<from || i>=(from+length)){ newArr[j++]=arrSrc[i]; } } return newArr; } // end function