Note that there are some explanatory texts on larger screens.

plurals
  1. POKeep getting: "stripslashes() expects parameter 1 to be string, array given in /target.php on line 30" error
    primarykey
    data
    text
    <p>The Error I keep getting is: stripslashes() expects parameter 1 to be string, array given in /target.php on line 30</p> <p>This is my code for this site, I am new to this and i've been trying to do it for over 30 minutes.</p> <p>I am sorry for asking such a stupid question.</p> <pre><code>&lt;?php // rnprofile.php include_once 'rnheader.php'; if (!isset($_SESSION['user'])) die("&lt;br /&gt;&lt;br /&gt;You need to login to view this page"); $user = $_SESSION['user']; echo "&lt;h3&gt;Edit your Profile&lt;/h3&gt;"; if (isset($_POST['text'])) { $text = sanitizeString($_POST['text']); $text = preg_replace('/\s\s+/', ' ', $text); $query = "SELECT * FROM rnprofiles WHERE user='$user'"; if (queryMysql($query) != false) { queryMysql("UPDATE rnprofiles SET text='$text' where user='$user'"); } else { $query = "INSERT INTO rnprofiles VALUES('$user', '$text')"; queryMysql($query); } } else { $query = "SELECT * FROM rnprofiles WHERE user='$user'"; $result = queryMysql($query); $sth = $dbh-&gt;prepare($query); $sth-&gt;execute(); if (queryMysql($query) != false/* mysql_num_rows($result) */) { $row = $sth-&gt;fetchAll(PDO::FETCH_ASSOC); //$row = mysql_fetch_row($result); $text = stripslashes($row[1]); } else $text = ""; } $text = stripslashes(preg_replace('/\s\s+/', ' ', $text)); if (isset($_FILES['image']['name'])) { $saveto = "$user.jpg"; move_uploaded_file($_FILES['image']['tmp_name'], $saveto); $typeok = TRUE; switch ($_FILES['image']['type']) { case "image/gif": $src = imagecreatefromgif($saveto); break; case "image/jpeg": // Both regular and progressive jpegs case "image/pjpeg": $src = imagecreatefromjpeg($saveto); break; case "image/png": $src = imagecreatefrompng($saveto); break; default: $typeok = FALSE; break; } if ($typeok) { list($w, $h) = getimagesize($saveto); $max = 100; $tw = $w; $th = $h; if ($w &gt; $h &amp;&amp; $max &lt; $w) { $th = $max / $w * $h; $tw = $max; } elseif ($h &gt; $w &amp;&amp; $max &lt; $h) { $tw = $max / $h * $w; $th = $max; } elseif ($max &lt; $w) { $tw = $th = $max; } $tmp = imagecreatetruecolor($tw, $th); imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tw, $th, $w, $h); imageconvolution($tmp, array(// Sharpen image array(−1, −1, −1), array(−1, 16, −1), array(−1, −1, −1) ), 8, 0); imagejpeg($tmp, $saveto); imagedestroy($tmp); imagedestroy($src); } } showProfile($user); echo &lt;&lt;&lt;_END &lt;form method='post' action='rnprofile.php' enctype='multipart/form-data'&gt; Enter or edit your details and/or upload an image:&lt;br /&gt; &lt;textarea name='text' cols='40' rows='3'&gt;$text&lt;/textarea&gt;&lt;br /&gt; Image: &lt;input type='file' name='image' size='14' maxlength='32' /&gt; &lt;input type='submit' value='Save Profile' /&gt; &lt;/pre&gt;&lt;/form&gt; _END; ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload