[Solved] unexpected token in succes row [closed]
you forgot to add 1 more closing parenthesis $(“#” + div_id1).html(‘<br>’ + response.substring(0, 1)); $(“#” + div_id2).html(response.substring(1, 2)); solved unexpected token in succes row [closed]
you forgot to add 1 more closing parenthesis $(“#” + div_id1).html(‘<br>’ + response.substring(0, 1)); $(“#” + div_id2).html(response.substring(1, 2)); solved unexpected token in succes row [closed]
I’ve been working a lot with Cakephp 2, and i’m currently learning Cakephp 3. What I can say so far is: cakephp 3 introduces a lot a interesting new functionnalities (i won’t detail here, you can find many resources on internet for that). cakephp 3 is really a major release: many things have changed. Even … Read more
Try using this query – $query = mysqli_query(“SELECT subcommentid,COUNT(*) as count FROM table GROUP BY subcommentid ORDER BY count DESC;”); $result = mysqli_fetch_array($query); echo $result[‘subcommentid’].'<br/>’; //subcomment id echo $result[‘count’]; // number of rows If you want all, store in array – $results = array(); while($row = mysqli_fetch_array($query)) { $results[$row[‘subcommentid’]] = $row[‘count’]; } echo “<pre>”;print_r($results);exit; 2 … Read more
The 1000th time: NO, you can’t protect your website by IP restrictions. Attackers could use use proxies or spoof their IP’s. If you really encounter some sort of heavy traffic from one single IP, you could temporarily block this IP using a system-wide firewall rule (check iptables). Temporary because this IP will likely change frequently. … Read more
Just don’t set it in the first place function createArray($rows){ $array = array(); if(isset($rows[‘UnitId’])) $array[‘id’] = $rows[‘UnitId’]; } 1 solved PHP shorthand to skip a variable assignment
You need somthing like this? Not clear what is your requirement. Check this blog for more Rewriting example.com/user.php?username=xyz to example.com/xyz RewriteEngine On RewriteRule ^([a-zA-Z0-9_-]+)$ user.php?username=$1 RewriteRule ^([a-zA-Z0-9_-]+)/$ user.php?username=$1 Refer htaccess2 tricks solved How to do this: example.com/users/user1 [closed]
You have 2 options Fault: Your body of code below, caused a parse error and this is due to an unescaped quote in the word doesn’t Option 1: Change this body of text/code: echo ‘<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”> <html><head><title>401 Authorization Required</title></head><body> <h1>Authorization Required</h1> <p>This server could not verify that you are authorized to … Read more
Use <> or != as an not equal to operator. SELECT * FROM member WHERE personID <> 123; SELECT * FROM member WHERE personID != 123; If you want to exclude multiple IDs: SELECT * FROM member WHERE personID NOT IN (1,2,3); 4 solved Select all rows but one [closed]
Try regex preg_math ad use the $matches. The regex is: /\(+(.*)\)/ solved PHP string functions not working for json_encoded values [closed]
This code will display city if avaialable <?php $getCityQuery = mysql_query(“SELECT city FROM tbl_city_master WHERE id = “.$rs->city.””); if ($getCityQuery) $resultSetCityQuery = mysql_fetch_assoc($getCityQuery); ?> <?php if (resultSetCityQuery != null) echo “<strong>City-</strong>$resultSetCityQuery[‘city’]”; ?> 4 solved If else condition in php [closed]
As I understand, you are asking how to determine the alternate divs for applying different styles. You should use CSS classes to give the divs alternate effect. .section{width:500px; height:200px;} .rightinfo{ float : right; } .leftinfo{ float : left; } .section img{width:402px; height:178px;} In your PHP code before while loop have a variable $style = 0; … Read more
You can use almost the same syntax in PHP as your C++ function does: function encryptDecrypt($toEncrypt) { $key= array( ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’ ); $key_len = count($key); $output = $toEncrypt; for ($i = 0; $i < strlen($toEncrypt); $i++) { $output[$i] = $toEncrypt[$i] ^ $key[$i % $key_len]; } return $output; } … Read more
On line 33 you have $i++, but you haven’t initialised $i I expect you have a syntax error in your MySQL query. Try this: $query1 = mysql_query($query) or die(mysql_error()); which will display the SQL error which you’ll have to fix. More: Your SQL is susceptible to an injection attack. Make sure you escape your inputs … Read more
You should not just use str_replace and using regular expressions seem overkill as well. Keep it simple and test for the beginning of the strings and just use the substring of what you actually want: function trimUrl($url) { if (strpos($url, ‘http://www.’) === 0) { return substr($url, 11); } if (strpos($url, ‘http://’) === 0) { return … Read more
You are accessing a variable that isn’t defined unless $_POST[‘name’] has been defined. Change the line if ($name == “”){ to if (empty($name)) { PHP will check to see if the variable is set before trying to access it and see if it’s empty using this function. See this doc for more info 2 solved … Read more