Jump to content

KubeR

Members
  • Posts

    72
  • Joined

  • Last visited

Everything posted by KubeR

  1. Post actually,I switched it to post.
  2. Indeed,there was a mod_security and it fixed the problem. but it doesn't save long messages(3000 letters),in php.ini it set to 64M by default,which is enough(?) so what can cause the problem ?
  3. UTF-8 without BOM the .htacess is inside it,well,as I said,I tried to send a file with the word : Test and it passed successfully and showed up on the page. but when I try to pass a much longer and in Russian text,it says it's unacceptable.
  4. hm...have no idea what it means nor fix this,but here it is: EDIT: tested it by passing the text in English and as I understood it doesn't accept text in Russian,how can I save text in Russian then ?
  5. Yep,it is under that block (in it) and about the id,thanks for telling.
  6. Hi, well,lately I tried to create a button which transfers the value from the element to another file(.php) through $.get, but when I try to transfer data,it says that it's undefined. the code: l=$("#text_edit").val(); $.get("save.php", { id : "0", c : l },function(data) { alert(data.id); alert(data.c); }); so my question is,why it fails to transfer and the data is undefined ?
  7. Okay the problem is fixed,the solution was very simple actually,all I had to do is instead of using .html to excute the text from the textarea is use .val haven't realized it because it was between the tags and not in the "value" attribute.
  8. well,if you're still interested in a button,then take a look at this page : https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button
  9. getElementById Should start with a lowercaseed letter and the .hide function doesn't accept any arguements. Nevertheless,it is a jQuery function. EDIT: looks like somebody else answered it before me .
  10. Hi, I want to create a cancel button which replaces back the text that was after clicking the "cancel" button. But the problem is,that the tags does not take affect when I use .html() to restore the previous content with all the tags that it had,they show as plain text. I searched for alternative function or way,but didn't find any. So,my question is : is there any command that can filter the html and make the tags work properly with all the attributes they contain ? Before the hand, thank you, KubeR.
  11. Indeed,I saved it as UTF-8,converted/set it to UTF-8 without BOM and it fixed the warning,thanks !
  12. I just tried to look for the problem in the script when I did that,anyway,the answer for your question is : same.
  13. I cut it to the first line as I thought maybe the line was the problem,however I tried to find the problem by deleting the https:// redirection in .htaccess and lowering the php tag by one line and the warning came from the opening tag and not from the first line which was empty.
  14. Yes,but as I already said,I tried this already. The code is located before anything even starts,in a seperated file,included in the file using the "include" function and has an OB in it. This is the code in case maybe it's needed or maybe if the problem is in my code : (these are lines 1 & 2) <? include("cdel.php"); if(!isset($_COOKIE["i"])) {?> cdel.php: <? ob_start(); function delCookie($name) { unset($_COOKIE[$name]); return setcookie($name, NULL, -1); } if(isset($_COOKIE["1"])) { $failed1=$_COOKIE["1"]; delCookie("1"); } if(isset($_COOKIE["2"])) { $failed2=$_COOKIE["2"]; delCookie("2"); } ob_end_flush(); ?> I did try the solutions above,but yet,same problem apears.
  15. Hi, Hm,I've been trying to do this in many different ways,but I never came into solution. The problem is that I have two pages,one for login second for MySQL check and redirection back to the index page. now,I have Private SSL installed and I set the redirection in .htaccess to redirect from http to https. when the user types in the login id & password,then being redirected to the login check page and then quickly back to the index,I create a cookie which holds the result from the MySQL(small,just plain numbers) and I want to delete it once he reaches the index.php. Now,the problem is that it doesn't delete the cookie and at the same time outputs this warnning: Warning: Cannot modify header information - headers already sent by (output started at /home3/kirill/public_html/index.php:1) in /home3/kirill/public_html/cdel.php on line 5 (I created a file named "cdel.php" for it to load in different file before the output & extrenal output buffer(ob_start),both(together & seperated) didn't work and gave the same warning and I didn't step forward to the solution) So,I ask to help me a bit with it(?),as I am just out of idea's and not familiar yet with all PHP features & solutions/problems. Before the hand,thank you. KubeR.
  16. Same code in the first post. <?php is the error cause.
  17. So,as I understood this is unsolveable ?+
  18. Yes,the latest and indeed,it has an .php extension.
  19. Hm,I looked at the source in the browser and it's just don't parse the PHP code. it says that the php prefix ( < ) is 'unexpected token'. Uncought SyntexError:Unexpected token < Does it mean I'll need to find another way to create a file (with JS or something) or there is somekind of fix for this ?
  20. Oh thank you ! Never figured out what these slashes('\') means. But now I left with only one problem,it shows me an error that variable isn't defined. I readed in StackFlow that you can get JavaScript variables into PHP using $_GET["var_name"] but it shows me an "undefined array" and another error "mysqli_query() [<a href='function.mysqli-query'>function.mysqli-query</a>]: Couldn't fetch mysqli in" Never saw these errors and not an expert in PHP,this is the code : $query = 'insert into home values('.$_GET[page_name].','.$_GET[page_name].');'; if($result = mysqli_query($link,$query)) { errors comes from the last line.
  21. Hello, I am sitting on it for about an hour,two three and I just don't understand why I get this error ... I am trying to create a new file with PHP and it gives me this error : Parse error: syntax error, unexpected ']', expecting T_STRING or T_VARIABLE or T_NUM_STRING in admin.php on line 24 now,the problem is that this is line 24 : \n$text[] = $row[0]; Around it/code : function addPage() { var page_name=prompt("Enter name"); if (page_name!=null) { <?php $file = fopen($_GET["page_name"].".php","w"); $fcontent = "\n$query = 'SELECT title FROM home'; \nif($result = mysqli_query($link,$query)) { \n$pages = mysqli_num_rows($result); \nwhile($row=mysqli_fetch_row($result)) { \n$text[] = $row[0]; \n} \nmysqli_free_result($result); \n}"; fwrite($file,$fcontent); fclose($file); ?> } } Will appericiate if somebody will tell me what's wrong in here. Greetings, KubeR.
  22. Hi, I am trying to make a code which will count the number of fields are in the column,fetch all of them,store in an array and place them in the menu options that were created by a loop allocated by the number of rows counted before. But for some reason it shows me null (nothing) or undefined offset and only one is being placed. Can somebody explain why is this happening ? here is the code I made for it : <?phperror_reporting(-1);include("config.php");global $text,$pages;$query = "SELECT title FROM home";if($result = mysqli_query($link,$query)) {$pages = mysqli_num_rows($result);$i = -1;while($row=mysqli_fetch_row($result)) {$i += 1;$text[$i] = $row[$i];}mysqli_free_result($result);}mysqli_close($link);?> Before the hand,thanks, Greetings, KubeR.
×
×
  • 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.