pager code cant fix

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lovehack
Forum Newbie
Posts: 5
Joined: Fri Nov 25, 2011 12:16 am

pager code cant fix

Post by lovehack »

need help with code below

<?php
if($send==""){
?>
<br>

IM getting a error in this line some one said substitute action=$PHP_SELF but i dont no how
<? echo "<form action=/"$pagename/" name=/"ops/">"; ?>


<center>
Remeber to include your name!<br>
<textarea name="messagebody" rows=8 cols=50 onKeyUp="if (!document.ops.Multi.checked) { if (this.value.length>129) { alert('Message cannot be longer than 129 characters. Try sending multiple messages.'); this.value=this.value.substring(0,129) }}"></textarea><br>
<input type="checkbox" name="Multi" value = "checkme"> Send as multiple messages if overlong<br>
<input type="submit" value="Page!">
<input type="hidden" name="send" value="1">
</form>
<?php
}
function str_split($string, $split_length = 1) {
$strlen = strlen($string);

for ($i = 0; $i < $strlen; $i += $split_length) {
$array[] = substr($string, $i, $split_length);
}

return $array;
}
if($send=="1"){
if($carrier = 1) { $suffix= "@mobile.att.net"; }
if($carrier = 2) { $suffix= "@mobile.mycingular.com"; }
if($carrier = 3) { $suffix= "@message.alltel.com"; }
if($carrier = 4) { $suffix= "@nextel.com"; }
if($carrier = 5) { $suffix= "@messaging.sprintpcs.com"; }
if($carrier = 6) { $suffix= "@tmomail.net"; }
if($carrier = 7) { $suffix= "@vtext.com"; }
if($carrier = 8) { $suffix= "@clearlydigital.com"; }
if($carrier = 9) { $suffix= "@bellmobility.ca"; }
if($carrier = 10) { $suffix= "@fido.ca"; }
if($carrier = 11) { $suffix= "@pcs.rogers.com"; }
if($carrier = 12) { $suffix= "@msg.telus.com"; }
$email = $number.$suffix;
if($Multi=="checkme"){
$data = str_split($messagebody, 120);
$mx = intval(strlen($messagebody) / 120);
$mx = $mx + 1;
$temp = strlen($messagebody) / 120;
$sent = 0;
for($i = 0; $i < $mx; $i++){
mail($email, "Page (".($i + 1)." of ".$mx.")" , $data[$i]);
$sent = $sent + 1;
}
echo "<br>You've sucesfully paged me with $sent messages out of your total message which was $mx messages long.<br>";
} else {
mail($email, "Page!", $messagebody);
echo "<br>You've sucessfully paged me, and chances are I'm reading your page right now, if my cell is in a service area and on.<br>";
}
}
?>
<br>
<table class="forum_header" width="100%"><tr>
<td align="center"><b>Legal Info</b></td>
</tr></table>
<br><small><br></c
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: pager code cant fix

Post by social_experiment »

Code: Select all

<?php echo "<form action=\"" . $_SERVER['PHP_SELF'] . "\" name=\"ops\" >"; ?>
Don't use short tags ( <? ?> ); rather use ( <?php ?> )
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply