Jump to content


  • Posts

  • Joined

  • Last visited

arunpatal's Achievements

Regular Member

Regular Member (3/5)



  1. Hello, I have a file to display $file_content = file_get_contents("test.php"); This file is encoded.... In this file there is a specific tag call change_me <change_me> "<code> <strong>Example Element</strong> </code>" </change_me> I want to use htmlspecialchars_decode function for <change_me> tag only... <change_me> tag is used two times in file. Thanks
  2. Hi, Have a look this menu http://jsfiddle.net/GBkMB/6/ I want the same mune but with click function (its using hover function now) Please help me with this
  3. $string = ""; $string .= "<textarea id='convert'> 'AA' </textarea>"; $string .= "<textarea id='convert'> 'BB' </textarea>"; $string .= "<textarea id='not_convert'> 'CC' </textarea>"; $string .= "<textarea id='not_convert'> 'DD' </textarea>"; $string = preg_replace_callback('/(<textarea id="convert">)(.*?)(<\/textarea>)/is' ,function($m) { array_shift($m); $m[1] = str_replace('AA', 'ZZ', $m[1]); return implode($m); } ,$string); echo $string; I tried this way but its not working....
  4. Sorry but how do i implement this code with the above code i wrote?
  5. str_replace() will not solve the problem... i can change textarea a bit if its requeired but lets say if string is like this and i want to change all AA to ZZ <?php $string = ""; $string .= '<textarea id="convert"> "AA" KAA="AA" $AA</textarea>'; $string .= "<textarea id='convert'> 'BB' </textarea>"; $string .= "<textarea id='not_convert'> 'AA' </textarea>"; $string .= "<textarea id='not_convert'> 'DD' </textarea>"; ?>
  6. Hello everyone, example string <?php $string = ""; $string .= "<textarea id='convert'> 'AA' </textarea>"; $string .= "<textarea id='convert'> 'BB' </textarea>"; $string .= "<textarea id='not_convert'> 'AA' </textarea>"; $string .= "<textarea id='not_convert'> 'DD' </textarea>"; ?> I want to change 'AA' to 'ZZ' which is inside textarea with the id convert only. How is it possible with the help of regular expression?
  7. So should i use htmlspecialchars function to skip script tags??
  8. Hi, i was testing this example <?php $con = mysqli_connect("localhost","test","","test"); if(isset($_POST["name"])): $stmt = $con->prepare("INSERT INTO products (name,price) VALUES (?,?)"); $stmt->bind_param('si', $name, $price); $name = $_POST["name"]; $price = $_POST["price"]; $stmt->execute(); echo "Inserted {$name},{$price} into database\n";; endif; ?> <form method="post"> <input type="text" name="name" /> <input type="number" name="price" /> <input type="submit" /> </form> But when i write <script>alert("hack")</script> into name input field then the code execute.......... What am i doing wrong???
  9. Hi, I use mysql_escape_string to insert data into my database...... example: $name = mysql_escape_string($_POST["name"]); $lname = mysql_escape_string($_POST["lname"]); mysql_query(INSERT INTO table (fname,lname) VALUES ('$fname','$lname')); But i am not sure if this is safe enough to protect from mysql injuction.... My question is if it's safe to insert data like this?????
  10. Hi, I have a variable $last_visited_time contain time. example 15:12:45 i want to add 30min extra to this time variable.... how can i do this???
  11. That was it..... thanks a lot
  12. $ip_list_to_check = $viks2007->sql_count("SELECT user_ip,DATE_FORMAT(date_time,'%H:%i:%s') AS date_time FROM $count_table_name"); while($row = mysql_fetch_array($ip_list_to_check)): //save all ipaddress in ip_list_array array $ip_list_array[] = $row["user_ip"]; //save all time in time_list_array array $time_list_array[] = $row["date_time"]; endwhile; This is function in viks2007 class function sql_count($sql){ $query = mysqli_query($this->connect,$sql); return $query; } Am getting error Warning: mysql_fetch_array() expects parameter 1 to be resource, object given in C:\xampp\htdocs\includes\ip_address.php on line 8
  13. Adding ob_start(); solved the problem
  14. == is not a problem..... mac_gyver can you tell me the solution for this problem........ by giving example with the code above... Please
  • 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.