Roly
Aug 1 2004, 06:58 AM
| | Just post your PHP problem here and I will try to help you. Having trouble writing a script? I am here come to me here. And no offense but I think I know more PHP than the admin.
BTW, I don't want you to think of me as a person who gloats about himself a lot because I don't. I'm just saying this because it's been proved and I'm sure there are other great PHP programers here and I ask them to come here and help asnwer your questions. |
Reply
groentjuh
Aug 1 2004, 07:07 AM
 no help needed here  my brother is php-programmer too.
Reply
jailbox
Aug 1 2004, 10:21 AM
So, im making a chatroom in wml/php with no database. I have most of it covered but I have a few problems. When a user enters the chat he/she has to enter the nickname. After the user has entered one message the chatroom "forgets" the nickname so if he/she enters another message, the name wont be displayed. I tried using sessions and cookies and such but I cant get em to work.
Reply
icleric
Aug 1 2004, 03:03 PM
Ahem , am asking for the best News system u can offer me  appreciate if it is easy to setup , and can manage templates and things like that , thnx
Reply
Spectre
Aug 1 2004, 03:20 PM
Mind showing us some of your stuff, Roley? Do you have a portfolio of anything you've done?
Reply
chinfo
Aug 2 2004, 02:27 AM
And please change the topic title, some people are bound to get offended by that and take it against you. Something like "PHP Help Center" will be sufficient.
Reply
Roly
Aug 2 2004, 05:53 AM
QUOTE(jailbox @ Aug 1 2004, 10:21 AM) So, im making a chatroom in wml/php with no database. I have most of it covered but I have a few problems. When a user enters the chat he/she has to enter the nickname. After the user has entered one message the chatroom "forgets" the nickname so if he/she enters another message, the name wont be displayed. I tried using sessions and cookies and such but I cant get em to work. Mind showing me your source? And yes cookies is the best way. Your source should look something like this: CODE <?php if(isset($_POST['nickname']) setcookie('nickname', htmlentities($_POST['nickname']), 999999); ?>
<form> <input name=nickname value="<?= isset($_COOKIE['nickname']) ? isset($_COOKIE['nickname']) : NULL; ?>" <input name=message><input type=submit value="Say It"></form> And remember you need to set the cookie before you write anything to the page. That means before the <html> tag 
Reply
Roly
Aug 2 2004, 05:56 AM
QUOTE(icleric @ Aug 1 2004, 03:03 PM) Ahem , am asking for the best News system u can offer me  appreciate if it is easy to setup , and can manage templates and things like that , thnx You should go to http://php.resourceindex.com and search for one. Before I knew PHP I went to that site to get my scripts and I slowly learned from them. I still go sometimes just to look for some examples.
Reply
Spectre
Aug 2 2004, 08:48 AM
No, cookies are not the best way to go. Sessions are most definately better than cookies, assuming nothing needs to be 'remembered' outside of the current session. Some browsers don't allow cookies, and some people turn them off (due to security threats etc), so if your site uses cookies, not all users will be able to view it - or some may even choose to leave based on this reason alone. On the other hand, sessions always work. And the user can't disable sessions (unless they close their browser window). And as for your code: CODE <?php if(isset($_POST['nickname']) setcookie('nickname', htmlentities($_POST['nickname']), 999999); ?> Shouldn't it be: CODE <?php if(isset($_POST['nickname']) { setcookie('nickname', htmlentities($_POST['nickname']), 999999); } // edit: IF statements need to be enclosed in { }.
?> (edit: I read it wrong the first time)
Reply
jailbox
Aug 2 2004, 10:46 AM
QUOTE(Roly @ Aug 2 2004, 05:53 AM) QUOTE(jailbox @ Aug 1 2004, 10:21 AM) So, im making a chatroom in wml/php with no database. I have most of it covered but I have a few problems. When a user enters the chat he/she has to enter the nickname. After the user has entered one message the chatroom "forgets" the nickname so if he/she enters another message, the name wont be displayed. I tried using sessions and cookies and such but I cant get em to work. Mind showing me your source? And yes cookies is the best way. Your source should look something like this: CODE <?php if(isset($_POST['nickname']) setcookie('nickname', htmlentities($_POST['nickname']), 999999); ?>
<form> <input name=nickname value="<?= isset($_COOKIE['nickname']) ? isset($_COOKIE['nickname']) : NULL; ?>" <input name=message><input type=submit value="Say It"></form> And remember you need to set the cookie before you write anything to the page. That means before the <html> tag Actualy the source for the page where user inputs his/her name is CODE <?php session_start( ); session_register("nick"); header("Content-type: text/vnd.wap.wml"); echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"" . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; ?> <wml> <card id="en" title="Enter nickname"> <p> <?php $session=session_id(); ?> </p> <p> <do type="accept"> <go href="viewroom.php?nick=<?echo $session?>" method="post"> <postfield name="nick" value="$nick"/> </go> </do> Enter nickname: <input title="nick" name="nick" type="text" /> <br/> </p> </card> </wml>
I dont think thats correct though. I dont know if its neede but heres also the code for the page that writes the data into the file CODE <?php session_start(); header("Content-type: text/vnd.wap.wml"); echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"" . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; ?> <wml> <card id="msgadd" title="message added"> <p align="center"> <br/>Your message has been added </p> <p><?php $session=session_id(); ?></p> <p><a href="viewroom.php?nick=<?echo $session?>">Chat</a></p>
<p> <?php
//use the fopen() function $fp=fopen("msgs.txt", "r"); $data = fread( $fp, filesize( "msgs.txt" )); fclose( $fp );
$fp2 = fopen( "msgs.txt", "w" );
//using the fputs() function fputs($fp2, " <p> //I was just testing so dont even notice the session varaible below $session: $msg <br/> </p> ". $data ); fclose($fp2);
?>
</p> </card> </wml>
Reply
redsky
Aug 15 2004, 05:49 AM
well, then what to we do ?
Reply
ivepanda
Aug 13 2004, 05:03 AM
haha~~~~~ really?? maybe i will need your help later~~~ ....but my english is not good plx try your best to understand me~~
Reply
Roly
Aug 11 2004, 06:16 AM
Umm, you're supposed to do that yourself because it's gonna be the way you would want it. Here, use the colors table near the middle to help you, it helps me, http://www.w3schools.com/css/css_colors.asp
Reply
CodeName_88
Aug 9 2004, 01:49 PM
Roly, I want to set up my site to use php-nuke, but I want to change its template. So if I provide you with the CSS, could you change it for me?
Reply
LuciferStar
Aug 9 2004, 09:59 AM
cookies are stored in client machine sessions are stored in sever machine sessions are safer than cookies.
Reply
Similar Topics
Keywords : php, programers
- Need Pr....
I need some good programers to help in my game. (1)
Looking For Php Programers/ Flash And Graphic Desi
(4) I own a small web design/ hosting company that is looking to expand. My company specializes in
OSCommerce and Website Design. I am looking for hardworking freelancers with experience in PHP/
Graphics Design/ SEO. Please contact me if you have any experience in these fields. Thanks, Andrew
www.avidwebsitedesign.com....
Looking for php, programers
|
*RANDOM STUFF*
*SIMILAR VIDEOS*
Searching Video's for php, programers
*MORE FROM TRAP17.COM*
|
advertisement
|
|