1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Get Data from another server

Discussion in 'Programming' started by wajid_pk, Sep 3, 2010.

  1. #1
    i have a simple contact form with fields
    Name
    Email
    Message
    Submit button
    here at http://www.paktech.co.cc/p/contact.html

    Action Script is hosted at a different server and domain
    <?php
    // Contact subject
    $subject ="$subject";
    // Details
    $message="$detail";
    
    // Mail of sender
    $mail_from="$customer_mail";
    // From
    $header="from: $name <$mail_from>";
    
    // Enter your email address
    $to ='someone@somewhere.com';
    
    $send_contact=mail($to,$subject,$message,$header);
    
    // Check, if message sent to your email
    // display message "We've recived your information"
    if($send_contact){
    echo "We've recived your contact information";
    }
    else {
    echo "ERROR";
    }
    ?> 
    PHP:
    above is the action script
    i can not host both files on same server because input form is hosted at blogger

    any one can help how i retrieve data in above script submitted from blogger
    i tested it with
    <form name="form1" method="post" action="http://www.domain.com/send_contact.php"> 
    PHP:
    but in this case email comes blank with unknown sender

    any help will be appreciated

    Regards
     
    wajid_pk, Sep 3, 2010 IP
  2. EngineerofSuccess

    EngineerofSuccess Well-Known Member

    Messages:
    680
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    130
    #2
    Does this particular .php code help to boost search engine rankings for a website? I've been hearing alot lately about the power of RSS feeds and how powerful .php scripting is for search engine traffic, and would like to get extra insight from someone about it...
     
    EngineerofSuccess, Sep 3, 2010 IP
  3. Vicbowling

    Vicbowling Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Do any of your fields transfer any data from the form? Try instead of using $subject ="$subject"; try $subject=$_POST['subject']; Register globals is probably disabled (AND SHOULD BE) and you need to get the value directly from the $_POST superglobal variable. $subject=$subject is just setting an undefined variable equal to an undefined variable.
     
    Vicbowling, Sep 3, 2010 IP
  4. wajid_pk

    wajid_pk Peon

    Messages:
    334
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I am thankful to you sir it really works
    
    <?php
    // Contact subject
    $subject=$_POST['subject'];
    // Details
    $message=$_POST['detail'];
    
    // Mail of sender
    $mail_from=$_POST['customer_mail'];
    // From
    $header=$_POST['mail_from'];
    $header=$_POST['name'];
    // Enter your email address
    $to ='example@example.com';
    
    $send_contact=mail($to,$subject,$message,$header);
    
    // Check, if message sent to your email
    // display message "We've recived your information"
    if($send_contact){
    echo "We've recived your contact information";
    }
    else {
    echo "ERROR";
    }
    ?>
    
    PHP:
    please check i am receiving email from Server email address not from input please how i fix this
    now i have only issue with sender email address
     
    wajid_pk, Sep 3, 2010 IP
  5. mike30

    mike30 Well-Known Member

    Messages:
    883
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    140
    #5
    if you see on the code above: you are assigning to values to the same variable. and the last value assigned is the one that
    the variable will hold for the rest of the scrip.

    change this:
    
    $header=$_POST['mail_from'];
    $header=$_POST['name'];
    
    PHP:
    For this:
    
    $header='From:'.$_POST['mail_from'];
    $headerName = $_POST['name'];
    
    
    PHP:
    and this:

    $send_contact=mail($to,$subject,$message,$header);
    PHP:
    for this:
    $send_contact=mail("$to","$subject,"$message","$header");
    PHP:
    try it :)

    ~Mike
     
    mike30, Sep 5, 2010 IP
    wajid_pk likes this.