PLZ Help me with this

Discussion in 'PHP' started by astrohope, Apr 8, 2009.

  1. #1
    plz any one help me with this script this is my php script i am using this on "send this page to a Friend" i am taking address bar address and save it to a variable and then send that to email , i don't know if any 1 have this kind of problem this script did not work on IE, working fine with Firefox plzz and 1 help me with this or tell me any other script = to this, this is the script
    ------------------------------
    Form
    <tr valign="top">
    <td valign="middle" align="center">&nbsp;
    <? $refurl = $_SERVER['HTTP_REFERER']; ?>
    <? print $refurl;?>
    <form name="tellafriend" action="tellafriend.php" method="post" onSubmit="return checkfields()">
    <div align="center">
    <center>
    <table border="0" cellpadding="10" cellspacing="0">
    <tr>
    <td><span class="main">آپكا نام</span></td>
    <td>
    <input size="30" name="name" maxlength="45">
    </td>
    </tr>
    <tr>
    <td><span class="main">آپكا ای میل</span></td>
    <td>
    <input size="30" name="email" maxlength="45">
    </td>
    </tr>

    <tr>
    <td><span class="main">دوست كا ای میل</span></td>
    <td>
    <input size="30" name="fmail1" maxlength="50">
    </td>
    </tr>
    <tr>
    <td><span class="main">دوست كا ای میل</span></td>
    <td>
    <input size="30" name="fmail2" maxlength="50">
    </td>
    </tr>
    <tr>
    <td><span class="main">دوست كا ای میل</span></td>
    <td>
    <input size="30" name="fmail3" maxlength="50">
    </td>
    </tr>
    <tr>
    <td colspan="2" align="center">
    <span class="main"> پیغام (اگر ہے تو)</span></td>
    </tr>
    <tr>
    <td colspan="2" align="center">
    <textarea name="txtcoments" cols="50" rows="8"></textarea>
    </td>
    </tr>
    <tr>
    <td colspan="2">
    <p align="center">
    <input onClick="validate();" type="button" value="Send">
    <input type=hidden name=refurl value="<? print $refurl;?>">
    </td>
    </tr>
    -------------------------
    and PHP page
    ----------------------
    <?php


    if(count($_POST)) {

    foreach(array('fmail1','fmail2','fmail3','email','name','txtcoments') as $key) $_POST[$key] = strip_tags($_POST[$key]);
    if(!is_secure($_POST)) { die("Hackers begone");}

    $emailto = "info@astrohope.com";
    $esubject = "Astro Hope Page Recommendation";
    $emailtext = "
    $_POST[name] has used your recommendation form using an email address of $_POST
     
    astrohope, Apr 8, 2009 IP
  2. engager

    engager Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    check this:
    onSubmit="return checkfields()"

    where checkfields() javascript function is declared?
    what does it do? (i believe this is some kind of input validation)
    is JavaScript enabled in your IE?
     
    engager, Apr 8, 2009 IP
  3. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #3
    Why do you have if(count($_POST)) ?

    You should be able to just use if($_POST)
     
    Weirfire, Apr 8, 2009 IP
  4. octalsystems

    octalsystems Well-Known Member

    Messages:
    352
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    135
    Digital Goods:
    1
    #4
    is it complete code
     
    octalsystems, Apr 8, 2009 IP
  5. astrohope

    astrohope Peon

    Messages:
    108
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yes this is full code i try if($_POST) but Same result, i think problem is with
    <? $refurl = $_SERVER['HTTP_REFERER']; ?> <? print $refurl;?> cord , i am looking other script = to this but no other cord give the result i want, any 1 know why this code did not work on IE, i am vary :confused:
     
    astrohope, Apr 9, 2009 IP
  6. sm9ai

    sm9ai Active Member

    Messages:
    746
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    60
    #6
    The php code is not browser dependent so should work fine.

    I would assume it is your javascript causing problems, in particular

    <form name="tellafriend" action="tellafriend.php" method="post" onSubmit="return checkfields()">

    and

    <input onClick="validate();" type="button" value="Send">
     
    sm9ai, Apr 9, 2009 IP
  7. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #7
    Try putting <?php instead of just <?

    In fact try this code here;

    <?php
    var_dump($_SERVER);
    ?>

    and this as well

    <?php
    phpinfo();
    ?>
     
    Weirfire, Apr 9, 2009 IP