Jump to content

NEED HELP WITH THIS SCRIPT ASAP


ringtzone

Recommended Posts

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

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.

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.