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 Link to comment https://forums.phpfreaks.com/topic/96659-need-help-with-this-script-asap/ 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'])); Link to comment https://forums.phpfreaks.com/topic/96659-need-help-with-this-script-asap/#findComment-494640 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? Link to comment https://forums.phpfreaks.com/topic/96659-need-help-with-this-script-asap/#findComment-494641 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. Link to comment https://forums.phpfreaks.com/topic/96659-need-help-with-this-script-asap/#findComment-494644 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. Link to comment https://forums.phpfreaks.com/topic/96659-need-help-with-this-script-asap/#findComment-494646 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. Link to comment https://forums.phpfreaks.com/topic/96659-need-help-with-this-script-asap/#findComment-494648 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? Link to comment https://forums.phpfreaks.com/topic/96659-need-help-with-this-script-asap/#findComment-494649 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> Link to comment https://forums.phpfreaks.com/topic/96659-need-help-with-this-script-asap/#findComment-494651 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? Link to comment https://forums.phpfreaks.com/topic/96659-need-help-with-this-script-asap/#findComment-494653 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 Link to comment https://forums.phpfreaks.com/topic/96659-need-help-with-this-script-asap/#findComment-494658 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 Link to comment https://forums.phpfreaks.com/topic/96659-need-help-with-this-script-asap/#findComment-494687 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** Link to comment https://forums.phpfreaks.com/topic/96659-need-help-with-this-script-asap/#findComment-494693 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.