Jump to content

Geo877

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Geo877's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ray you are a genius, thanks a million!!!
  2. I'm sure this problem is relatively easy to solve but i'm all out of ideas... Ok i'm building a kind of primitive blog editing thingy for my site, you're able to add, edit and move side boxes and it all works fine but, in order to store the temporary data while the user is editing and refreshing the page i put the variables in the url and the page looks for them with php upon loading, this work totally fine until i start using quotation marks in the temporary data. The Url looks a lot like this - http://192.168.2.2:81/Site/editR.php?sid=fd9b1af77a234e8522ed52ba0c062448&update=true&Rightcount=3&title1=Login&content1=&class name1=login&title2=Example%20Box%20%22&content2=Example%20%22%22%20'%20/&classname2=box2 it probably isn't the best way of sending data but tbh i'm not the best php user. Anyway so when i write text in a content box and run a function that requires the page to reload the pages grabs the data from the content box and puts it in the URL, Fine until i put quotation marks in the content box they appear in the URL as %22 when this is sent back to the page it appears as /" . If i were to reload it would appear as ///" . Why :s I don't know if the problem is in the sending or receiving of the data, any advice is appreciated heres some snippets if they help... PHP receiving for ( $x = 1; $x <= $RightCount; $x += 1) { $newData = $_GET['classname'.$x]; ${'RightClass'.$x} = $newData; if($newData=='login'){ ${'RightVisibleTo'.$x} = 'publicO'; } if(!$newData){ ${'RightClass'.$x} = "box2"; } $newData = $_GET['content'.$x]; ${'RightContent'.$x} = $newData; if(!$newData){ ${'RightContent'.$x} = "New Box".$x; } $newData = $_GET['title'.$x]; ${'RightTitle'.$x} = $newData; if(!$newData){ ${'RightTitle'.$x} = "New Box".$x; } } Javascript / PHP sending function remove(){ window.location.href="<?php echo($_SERVER['PHP_SELF'].$sid."&update=true&Rightcount=".($RightCount-1)); for ( $b = 1; $b <= $RightCount; $b += 1) { echo("&title".$b."=".'"+document.form.title'.$b.'.value+"'); echo("&content".$b."=".'"+document.form.content'.$b.'.value+"'); echo("&classname".$b."=".'"+document.form.class'.$b.'.options[document.form.class'.$b.'.se lectedIndex].value+"'); } ?>"; } Thanks!
  3. Wooo thanks moselkady, you're a saint!
  4. Hey kinda complicated problem... Basically I'm intergrating my site with phpbb3 so i'm grabbing the post text data from the mysql database, all the text comes through fine but theres one small problem - if i post a message saying line1 line2 line3 the page would display it as line1 line2 line3 . The post_text field is mediumtext and heres how i'm reading it - $postCount=0; $forum_name=$news_forum_name; $forum_id; dbConnect("phpbb3"); $sql = "SELECT * FROM `phpbb_forums` WHERE `forum_name` = '$forum_name'"; if (!mysql_query($sql)){ error('A database error occurred in processing your '. 'submission.\\nIf this error persists, please '. 'contact geo877@hotmail.co.uk.'); }else{ $result = mysql_query($sql); } $forum_id = mysql_result($result,0,'forum_id'); $sql = "SELECT COUNT(*) FROM `phpbb_posts` WHERE `forum_id` = '$forum_id'"; $result = mysql_query($sql); $postCount = mysql_result($result, 0); $sql = "SELECT * FROM `phpbb_posts` WHERE `forum_id` = '$forum_id'"; if (!mysql_query($sql)){ error('A database error occurred in processing your '. 'submission.\\nIf this error persists, please '. 'contact geo877@hotmail.co.uk.'); }else{ $result = mysql_query($sql); } $loadCount=0; for($i=($postCount-1);$i>=0;$i--){ if($loadCount<$maxNews){ $loadCount++; ${'post_subject'.$i} = mysql_result($result,$i,'post_subject'); ${'post_text'.$i} = mysql_result($result,$i,'post_text'); // add fix the simily path $targetstring = "{SMILIES_PATH}"; if(stristr(${'post_text'.$i}, $targetstring) == TRUE) { ${'post_text'.$i} = str_replace($targetstring, $phpbb_root_path."images/smilies", ${'post_text'.$i}); } echo("<h3><b>".${'post_subject'.$i}."</b></h3>"); echo("<div class='content'><p>".${'post_text'.$i}."</p></div>"); echo("<div class='meta'></div>"); } } thanks, sorry for the messy code i'm sorta new
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.