Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Dec 2011
    Location
    In ze hard disk drive
    Posts
    39
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Exclamation Deprecated: Assigning the return value of new

    Code:
    Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 80
    
    Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 166
    The deprication error above is from the code below, any help? Thanks!

    PHP Code:
    <?php
    require("config.php");
    error_reporting(0);
    $dbc mysql_connect("localhost""root""""cardcommunity");

    if(isset(
    $_POST['submit'])){
        
    $date date("d.m.Y");
        
    $title $_POST['title'];
        
    $message $_POST['message'];
        
    $url $_POST['url'];

        
    $insert mysql_query("INSERT INTO `cardcommunity`.`news`(date, title, message, url) VALUES ('$date', '$title', '$message', '$url')");
        if (
    mysql_insert_id($dbc))
       {
       echo(
    "Update was successful.");
       } else {
       echo(
    "Update failed.");
       }
        
            }

    ?>

    <html>
    <head>
    <title> Add an update </title>
    </head>
    <form action="addnews.php" method="post"/>
    Title: <input type="text" name="title"/><br />
    Content: <input type="text" name="message"/><br />
    Link: <input type="text" name="url"/><br />
    <input type="submit" name="submit" value="Post update"/><br />
    </html>

  • #2
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    It's not your code, it's PEAR's use of deprecated syntax. Updating your PEAR install may fix the issue.

  • #3
    New Coder
    Join Date
    Dec 2011
    Location
    In ze hard disk drive
    Posts
    39
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by kbluhm View Post
    It's not your code, it's PEAR's use of deprecated syntax. Updating your PEAR install may fix the issue.
    Oh I see, thanks. How the hell? Manuals are so confusing when it comes to updating PEAR?
    Last edited by mike94; 12-20-2011 at 11:19 AM.

  • #4
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    To clarify how to update pear - http://pear.php.net/manual/en/installation.getting.php - you'll find the update instructions at the end of the windows install instructions.
    Useful function to retrieve difference in times
    The best PHP resource
    A good PHP FAQ
    PLEASE remember to wrap your code in [PHP] tags.
    PHP Code:
    // Replace this
    if(isset($_POST['submitButton']))
    // With this
    if(!empty($_POST))
    // Then check for values/forms. Some IE versions don't send the submit button 
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

  • #5
    New Coder
    Join Date
    Dec 2011
    Location
    In ze hard disk drive
    Posts
    39
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by BluePanther View Post
    To clarify how to update pear - http://pear.php.net/manual/en/installation.getting.php - you'll find the update instructions at the end of the windows install instructions.
    Oh I found this on google but as #1 said - CONFUSED.COM haha I had downloaded the update but no idea how to apply a .phar file?

  • #6
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    Once you have your go-pear.phar, just open your command line (cmd.exe) and run:
    php directory/go-pear.phar

    That should do it
    Useful function to retrieve difference in times
    The best PHP resource
    A good PHP FAQ
    PLEASE remember to wrap your code in [PHP] tags.
    PHP Code:
    // Replace this
    if(isset($_POST['submitButton']))
    // With this
    if(!empty($_POST))
    // Then check for values/forms. Some IE versions don't send the submit button 
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

  • #7
    New Coder
    Join Date
    Dec 2011
    Location
    In ze hard disk drive
    Posts
    39
    Thanks
    9
    Thanked 0 Times in 0 Posts
    no luck still, someone make a video or a guide somehwere and I will love you forever :P

  • #8
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    Quote Originally Posted by mike94 View Post
    no luck still, someone make a video or a guide somehwere and I will love you forever :P
    Haha, the guide is there. I'll break it down for you.

    Go here:
    http://pear.php.net/go-pear.phar

    That should download go-pear.phar onto your computer. Then, open up windows cmd prompt (windows button+r, then type cmd). Then, in command prompt, run a command like this (substituting the path for the path to your download directory):

    php C:\Users\username\Downloads\go-pear.phar
    Useful function to retrieve difference in times
    The best PHP resource
    A good PHP FAQ
    PLEASE remember to wrap your code in [PHP] tags.
    PHP Code:
    // Replace this
    if(isset($_POST['submitButton']))
    // With this
    if(!empty($_POST))
    // Then check for values/forms. Some IE versions don't send the submit button 
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

  • #9
    New Coder
    Join Date
    Dec 2011
    Location
    In ze hard disk drive
    Posts
    39
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by BluePanther View Post
    Haha, the guide is there. I'll break it down for you.

    Go here:
    http://pear.php.net/go-pear.phar

    That should download go-pear.phar onto your computer. Then, open up windows cmd prompt (windows button+r, then type cmd). Then, in command prompt, run a command like this (substituting the path for the path to your download directory):

    php C:\Users\username\Downloads\go-pear.phar

    Thats what I'm saying boss! I've done this 100 times haha

  • #10
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    I am assuming, being called from C:\xamp, that it's your local machine? How was it installed the first time?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •