Jump to content

hakimserwa

Members
  • Posts

    230
  • Joined

  • Last visited

Everything posted by hakimserwa

  1. that is wrong. if you want to go the loop way it would be $mult = array ( 0 => array ( 'sno' => 'q3', 'result' => '15', ), 1 => array ( 'sno' => 'q1', 'result' => '5', ), 2 => array ( 'sno' => 'q2', 'result' => '10', ), ); $marged = array(); foreach($mult as $value){ foreach($value as $key => $mult_value){ $marged[$key]= $mult_value; } } //$marged array will only have two element becuase all sub array keys are the same. the loop overrides keys of the same name it better you use array index or change the index keys to unique names
  2. try this if(document.registerationform.emailtxt.value=="") { document.getElementById('une').innerHTML = "Email id requered"; registerationform.emailtxt.style.border="solid red"; // add this registerationform.emailtxt.focus(); return(false); }
  3. set the charset in the head of you document to UTF-8 this will solve your problem
  4. use array_merge http://www.php.net/manual/en/function.array-merge.php
  5. start by trying out something then at some point when you are stack, post you code then you will be corrected. the best way of teaching your self to code is teaching your self to try.
  6. try removing the last set of quotation marks $a = mysql_query("select * from twitter_access_tokens ORDER BY RAND() DESC LIMIT ".$limit.""); to $a = mysql_query("select * from twitter_access_tokens ORDER BY RAND() DESC LIMIT ".$limit);
  7. <form action="frmGen" method="post"> <input name="txtAddr" type="text"> <!-- User enters text here -- Confirm txtAddr.text = $VarAddr -- If True, continue. If False, display DIV message --> <input name="txtDest" type="text" style="display:none"> <!-- Text field is filled with value from server/SQL when btnGen is pressed--> <input name="txtKey" type="text" style="display:none"> <!-- Text field is filled with value from server/SQL when btnGen is pressed--> <input name="btnGen" type="button"> <!-- assuming txtAddr is True, display strings in 2 text fields above & store all values from 3 text boxes in SQL --> </form> javascript using jquery function check_txtAddr(){ var txtAddr = $("form input[name=txtAddr]").val(); // post the value to a php script that will check if txtAddr = to the valuable you are checking. // if it does show the other two input fields. // use the jquery post function. $.post(check_txtAddr.php, {txtAddr:txtAddr}, function(data) { // catch the response data from the php file var txtDest = data['txtDest']; var txtKey = data['txtKey']; if (txDest !== ""){ $("form input[name=txDest]").attr("value", txDest); $("form input[name=txDest]").show(); } if (txtKey !== ""){ $("form input[name=txtKey]").attr("value", txDest); $("form input[name=txtKey]").show(); } }, 'json'); } $("document").ready(function() { $("form input[name=btnGen]").click(check_txtAddr); }); php script check_txtAddr.php if (isset($_POST['txtAddr'])){ // check if $_POST['txtAddr'] == to the valuable you want to check if ($_POST['txtAddr'] == $your_valuable){ //prepare the response return value to jquery $txtKey = //what ever you want to populate in that field $txDest = //what ever you want to populate in that field // return the response by echoing it out as json encoded data for simplist make it an array. echo echo json_encode(array('txtKey'=>$txtKey,'txDest'=>$txDest)); } } Try it its not tested but i believe it can give you a starting idea on what you have to do. Thing that you need to make more research about how they work is jquery post method, json. good luck
  8. The question is not clear, The search bar that you want to remove i beleive you talking about html. now if this is an online site can you just post a link to the site?
  9. try using the code tag so we can able to read your code clearly
  10. if you dont know ask you are ashaming the guru tag. check the code if it gives any error report the error. by the way what was your solution to the problem? you could not even see that the guy's $message was not set. by the way those {} are called inline substitution. call it a day you lernt something new.
  11. replace this for your $message $message = <<<MAILBODY Name: {$first $last} Business Name: {$business} Conact Numbers: Home: {$home} Cell: {$cell} Other: {$other} Preferred Contact time: {$con_time} Address: Street Address: {$street} City: {$city} State: {$state} Zipcode: {$zip} MAILBODY;
  12. when you go to a night club, after you pay the bauncers nomaly stamp on your hand a stamp that shows other security officials that you have already paid and you have gone through the neccesary check. At this point lets call a $_SESSION['login'] to be our stamp That is going to tell all pages that requires login that this person has been checked in and here is the stamp. Now what you need to do is on each page where you require login, put this code right at the beggining before anything is written. // check if session login is set from the login page. if(!isset($_SESSION['login'])){ header("Location: login.php"); exit; }
  13. try changing this <form action='update_category.php?category_id=$category_id' method='POST' > to <form enctype="multipart/form-data" action='update_category.php?category_id=$category_id' method='POST' >
  14. try this $tableOne = "<table> <tr> <td>Name:</td> <td>Exam no:</td> <td>Roll No:</td> <td>Semester:</td> </tr>"; if (!empty($row)) { foreach ($row as $data) { $tableOne .= "<tr> <td>{$data['Name']}</td> <td>{$data['Examno']}</td> <td>{$data['Rno']}</td> <td>{$data['Sem']}</td> </tr>"; } } $tableOne .= "</table>"; $tableTwo = "<table> <tr> <td>Paper Code</td> <td>Title</td> <td>CIA</td> <td>ESE</td> <td>Credits</td> <td>Grade</td> <td>Grade Pt</td> </tr>"; if (!empty($row)) { foreach ($row as $data) { $tableTwo .= "<tr> <td>{$data['Subcode']}</td> <td>{$data['Title']}</td> <td>{$data['CIA']}</td> <td>{$data['ESE']}</td> <td>{$data['Credits']}</td> <td>{$data['Grade']}</td> <td>{$data['Gradept']}</td> </tr>"; } } $tableTwo .= "</table>"; echo $tableOne; echo "<br />"; echo $tableTwo;
  15. What is it you want, that this code is not doing for you? this part of the code that you are asking $CI =& get_instance() is referencing an open instance of the object Courses_model. remember the code you are asking of is an oop which is being extended from another code or class(Base_module_model) so for one to understand it clearely you also need to provide the Base_module_model class and that a big code to read. the easy way would be you to explain where you are going wrong in the code so we can try to deburg the problem
  16. You used oop so the answers to you questions lies in the object valuable $result which in my case it should be a mysql resource. i dont think data was fetched and by the way how did you use the while loop? unless you mixed oop with procedural, it doesnt make sense whenb you talk about using while
  17. where is the code that you are using now? any way you can write a php code on top of the page before any html that will check for whatever house keeping and if requirements are not met then set the messege in a session and redirect either to the referer page or any page of your choice. lets say!!! then on the other page make a condition statment that checks if $_SESSION['massege'] is set and if yes display it and destroy it.
  18. well i think the the reason why you dont understand the answers is because no one understands your question. post the code that you have now and try to explain on it as to what the problem is and the idea you have to solving it and where you are stack then we shall start from there
  19. I think the reason why the for each did not work is because you had not done a fetch (either fetch_array or other) on your sql.
  20. Hello i think it will be simply understandable if you put it this way. Question 1) If Variable 1,2 and 3 have the values 3,5 and 7 like the last user said, the problem in this question is they used numbers for valuable representation. literary a valuable is a place holder for a value. so what they are saying here is if we had place holders 1,2 and 3. place holder 1holds value 3, place holder 2 holds value 5 and place holder 3 holds value 7. this is how its writen in php. first of all in php valuable names have rules, one of which is theie names cant start with an integer. so we shall represent the above valuables in this way. $one = 3; $two = 5; $three =7; I think by now the question starts to be clear.
  21. No, just no. Not only is this bad advice, as I've yet to see any good code produced by WYSIWYG-editors, but it has nothing to do with the question the OP asked. basic way of getting used html fundamentals. Dreamweaver helped me to understand how <link href= works.
×
×
  • 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.