ecards php script problem

Discussion in 'PHP' started by Trisha, May 29, 2006.

  1. #1
    Can anyone help me with this ecard script. It came from a site called phpecard. The script works fairly well until you try to put apostrophes into the message etc. I've tried adding stripslashes but I suspect my typing or knowledge of php isn't good enough as I get parse errors coming back. The problem line seems to be:

    $CRD_info = '<?php $id_info = array(\'notify\' => \''.$_POST['notify_sender'].'\',\'sub\' => \''.htmlspecialchars($_POST['subject']).'\',\'s_name\' => \''.htmlspecialchars($_POST['sender_name']).'\',\'s_mail\' => \''.$_POST['sender_email'].'\',\'r_name\' => \''.htmlspecialchars($_POST['recipient_name']).'\',\'r_mail\' => \''.$_POST['recipient_email'].'\',\'date\' => \''.date("d-m-Y").'\',\'time\' => \''.date("H:i").'\',\'card\' => \''.$_POST['card'].'\',\'msg\' => \''.htmlspecialchars(stripslashes($_POST['msg'])).'\', ); ?>';

    I'd love any help with this and many thanks to anyone who takes the trouble to look at it.
     
    Trisha, May 29, 2006 IP
  2. PinoyIto

    PinoyIto Notable Member

    Messages:
    5,863
    Likes Received:
    170
    Best Answers:
    0
    Trophy Points:
    260
    #2
    instead of using stripslashes try to use addslashes
     
    PinoyIto, May 29, 2006 IP
  3. Trisha

    Trisha Active Member

    Messages:
    428
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    88
    #3
    Guess what? I used htmlentities and this bit of the program is working. I've just got to debug the rest of the script now and persuade aol to let my ecards get through their ridiculous spam filters and I'm away. (I've never spammed anyone in my life and I don't intend to start now).
     
    Trisha, May 30, 2006 IP