Member Avatar for LastMitch

Hi

I'm having issues with get_magic_quotes_gpc() function. I download this Ajax File and Image Manager from this site:

http://www.phpletter.com/DOWNLOAD/

I install it on tinymce & fckeditor to test it out. They both work.

I try to link the images and it didn't work and I also realizes the links are not working either.

The issue is that it has "\" backslash on the end of the links.

it looks like this:

www.--.com/books/\"

So I did some research and find this function

http://www.php.net/manual/en/function.get-magic-quotes-gpc.php

I used Example #1 to try to fixed the issue but I'm having problems understanding how to fixed it.

This is my table:

Table: Books
Fields: id (INT(25), primary key, No Null, auto-increment)
Fields: title (VARCHAR(256), No Null)
Fields: contents (TEXT, No Null)

This is my code:

<?php
session_start();
include("include/init.php");

if (get_magic_quotes_gpc()) {

$elm1 = $_POST['ajaxfilemanager']; //ajaxfilemanager is the <textarea id> from the code from Ajax File.

$entity_elm1 = htmlentities($elm1);

$entity_elm1 = mysqli_escape_string($mysqli,$entity_elm1);

$add_contents_sql = INSERT INTO contents (content) VALUES ('$content')";

$add_contents_res = mysqli_query($mysqli, $add_contents_sql) or die(mysqli_error($mysqli));

}

//close connection to MySQLi

mysqli_close($mysqli);

?>

I really appreciate if someone can explain to me how to correct this bug. Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.