jazzman1
Staff Alumni-
Posts
2,713 -
Joined
-
Last visited
-
Days Won
12
Everything posted by jazzman1
-
Prepared statement and change the old mysql_* library to mysqli_* or pdo_mysql if it's possible.
-
Then you will need to add/create a new user who will belong to the root's group. So, for all users belong to root's group you'll need to set special permissions on those directories/files. Don't use a root account to create, modify or delete whatever you want, use this account only in emergency case. What linux distro is that?
-
Which OS is the server running? I guess,it is a linux distro.
-
set permissions to thous files/directories, this is the best method.
-
Display information results from my multi drop down menus
jazzman1 replied to adandy's topic in Javascript Help
I don't use any of them, sorry. Under firefox you could install the add-on named firebug to debug your js/dom content and to assist you effectively. -
Display information results from my multi drop down menus
jazzman1 replied to adandy's topic in Javascript Help
Which javascript debugging tool are you using? Do you have firefox installed in your OS? -
Display information results from my multi drop down menus
jazzman1 replied to adandy's topic in Javascript Help
Moved to Ajax section! Where is the output that I wanted to see? -
Then, you need to go back to php and re-create that json object with data you need to be inside Do you understand what you want to achieve, I'm not sure
-
What's wrong? Mine is OK
-
Try, <html> <head> <title>Json Object</title> <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { var testInfo = ''; // define a testInfo variable var data = { "35": [ { "blog_id": "35", "dateposted": "2014-04-10", "content": "<p>Wow this is <span style=\"color: #008000;\"><em><span style=\"font-size: 14pt;\"><strong>very nice...<\/strong><\/span><\/em><\/span><\/p>", "title": "Thanks", "published": "1", "login": "admin", "img": "public\/img\/blog-image.png", "username": "Skewled", "comment": "thanks" }, { "blog_id": "35", "dateposted": "2014-04-10", "content": "<p>Wow this is <span style=\"color: #008000;\"><em><span style=\"font-size: 14pt;\"><strong>very nice...<\/strong><\/span><\/em><\/span><\/p>", "title": "Thanks", "published": "1", "login": "admin", "img": "public\/img\/blog-image.png", "username": "Skewled", "comment": "fasdfa asdf asd fasdfasd [b]test[\/b]" } ], "34": [ { "blog_id": "34", "dateposted": "2014-04-09", "content": "<p><em><strong>sdfasdf asdafsadf<\/strong> asdfasd <\/em> asdfasdf <span style=\"color: #008000;\">asdf asdf asdf asdfsa asfasdfaasdf <span style=\"color: #000000;\">asdfasdf<\/span><\/span><\/p>\n<p><span style=\"color: #008000;\"><span style=\"color: #000000;\">saf asdfasd <strong>fasdfasdf asdfasdf<\/strong> asdf adsfa asdfasdf asdf asdf asdfasdfa sdf asdf<\/span><\/span><\/p>\n<p><span style=\"color: #008000;\"><span style=\"color: #000000;\">sadfs dfasdf asdf asdf asdf<\/span><\/span><\/p>", "title": "Launch Party", "published": "1", "login": "admin", "img": "public\/img\/blog-image.png", "username": "Skewled", "comment": "<p><em><strong>sdfasdf asdafsadf<\/strong> asdfasd <\/em> asdfasdf <span style=\"color: #008000;\">asdf asdf asdf asdfsa asfasdfaasdf <span style=\"color: #000000;\">asdfasdf<\/span><\/span><\/p>\n<p><span style=\"color: #008000;\"><span style=\"color: #000000;\">saf asdfasd <strong>fasdfasdf asdfasdf<\/strong> asdf adsfa asdfasdf asdf asdf asdfasdfa sdf asdf<\/span><\/span><\/p>\n<p><span style=\"color: #008000;\"><span style=\"color: #000000;\">sadfs dfasdf asdf asdf asdf<\/span><\/span><\/p>" }, { "blog_id": "34", "dateposted": "2014-04-09", "content": "<p><em><strong>sdfasdf asdafsadf<\/strong> asdfasd <\/em> asdfasdf <span style=\"color: #008000;\">asdf asdf asdf asdfsa asfasdfaasdf <span style=\"color: #000000;\">asdfasdf<\/span><\/span><\/p>\n<p><span style=\"color: #008000;\"><span style=\"color: #000000;\">saf asdfasd <strong>fasdfasdf asdfasdf<\/strong> asdf adsfa asdfasdf asdf asdf asdfasdfa sdf asdf<\/span><\/span><\/p>\n<p><span style=\"color: #008000;\"><span style=\"color: #000000;\">sadfs dfasdf asdf asdf asdf<\/span><\/span><\/p>", "title": "Launch Party", "published": "1", "login": "admin", "img": "public\/img\/blog-image.png", "username": "Skewled", "comment": "<p><em><strong>sdfasdf asdafsadf<\/strong> asdfasd <\/em> asdfasdf <span style=\"color: #008000;\">asdf asdf asdf asdfsa asfasdfaasdf <span style=\"color: #000000;\">asdfasdf<\/span><\/span><\/p>\n<p><span style=\"color: #008000;\"><span style=\"color: #000000;\">saf asdfasd <strong>fasdfasdf asdfasdf<\/strong> asdf adsfa asdfasdf asdf asdf asdfasdfa sdf asdf<\/span><\/span><\/p>\n<p><span style=\"color: #008000;\"><span style=\"color: #000000;\">sadfs dfasdf asdf asdf asdf<\/span><\/span><\/p>" } ] } $.each(data, function(blogObjects, blogObject) { $.each(blogObject, function(blog, blogInfo) { // console.log(blogInfo.content); testInfo += 'Blog ID: ' + blogInfo.blog_id + '<br>' testInfo += 'Dateposted: ' + blogInfo.dateposted + '<br>' testInfo += 'Content: ' + blogInfo.content + '<br>' testInfo += 'Title: ' + blogInfo.title + '<br>' testInfo += 'Published: ' + blogInfo.published + '<br>' testInfo += 'Login: ' + blogInfo.login + '<br>' testInfo += 'Image: ' + blogInfo.img + '<br>' testInfo += 'Username: ' + blogInfo.username + '<br>' testInfo += 'Comment: ' + blogInfo.comment + '<br>' }); }); //end of each construct $('#test').html(testInfo); // write down the info to html document }); </script> </head> <body> <div id="test"></div> </body> </html>
-
Your script from 1st post works for me, comment out this line - echo 'asdsad';
-
Yes, you could delete and re-create it but make sure you have a backUp for every case
-
Believe or not, the ability of debugging your applications is an essential part of every development and this process shoud be learn from every programmer after he/she type echo "Hello World" and print the output to the browser.Everything you need to do is to validate in a proper/security way every value coming from your update form and going to the application and database server later. So, post your html update form and at a starting point before sending a query to database server, just echo the statement and post the result. $updateSQL="UPDATE Victims SET victimFName='".mysql_real_escape_string($_POST['victimFName'])."' WHERE victimId='".mysql_real_escape_string($_POST['victimId'])."'"; echo $updateSQL; exit;
-
Have you checked the values (on the server-side) of "victimFName" and "victimId" when the form is being submitted?
-
When the php parser encountered a string enclosed in single quotes in the php document, it treats variables and any others spacial symbols like \n,&,|| and so on...as a literal text.In your example above not only the value of $name will be escaped but $from,$email,$message as well.
-
Only the $name variable? I believe not http://www.php.net/manual/en/language.types.string.php
-
You would create two hidden divs.When the button was clicked set the visibility of the first div to "visible", when the content received from the server to client (browser) hide the first div and display the second. Note: Instead a text message you can hire some graphic designer or just search on the web for animated elements like .gif with similar content. Try, <script> $(document).ready(function(){ $('#submit').click(function(){ $("#sending").css("visibility", "visible"); $.post("chat.php", $("#mycontactform").serialize(), function(response) { $("#sending").css("visibility", "hidden"); $('#success').html(response); $("#receiving").css("visibility", "visible").delay(3200).fadeOut(1000); }); return false; }); }); </script> <form action="freaks.php" method="post" id="mycontactform" > <label for="name">Name:</label><br /> <input type="text" name="name" id="name" /><br /> <label for="email">Email:</label><br /> <input type="text" name="email" id="email" /><br /> <label for="message">Message:</label><br /> <textarea name="message" id="message"></textarea><br /> <input type="button" value="send" id="submit" /> </form> <div style="visibility: hidden" id="sending">Sending email........</div> <div style="visibility: hidden" id="receiving">Your email has been sent........</div> <div id="success" style="color:red;"></div>
-
Spell checking UTF-8 text with HunSpellChecker class
jazzman1 replied to msoutopico's topic in Other Libraries
You need to use multibyte string functions. BTW: It's not very ethical to us, members posting only a link to other help forum/channel trying to get a faster help. -
I am not familiar with that, nor with clicks To the question, when the click occurred its value is sent to the server and by default it's equal to 1, if so why don't you make some validation on the server side, that the value should b explicitly equal to 1?
-
I don't get it very well, so you only want to allow them to increase their values by cliking the button, right?
-
You already have the answers given from denno20 and daviddanis. Everything you need to do is to re-structure the array grouping it by blog_id and parse the data by json_encode function. So, instead, foreach ($data as $result) { //Initialise array for the blog ID of the current $result, if it's not already done so if (!isset($outputArr[$result['blog_id']])) { $outputArr[$result['blog_id']] = array(); } //Append the comment_text for this result to the array for this blog_id $outputArr[$result['blog_id']]['blog_id'] = $result['blog_id']; $outputArr[$result['blog_id']]['dateposted'] = $result['comment']; $outputArr[$result['blog_id']]['content'] = $result['content']; $outputArr[$result['blog_id']]['title'] = $result['title']; $outputArr[$result['blog_id']]['published'] = $result['published']; $outputArr[$result['blog_id']]['login'] = $result['login']; $outputArr[$result['blog_id']]['img'] = $result['img']; $outputArr[$result['blog_id']]['username'] = $result['username']; $outputArr[$result['blog_id']]['comment'] = $result['comment']; } // use foreach ($data as $row) { if (!isset($outputArr[$row['blog_id']])) { $outputArr[$row['blog_id']] = array(); } $outputArr[$row['blog_id']][] = $row; } if(!empty($outputArr)) $this->output->set_output(json_encode($outputArr));
-
Display information results from my multi drop down menus
jazzman1 replied to adandy's topic in Javascript Help
Where are '#states' and '#city' ids in your html, I see only '#country'. Can I see the output of this data, jQuery(".wrap").on('change', '#country',function() { var querystr = 'countryid='+jQuery('#country :selected').val(); jQuery.post("<?php echo plugins_url(); ?>/Destination_Drop_Down_Menu/ajax.php", querystr, function(data){ if(data.errorcode == 0){ console.log(data); // here jQuery('#statecbo').html(data.chtml) }else{ jQuery('#statecbo').html(data.chtml) } }, "json"); I'm using a console log in firefox to debug my js scripts. -
<script>alert("hack")</script> is a test for reflected cross site scripting (XSS) not for SQL injections