Jump to content

Ch0cu3r

Staff Alumni
  • Posts

    3,404
  • Joined

  • Last visited

  • Days Won

    55

Everything posted by Ch0cu3r

  1. The uri is wrong for the tag link echo '<li><a href="blog_tags.php?=tagId=' . $tagId . '"title="' . $tagName . '">' . $tagName . '(' . $tagCount . ')</a></li></form>'; Remove the = after blog_tags.php? Correct format of query string is filename.php?varX=valueX&varY=valueY&... etc
  2. All you need was function addtemplateslashes($text) { return "?".">".$text[1]."<?php"; } $template = preg_replace_callback("/\?".">(\r*\n*.*)(<\?php|<\?)/siU",'addtemplateslashes', $template);
  3. That will echo the string $clean not the value for $clean. No need for the quotes or (). All you need is $name = trim($_POST['name']);
  4. What are you trying to do?
  5. Lines 92 to 93 above should be if(mysql_num_rows($new)>0){
  6. So you are using $mysqli->query() without connecting to mysql. What do you think you need to do now? Also note mysqli methods/functions and mysql_* functions are not compatible. You use one or the other, not both at the same type.
  7. So where is the types of business stored?
  8. You have left of the closing brace on line 98 (highlighted in red below) if(mysql_num_rows($signupdate)>0){ print "<ul>"; while($users=mysql_fetch_array($signupdate)){ print "<li>{$users[0]}</li>"; } } // <--- add this closing brace on line 98 Also you will want to echo out the closing list tag </li> after the while loop so your HTML has valid syntax. Having invalid HTML syntax could result in unexpected behaviour in different browsers.
  9. Well thats for listing the agents. Just renaming the variablesisn't enough. You need to make sure you are setting data to the $_SESSION['typeofbusiness'] variable in order for your code to do anything to it. What is it you are trying to do with the Type of Business field
  10. So where have you got this code from? You have copied it from somewhere and just expect it to just work.
  11. You are getting the undefined index for typeofbusiness because it is not set in the $_SESSION
  12. You need to use curly braces for code blocks { and }. Not parenthesesis ( and ) if($number_of_result < 1) echo "No result found. Please try with other keyword."; else { // open curly brace //results found here and display them while($row = mysql_fetch_assoc($result)) { // open curly brace $title = $row["title"]; $link = $row["link"]; echo "<div id='search-result'>"; echo "<div id='title'" . $title . "</div>"; echo "<br />"; echo "<div id='link'" . $link . "</div>"; echo "</div>"; } // close curly brace } // close curly brace ?>
  13. What ever this does $body = preg_replace(array('/\<sup\>\&reg;\<\/sup\>/', '/\<sup\>\&trade;\<\/sup\>/', '/\" /', '/\",/', '/\"<br>/', '/<br>/'), array('RM', 'TM', '",', '" ', '"<br>', 'BREAK'), htmlspecialchars_decode($http->getBody())); It is most probably causing the XML parse error(s) Try commenting it out. What should that be replacing? You probably want to apply the preg_replace to a specific node in the XML not the XML itself.
  14. So they was never set to DATE datatype. That contradicts what you said before.
  15. You need to debug your queries. Also mysql_affected_rows only works for INSERT, DELETE, REPLACE and UPDATE queries not SELECT queries. You should use mysql_num_rows.
  16. You coded the foreach loop wrong. Use the foreach loop I posted in reply #4 Notice where I use the $arr[$key] and $value variables.
  17. You need to initialise your dates with the DateTime object before you use date_diff() See examples here http://www.php.net/manual/en/datetime.diff.php
  18. What is the data type you are using for the start and end date columns? They both should be set to DATE That to me suggests you are not implementing my code correctly. Can you post your actual code you are using now.
  19. I wouldn't of known that.You just posted a few lines of code with no explanation of what does what. No Idea.
  20. So what is calling the socialiconsselect_callback() method?
  21. You are using printf incorrectly Change the function to public function socialiconsselect_callback() { $menu = '<select id="socialiconsselect" name="social_contact_display_options[socialiconsselect]" />'; $options = array('Light', 'Dark', 'Modern Flat', 'Cute', 'Shaded', 'Simple Flat', 'Circle', 'Vintage', 'Retro', 'Retro 2', 'Wooden', 'CSS and HTML5 set 1', 'CSS and HTML5 set 2'); $socialiconsselect = isset( $this->options['socialiconsselect'] ) ? esc_attr( $this->options['socialiconsselect']) : ''); foreach ($options as $option) { $menu .= '<option value="' . $option . '" id="' . $option . '"' . ($socialiconsselect == $option ? ' selected="socialiconsselect"' : '') . '>' .$option .'</option>'; } $menu .= '</select>'; return $menu; // return the html for the menu } You can then echo the method echo $obj->socialiconsselect_callback(); to display the menu
  22. it might be because the dates are not quoted in the str_to_date function. Change the foreach loop to /*santitise the values*/ foreach($arr as $key => $value) { $value = trim(mysql_real_escape_string($value)); if($key == 0 || $key == 1) { // only apply this to the first ($arr[0]) and second ($arr[1) item in $arr $value = "STR_TO_TIME('".$value."', '%m/%d/%Y')"; // wrap date in quotes } else { $value = "'$value'"; } $arr[$key] = $value; } Because you are using print_r within the foreach loop probably.
  23. Change how you implode. So change $arr[$key] = trim(mysql_real_escape_string($value)); if(strlen($arr[$key]) == 10) { $arr[$key] = "STR_TO_TIME(".$arr[$key].", '%m/%d/%Y')"; } to $value = trim(mysql_real_escape_string($value)); if(strlen($value) == 10) { $arr[$key] = "STR_TO_TIME('".$value."', '%m/%d/%Y')"; } else { $arr[$key] = "'$value'"; } and change the implode to implode(", ", $arr)
  24. What is the actual error you are getting? You should at least pass any $_POST values to mysql_real_escape_string before using them in your SQL Queries. This is to protect you from SQL Injection. $sqlcourse = sprintf("INSERT INTO $typ VALUES ('','%s','%s','%s','%s')", mysql_real_escape_string($_POST['type']), mysql_real_escape_string($_POST['time']), mysql_real_escape_string($_POST['desc']), mysql_real_escape_string($_POST['fileend']);
  25. Oh thats why you are using the letters are keys. The second L letter is over writing the first L letter in the word hello. You should set the positions as the key and the letters as the value. Basically swap the parameters around for when you call array_combine $carr = array_combine($p2, $upper_split); Then the foreach construct becomes (swap $pos_1 and $char around) foreach (array_combine($upper_split, $p2) as $pos_1 => $char)
×
×
  • 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.