ringtzone Posted March 18, 2008 Share Posted March 18, 2008 I want the script to display a different subject and different body at everyrefresh heres the code i have right now <? $temp_add = explode(",",$_POST['subject']); $subject = ""; foreach ($temp_add as $ta) { $subject .= $ta . "TEST"; } ?> <? $temp_add = explode(",",$_POST['body']); $body = ""; foreach ($temp_add as $ta) { $body .= $ta . "TEST"; } ?> <form name="" method="post" action="" id=""> <input name="ctl00$Main$BulletinEdit$tbxSubject" id="ctl00_Main_BulletinEdit_tbxSubject" type="text" value="<?php echo $subject; ?>"> <textarea name="ctl00$Main$BulletinEdit$tbxBody" rows="10" cols="20" id="ctl00_Main_BulletinEdit_tbxBody"><?php echo $body; ?> </textarea> </form> Thanks Quote Link to comment Share on other sites More sharing options...
Jeremysr Posted March 18, 2008 Share Posted March 18, 2008 So you just want to pick a random subject and a random body? $subject = array_rand(explode(',', $_POST['subject'])); $body = array_rand(explode(',', $_POST['body'])); Quote Link to comment Share on other sites More sharing options...
ringtzone Posted March 18, 2008 Author Share Posted March 18, 2008 yea a random one, were do i put that code? Quote Link to comment Share on other sites More sharing options...
Jeremysr Posted March 18, 2008 Share Posted March 18, 2008 Inside PHP tags, anywhere above your form. It can replace all your other PHP code. Quote Link to comment Share on other sites More sharing options...
ringtzone Posted March 18, 2008 Author Share Posted March 18, 2008 yea ok, thanks now how do i add multiple text for it to randomly choose 1? and do you have an msn i can add so u can help me much faster, thanks. Quote Link to comment Share on other sites More sharing options...
Jeremysr Posted March 18, 2008 Share Posted March 18, 2008 yea ok, thanks now how do i add multiple text for it to randomly choose 1? Can you explain that more? I don't know what you mean... and do you have an msn i can add so u can help me much faster, thanks. These forums work fine, also I have to leave right away so other people might have to help you. Quote Link to comment Share on other sites More sharing options...
ringtzone Posted March 18, 2008 Author Share Posted March 18, 2008 ok well i want for it do display the random text i want in the textfield but in what tag do i add the text i want? Quote Link to comment Share on other sites More sharing options...
Jeremysr Posted March 18, 2008 Share Posted March 18, 2008 Still not sure if I understand you, is this what you want? <?php $subject = array_rand(explode(',', $_POST['subject'])); $body = array_rand(explode(',', $_POST['body'])); ?> <form name="" method="post" action="" id=""> <input name="ctl00$Main$BulletinEdit$tbxSubject" id="ctl00_Main_BulletinEdit_tbxSubject" type="text" value="<?php echo $subject; ?>"> <textarea name="ctl00$Main$BulletinEdit$tbxBody" rows="10" cols="20" id="ctl00_Main_BulletinEdit_tbxBody"> <?php echo $body; ?> </textarea> </form> Quote Link to comment Share on other sites More sharing options...
ringtzone Posted March 18, 2008 Author Share Posted March 18, 2008 yea but were do i put what i want to display on body and what i want on subject? Quote Link to comment Share on other sites More sharing options...
ringtzone Posted March 18, 2008 Author Share Posted March 18, 2008 is there anyone that can help me with the question above?? sorry if theres no bumping Quote Link to comment Share on other sites More sharing options...
ringtzone Posted March 18, 2008 Author Share Posted March 18, 2008 see i need some textarea like the one in http://tonsofadds.com/bulletin.php i want it to change on every refresh Quote Link to comment Share on other sites More sharing options...
ringtzone Posted March 18, 2008 Author Share Posted March 18, 2008 THANKS FOR NOONES HELP I FIGURED IT OUT **SOLVED** Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.