Search Results

Search found 80 results on 4 pages for 'jasmine'.

Page 2/4 | < Previous Page | 1 2 3 4  | Next Page >

  • Problem in Fetching Table contents when adding rows in same table

    - by jasmine
    Im trying to write a function for adding category: function addCategory() { $cname = mysql_fix_string($_POST['cname']); $kabst = mysql_fix_string($_POST['kabst']); $kselect = $_POST['kselect']; $kradio = $_POST['kradio']; $ksubmit = $_POST['ksubmit']; $id = $_POST['id']; if($ksubmit){ $query = "INSERT INTO category VALUES (' ', '{$cname}', '{$kabst}', {$kselect}, {$kradio}, ' ') "; $result = mysql_query($query); if ($result) { echo "ok"; } else{ echo $query ; } } $text .= '<div class="form"> <h2>ADD new category</h2> <form action="?page=addCategory" method="post"> <ul> <li><label>Category</label></li> <li><input name="cname" type="text" class="inp" /></li> <li><label>Description</label></li> <li><textarea name="kabst" cols="40" rows="10" class="inx"></textarea></li> <li>Published:</li> <li> <select name="kselect" class="ins"> <option value="1">Active</option> <option value="0">Passive</option> </select> </li> <li>Show in home page:</li> <li> <input type="radio" name="kradio" value="1" /> yes <input type="radio" name="kradio" value="0" /> no </li> <li>Subcategory of</li> <li> <select>'; while ($row = mysql_fetch_assoc(mysql_query("SELECT * FROM category"))){ $text .= '<option>'.$row['name'].'</option>'; } $text .= '</select> </li> <li><input name="ksubmit" type="submit" value="ekle" class="int"/></li> </ul> </form> '; return $text;} And the error: Fatal error: Maximum execution time of 30 seconds exceeded What is wrong in my function?

    Read the article

  • can't read XML via PHP

    - by jasmine
    I can't find the reason, only see the following error message. Input is not proper UTF-8, indicate encoding ! Bytes: 0x00 0x5D 0x5D 0x3E the followings are my php code $reader2 = new XMLReader(); $reader2->XML($xmlstring); $user_data=""; while ($reader2->read()) { if ($reader2->name == "user_id" && $reader2->nodeType == XMLReader::ELEMENT) { $reader2->read(); $user_data .=$reader2->value; } } $reader2->close(); The followings are XML data <?xml version="1.0" encoding="UTF-8" ?> <SOAP:Envelope xmlns:SOAP="http://www.w3.org/2003/05/soap-envelope" > <SOAP:Body > <user_id>1234567890</user_id> <greeting_name><![CDATA[ABCDEF ..yl/?]]></greeting_name> </SOAP:Body> </SOAP:Envelope> I try a lot of ways,but still can't find the solution. the greeting tag value may be chinese or English words.

    Read the article

  • Mysql Date formats and url query

    - by jasmine
    I want to make a url query with date. I have confused a little : There is a mysql table: calDate : varchar The query : $sql="select * from calTbl"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { $n = str_replace("/", "",$row['calDate']); echo '<a href="index.php?p='.$n.'">'.$n.'</a>'; } I want to see related event from query. Can I set apart month, day and year from this? Or what is the correct table design here? Thanks in advance

    Read the article

  • Function for putting all database table to an array

    - by jasmine
    I have written a function to print database table to an array like this $db_array= Array( ID=>1, PARENTID =>1, TITLE => LIPSUM, TEXT =>LIPSUM ) My function is: function dbToArray($table) { $allArrays =array(); $query = mysql_query("SELECT * FROM $table"); $dbRow = mysql_fetch_array($query); for ($i=0; $i<count($dbRow) ; $i++) { $allArrays[$i] = $dbRow; } $txt .='<pre>'; $txt .= print_r($allArrays); $txt .= '</pre>'; return $txt; } Anything wrong in my function. Any help is appreciated about my problem. Thanks in advance

    Read the article

  • header() function in php : No any redirection!

    - by jasmine
    I have written a very very very simple!! script in php. header redirection not working. 1- encoding : UTF-8 without BOM 2- with adding ob_start() the problem is countiueing. What is wrong in my code; login.php: <?php session_start(); require_once("funcs.php"); db_connection(); $username = $_POST['username']; $password = $_POST['pwd']; $submit = $_POST['login']; if($submit){ if (!filled_out($_POST)) { echo "please fill all fields"; } else{ $query = "SELECT * FROM users WHERE username ='{$username}' AND password ='{$password}'"; $result = mysql_query($query); if(mysql_num_rows($result) == 1){ $found_user = mysql_fetch_array($result); $_SESSION['id'] = $found_user['id']; $_SESSION['username'] = $found_user['username']; $_SESSION['password'] = $found_user['password']; setcookie(session_name(), '', time()+86400, '/'); header("Location: tst.php"); } else{ echo "incorrect username or password"; } } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form id="form1" name="form1" method="post" action=""> <p> <label for="username">Username:</label> <input type="text" name="username" id="username" /> </p> <p> <label for="textfield">Password</label> <input type="password" name="pwd" id="pwd" /> </p> <p> <input name="login" type="submit" id="login" value="Log in" /> </p> </form> </body> </html> <?php db_disconnect();?> and tst.php: <?php session_start(); require_once("funcs.php"); if (!isset($_SESSION['id'])){ header("Location : login.php"); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <table id="structure"> <tr> <td id="navigation">&nbsp; </td> <td id="page"> <?php echo "welcome"."". $_SESSION['username']; ?> </td> </tr> </table> </body> </html> <?php db_disconnect();?> wthit oppening tst.php directly, header() doesnot redirect to login.php

    Read the article

  • PHP File System or XML : Security Issue

    - by jasmine
    I want to make a news portal(php) site with minimum mysql force. :create a cron, fetch data from mysql and write to a php file . (I dont know is it right way) But Can I use xml instead of php file? Write mysql data to xml. Is this a secure way? What is the best way? XML or php file? Thanks in advance

    Read the article

  • url Query and Security

    - by jasmine
    In url query with id I use is_numeric($_GET['id']) for security issues. But in query with for example category name, is urlencode() a right way for security? Thanks in advance.

    Read the article

  • FlashLike Button With jQuery

    - by jasmine
    I have made a flashLike button with jquery via this code: $(document).ready(function() { $('#navigation li a').append('<span class="hover"></span>').each(function () { var $span = $('span.hover', this).css('opacity', 0); $(this).hover(function () { $span.stop().fadeTo(500, 1); }, function () { $span.stop().fadeTo(500, 0); }); }); }); But can we add sound to button in hover like flash buttons? Thanks in advance

    Read the article

  • TinyMCE not working in ie with this code

    - by jasmine
    TinyMCE not working in ie with this js code. How can I solve the problem. Thanks in advance <script type="text/javascript"> tinyMCE.init({ theme : "advanced", mode : "textareas", plugin : "tinyBrowser, media", file_browser_callback : "tinyBrowser", }); function toggleEditor(id) { if (!tinyMCE.get(id)) tinyMCE.execCommand("mceAddControl", false, id); else tinyMCE.execCommand("mceRemoveControl", false, id); } </script>

    Read the article

  • Native language problem in tinyMCE

    - by jasmine
    I have turkish character problem in mysql database when adding content with tinymce from admin panel. Charset is: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9"" /> It accurs when add content in text area with tynymce. How can I solve this? Thanks in advance

    Read the article

  • Paging and edit category status

    - by jasmine
    For edit home status of category I have a link: <span class=\"ha\" title=\"Active in Homepage\">Active in Homepage</span><a href=\"?page=homestatus&id={$row['id']}\" class=\"hp\" title=\"\">Passive in home page</a> and function: function homestatus() { $ID = mysql_real_escape_string($_GET['id']); $query = "UPDATE category SET home = 0 WHERE id= $ID "; $result = mysql_query($query); if (mysql_affected_rows () == 1) { header('Location: index.php?page=categories'); } } Everything works fine but there is paging : /index.php?page=categories&pg=2 I want that an item located in pg=2, redirected to index.php?page=categories&pg=2 How can I do this? Thanks in advance

    Read the article

  • supplied argument is not a valid MySQL result

    - by jasmine
    I have written a function: function selectWithPaging($where){ $pg = (int) (!isset($_GET["pg"]) ? 1 : $_GET["pg"]); $pg = ($pg == 0 ? 1 : $pg); $perpage = 10;//limit in each page $startpoint = ($pg * $perpage) - $perpage; $result = mysql_query("SELECT * FROM $where ORDER BY id ASC LIMIT $startpoint,$perpage"); return $result; } but when inserting in this function : function categories() { selectWithPaging('category') $text .='<h2 class="mainH">Categories</h2>'; $text .= '<table><tr class="cn"><td>ID</td><td class="name">Category</td> <td>Durum</td>'; while ($row = mysql_fetch_array($result)) { $home = $row['home']; $publish = $row['published']; $ID = $row['id']; $src = '<img src="'.ADMIN_IMG.'homec.png">'; ------------- } there is this error: supplied argument is not a valid MySQL result What is wrong in my first function? Thanks in advance

    Read the article

  • Problem with selected subcategory when editing Category items

    - by jasmine
    I want to item's subcatory selected when editing category: <?php function categoryFormEdit() { $ID = $_GET['id']; $query = "SELECT * FROM category WHERE id= $ID"; $result = mysql_query($query); $row = mysql_fetch_array($result); $subcat = $row['subcat']; $text = '<div class="form"> <h2>Add new category</h2> <form method="post" action="?page=editCategory"> <ul> <li><label>Kategori</label></li> <li><input type="text" class="inp" name="cname" value="' . $row['name'] . '"></li> <li><label> Aç&#305;klama</label></li> <li><textarea class="inx" rows="10" cols="40" name="kabst">' . $row['description'] . '</textarea></li> <li> <select class="ins" name="kselect"> <option value="1">Aktif</option> <option value="0">Pasif</option> </select> </li> <li>Üst kategorisi</li> <li> <select class="ins" name="subsl">'; $s = "SELECT * FROM category"; $q = mysql_query($s); while ($r = mysql_fetch_assoc($q)) { $text .= '<option value="' . $r['id'] . '" ' . sQuery() . '>' . $r['name'] . '</option>'; } $text .= '</select> </li> <li>Home page:</li> <li> <input type="radio" value="1" name="kradio"> Active <input type="radio" value="0" name="kradio"> YPassive </li> <li><input type="submit" class="int" value="ekle" name="ksubmit"></li> </ul> </form> </div>'; return $text; } function sQuery() { if ($r['id'] == $subcat) { $t = "selected"; } else { $t = ""; } return $t; } ?> With above code there is not selected item. What is wrong in my script? Thanks in advance

    Read the article

  • News Portals and mysql queries

    - by jasmine
    Consider a news portal like cnn. There is 8 categories. Is there 8 query in every page loading? For eg SELECT title FROM category where cID = 1 SELECT title FROM category where cID = 2 ................... And for sites with high traffic, would be memcache a good solution? Thanks in advance

    Read the article

  • Problem with mysql query in paging

    - by jasmine
    I have a very simple paging and mysql query. Im not sure that my query is right: $perPage =4; $page= (isset($GET['page']) && is_numeric($GET['page'])) ? $_GET['page'] : 1; $start = ($page * $perPage ) - $perPage ; if (is_numeric($_GET['cID'])){$cid = $_GET['cID'];} $totalCount = sprintf("SELECT COUNT(*) as 'Total' FROM content WHERE catID = %d", $cid ) ; $count = mysql_query($totalCount); $rowCount = mysql_fetch_array($count); $sql = sprintf("SELECT id, title, abstract, content_image FROM content WHERE catID = %d ORDER BY id DESC LIMIT %d, %d", $cid, $start, $perPage ); $query = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_array($query)){ echo $row['id'].' : '. $row['title'] .'<br>'; } with /categories.php?cID=1&page=2 and /categories.php?cID=1&page=1 The output is: 95 : titlev 94 : titlex 93 : titlec 92 : titleb and not changed. What is wrong in my query? Thanks in advance

    Read the article

  • Write Mysql tables to XML : Security Issue

    - by jasmine
    I want to make a news portal(php) with minimum mysql force. :create a cron, fetch data from mysql and write to a php file . (I dont know is it right way) But Can I use xml instead of php file? Write mysql data to xml. Is this a secure way? What is the best way? XML or php file? Thanks in advance

    Read the article

  • Mysql date : 0000-00-00 00:00:00

    - by jasmine
    In my query: $cselect = mysql_real_escape_string($_POST['cselect']); --------------- --------------- $sql = sprintf("INSERT INTO content (id, catID, title, abstract, body, status, published, date, description_meta, keywords_meta) VALUES ('', '%s', '%s','%s','%s','%s','%s','%s','', '' )", $cselect,$chead, $cabst,$ctext, $cp, $cradio, 'TIMESTAMP: Auto NOW()'); ouptput for date is: 0000-00-00 00:00:00. What is wrong in my query? Thanks in advance

    Read the article

< Previous Page | 1 2 3 4  | Next Page >