Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 01-11-2009, 06:50 AM problem with header
Skilled Talker

Posts: 97
Trades: 0
<?
if ($_POST["name"])
{



$kind = " 1111 Co";
$name=htmlspecialchars($_POST['name']);
$emal=htmlspecialchars($_POST['emal']);
$city=htmlspecialchars($_POST['city']);
$country=htmlspecialchars($_POST['country']);
$tel=htmlspecialchars($_POST['tel']);
/*echo $kind;
echo $name;
echo $emal;
echo $city;
echo $country;
echo $tel;*/
?>


<?

$messageo = '

<html>
<head>
<style>
body {

font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #737373;
text-align: justify;
width: auto;
margin-right: 0px;
margin-left: 0px;
margin-top: 10px;
margin-bottom: 10px;
line-height: 17px;
}
.padding {
padding-left: 30px;
background-color: #cdcdcd;
color: #023061;
height: 30px;
vertical-align: middle;
}
.padding2 {
padding-left: 30px;
background-color: #E5E5E5;
color: #023061;
height: 30px;
}
.title1 {
font-size: 17px;
font-weight: bold;
color: #023061;
padding-top: 20px;
padding-bottom: 25px;
font-family: Arial, Helvetica, sans-serif;
text-transform: uppercase;
}
</style>
</head>
<body>
<div class="title1" align="center">Kay & Co</div>
<table width="50%" border="0" cellspacing="1" cellpadding="4" align="center">
<tr class="padding">
<td width="30%"><strong>Name <b></strong> </td>
<td >' . $name . '</td>
</tr>

<tr class="padding2">
<td ><strong>E-mail </strong> </td>
<td >' . $emal . '</td>
</tr>



<tr class="padding">
<td><strong> City </strong> </td>
<td>' .$city . '</td>
</tr>
<tr class="padding2">
<td><strong>Country</strong> </td>
<td>'.$country.'</td>
</tr>
<tr class="padding">
<td><strong>Telephone</strong> </td>
<td>' . $tel.'</td>
</tr>
</table>

</body>
</html> ';



$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=windows-1256\r\n";
$headers .= "From: info@abccc.com>\r\n";
$headers .= "cc: john.zakaria@abc.com\r\n";


$ok = mail("john@abc.com", $kind, $messageo, $headers);

}
header("Location: welcome.php");



?>

i have a problem wiz header here coz when i post data from a form to this page to send an e-mail , i force the page to go to welcome.php using header but it show me a message
" CANNOT MODIFY HEADER INFORMATION"
i treid to remove the <html><body >.... tags and it could not work correctly it shows the same message

can anyone help me plz
john_zakaria is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-11-2009, 07:16 AM Re: problem with header
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
Remove
PHP Code:
?>


<?
That makes the page print some empty lines and therefore send the header.
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 01-13-2009, 12:32 AM Re: problem with header
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
I'm agreed with Insensus... that seems like the problem. And, for extra compatibility, I suggest you start your php code with "<?php" as apposed to "<?". In my experience, it seems that "<?" will not work in php 5, though "<?php" will work in both php 4 and php 5.

- Steve
stevej is offline
Reply With Quote
View Public Profile
 
Old 01-13-2009, 05:15 AM Re: problem with header
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
>> it seems that "<?" will not work in php 5, though "<?php" will work in both php 4 and php 5

it depends only on setup and not on the version of php
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to problem with header
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.22563 seconds with 12 queries