Customizing SMF > SMF Coding Discussion

createPost - Call-time pass-by-reference has been deprecate error

(1/6) > >>

mpglivecarlo:
hi,

im using the create post function to create a message inside a topic from an outside form, and when i send the information i get the error

Deprecated: Call-time pass-by-reference has been deprecated in D:\xampp\htdocs\blah\scripts\inter.php on line 47

line 47 is:
createPost(&$msgOptions, &$topicOptions, &$posterOptions);

i know that some people have fixed this eliminating the & from the function but i have tried that and when i post it just gets stuck at a blank page.

Any help is welcome since im stuck at this point.

live627:
Need more to help. Have you declared each variable? How?

mpglivecarlo:
this is basically the code that takes the information from the form dont know if my newb php is enough.


--- Code: ---if($ac=="post"){
    require_once('../../forum/Sources/Subs-Post.php');
if (isset($save) ) {

$id_board=$_POST["id_board"];
$id_topic=$_POST["id_topic"];
$id_msg=$_POST["id_msg"];
$msg=$_POST["msg"];
$id_user=$context['user']['id'];
$title="Test";
         
            $msgOptions = array(
            'icon' => 'xx',
              'smileys_enabled' => true,
              'body' => $msg,
                'subject' => $title,
                    );
           
            $topicOptions = array(
                'board' => $id_board,
                'id' => $id_topic,
                'mark_as_read' => true,
                );

            $posterOptions = array(
                'id' =>  $id_user,
                'update_post_count' => true,
                 );
createPost(&$msgOptions, &$topicOptions, &$posterOptions);

                 if($save){
                  echo '<SCRIPT language="JavaScript"> function getgoing(){ top.location="../seccion.php?sec=news&id='.$id_msg.'"; } </SCRIPT>';
                    }
                 }
    }
--- End code ---

thx for any help

live627:
Is this an extension of SMF or your own thing using SSI?

mpglivecarlo:
"my own thing" using ssi.php

Navigation

[0] Message Index

[#] Next page

Go to full version