0

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!

Edited by LastMitch: grammer

1
Contributor
1
Reply
4
Views
5 Years
Discussion Span
Last Post by LastMitch
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.