473,382 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

strange problem with stripslashes

Over on www.monkeyclaus.org I'm getting back slashes showing up on my
web pages, where this function outputs. This despite the explicit use
of stripslashes(). Does anyone know why this might be?



function printRecentWeblogEntries($numberToGet=5, $htmlSeparator="") {

global $sql, $config;

extract($config);

$recentEntries = getRecentWeblogEntries($numberToGet);

if ($recentEntries) $recentEntries = processArray($recentEntries,
"stripslashes");

echo "\n\n\n<div class=\"recentWeblogEntries\">";

echo "These are the most recent weblog entries on this website:";

if ($htmlSeparator == "") echo "<table
class=\"recentWeblogEntriesTable\"><tr><td>";

for ($i=0; $i < count($recentEntries); $i++) {

if ($i != 0 && $htmlSeparator == "") echo "</td><td>";
if ($htmlSeparator != "") echo $htmlSeparator;

$entry = $recentEntries[$i];

extract($rwArray=$sql->putEntryIntoNamedArray($entry));

$cbMainContent = stripslashes($cbMainContent);

$cbHeadline = stripslashes($cbHeadline);

$cbMainContent = strip_tags($cbMainContent);

$cbMainContent = substr($cbMainContent, 0, 120);

echo "

<a href=\"$self?pageId=$cbId\">

$cbHeadline - $cbMainContent <br> Posted by: $cbUserName

</a>

";

}

if ($htmlSeparator == "")echo "</td></tr></table>";

echo "</div>\n\n\n";

}
Jul 16 '05 #1
1 2339
Aha! GPC and magic quotes - boooooo!

check out

http://au2.php.net/manual/en/ref.inf...gic-quotes-gpc

I do this for applications which may be deployed on web servers I have
no control over...

if(isset($_POST) && get_magic_quotes_gpc()) {
foreach($_POST AS $key=>$val) $_POST[$key] = stripslashes($val);
}
I chould probably change $_POST to $_REQUEST...

see http://au2.php.net/manual/en/languag...predefined.php for
more info on these variables.

Jul 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Reply-Via-Newsgroup | last post by:
Folks, I have a multi-dimensional array that I read from my mysql database. I'd like to run strip slashes against each element and I'm pretty sure that array_walk() (or array_map) is likely to...
0
by: |-|erc | last post by:
<?php // Get the names and values for vars sent by index.lib.php3 if (isset($HTTP_GET_VARS)) { while(list($name,$value) = each($HTTP_GET_VARS)) { $$name = $value; }; };
13
by: Gary Quiring | last post by:
I need to create an XML string using PHP5. The examples I have followed seem to be using out dated libary calls. I tried new_xmldoc() and new DomDocument. Both get undefined errors. How do I...
1
by: John Oliver | last post by:
I know absolutely nothing about this. I've been banging around various tutorials. Most just sort of skip over this. The closest I came is: http://www.freewebmasterhelp.com/tutorials/phpmysql/4...
11
by: Howard | last post by:
Hi, I have been racking my brain trying to figure out what I am missing trying to follow this book to get a php script to work. I would really appreciate if someone could point out my errors....
1
by: naughtybynature | last post by:
<html> <head> <title>Search Questions</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php $query = '';
3
by: Adrock952 | last post by:
I have been trying for ages to work out how to highlight a form field using css when there is an error during validation. I have got the form to validate fine but i don't know how to change the...
3
by: Gotch | last post by:
Hi. I found a strange behaviour I cannot explain with the ' char. I do the following: 1) there is a string with ' inside. 2) I encode the string with urlencode, I put it in a $_GET variable 3)...
2
by: DavidPr | last post by:
PHP Version 5.2.3 MySQL version - 5.0.45 magic_quotes_gpc - On I'm using the edit script below. When the form is displayed with the information to be edited - if there is a single quote in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.