- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 8
- Posts with Upvotes
- 8
- Upvoting Members
- 6
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
65 Posted Topics
Re: Hi, In functions.php -> retrieveEntries(). Before the statement [CODE]return $e;[/CODE] , use the following code to do the debug. [CODE]var_dump($e);[/CODE] You are getting the error coz the $e returned from the function is not an array. Also try to add some echo statements in the if{} else{} conditions in the … | |
Re: What are you trying to do in this comparison ? [CODE]if(!($_SESSION['count']=$_POST['reg']))[/CODE] You might want to change that to [CODE]if($_SESSION['count']!=$_POST['reg'])[/CODE] | |
Re: You are getting that as an array probably because the following 2 input elements have the same name in your form. ( viz, name="gambar" ) [CODE]<td>Gambar</td> <td><input type="file" name="gambar"/></td> </tr> [/CODE] and [CODE]<input type="hidden" name="gambar" value="<?php echo $gambar['name']; ?>"/>[/CODE] | |
Re: Hi, I don't see anything wrong in your code. However there is one small thing. I guess if there was already an email in the DB, then you wanted to return 1, else 0. But now it returns 0 if an email already exists, else 1. But my speculation is … | |
Re: Check the following link to know more about how mysql_fetch_assoc() works. [url]http://in2.php.net/manual/en/function.mysql-fetch-assoc.php[/url] [CODE] $sql1 = mysql_query("SELECT equipmentid, description FROM equipment") or die(mysql_error()); //$numberofrows = mysql_num_rows($sql1); Not necessary in this case, but for you to know how to fetch the number of records returned. while($row = mysql_fetch_assoc($sql1)) { echo '<input type="checkbox" … | |
Re: Add another parameter to the data: part in your jquery function. There is no other way to know if user has clicked on Share since this is not a form element. [CODE]var DATA = 'status=' + status + '&share=true';[/CODE] | |
Re: Hi, In the first snippet where you are redirecting. [CODE]redirect("blank.php?".$_SESSION["id"]);[/CODE] I think you wanted it to be with id=$_SESSION['id'] [CODE]redirect("blank.php?id=".$_SESSION["id"]);[/CODE] Hope it helps. ![]() | |
Re: Check the following link. [url]http://www.php.net/manual/en/features.file-upload.post-method.php[/url] validate the $_FILES['userfile']['type'] to find the mime type of the uploaded file and save the file info in appropriate table. You can also save the files in different directories based on this information. The link also has some examples on handling the file upload. ![]() | |
Re: Please post your code. | |
Re: When you click on a submit button, only the values of that respective form elements will be posted on to the file specified by action="abcd.php" file in the <form> tag. In your case when you click on any other submit button say for ex: search1 , then only the element … ![]() | |
Re: That means you are sending output before calling the header() function in your script. Check for the following explanation from [url]http://php.net/manual/en/function.header.php[/url] [I]Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very … ![]() | |
Re: Hi, Below is the code with a small change. I have shifted the $shortest = -1 line inside the first foreach() loop. I hope it helps. [CODE] //$input = $_POST['input']; $input = "bleu,grun,yelow,integer,crout"; $input = explode(',', $input); $words = "yellow,green,grapes,blue,court"; $words = explode(',', $words); //$shortest = -1; Shift this inside … | |
Re: Below is the edited version of guessGame() function. Hope it helps [CODE]function guessGame() { var randomnumber = Math.floor(Math.random() * 51); do { var guess = prompt("Please enter a number between 1 and 50", "") if (guess > randomnumber) { alert("Guess lower!"); } else if (guess < randomnumber) { alert("Guess higher!"); … | |
Re: [CODE] <script type="text/javascript"> $(document).ready(function(){ $("p").click(function(){ var testy = $(this).text(); var testAreContent = $('#area51').val(); testAreContent = testAreContent+testy + '\n'; $('#area51').val(testAreContent); }); }); </script> [/CODE] Hi, A small change in the jquery script. This works fine. Hope this helps. | |
Re: I hope the following script solves your problem. [CODE]<?php if(isset($_POST['clickhere'])) { $selected_values = $_POST['color']; foreach($selected_values as $key=>$value) { // Insert query comes here. echo "Insert Query - ".$value."<br />"; } $select_blue = (in_array('1',$selected_values)) ? "selected" : ""; $select_green = (in_array('2',$selected_values)) ? "selected" : ""; $select_red = (in_array('3',$selected_values)) ? "selected" : … ![]() | |
Re: The best way to deal with this is to make sure you store only one kind of apostrophe in your database no matter what the user enters. So before storing the value in the database do a str_replace() to strore appropriate apostrophe. Also in the search module, take the user … | |
Hi All, I need to validate the telephone number entered by the user in a form. Following are the conditions. 1. The length of the string should be 10. 2. The first character should be ZERO. 3. Remaining 9 characters can be any digits from 1-9. I am using the … | |
Re: say you have one.php where you will do the insert one.php [CODE]<?php . . . $insert_query = "insert into table1 (col1,col2) values ('val1','val2')"; mysql_query($insert_query); // Now get the of the above inserted row to some variable say $id echo "<script type='text/javascript'>window.open('http://www.abc.com/test/two.php?id=".$id."');</script>"; ?>[/CODE] Your two.php should have the code to retrive … | |
Re: I couldn't notice anything wrong in the query. Did you check the result only for the second part like the following and get the results you expected ? [CODE] $checkz=mysql_query("SELECT DISTINCT poster FROM postcomment WHERE ((postid='$po') and (poster !='$user'))");[/CODE] | |
Re: [CODE]<?php if (isset($_POST['next'])) { /* * In order to see how your posted data looks like, use the following statement. * print_r($_POST['porid']); */ /* * Type 1 * Say you have 20 checkboxes and you have selected only 8 out of them, then only these 8 checkbox values will be … | |
Re: Can you please quote for which particular case, the total goes wrong ? I tested by selected all the components with 1 quantity each and it gave me a correct total. | |
Re: When you have not selected any file then '$_FILES' will not have any values. So in the line.. [CODE]$file=time().$_FILES['file']['name'];[/CODE] the $file will only have the value returned by time() function, hence the above statement will be equivalent to [CODE]$file=time();[/CODE] Also please place your code within the [CODE][/CODE] tags. | |
Re: Can you please provide an example on what your input will be and the output expected from the function ? | |
| |
Re: The following will give you all the necessary details about the settings in php.ini [CODE]<?php phpinfo(); ?>[/CODE] To know more about register_globals go throught the following links [url]http://php.net/manual/en/ini.core.php[/url] [url]http://www.php.net/manual/en/security.globals.php[/url] The $$ syntax is nothing but variable variables in php. check out the following link [url]http://php.net/manual/en/language.variables.variable.php[/url] | |
Re: All you need to do is add a semicolon after the echo statement i guess... [CODE]<input name="rating" type="radio" value="1" <?php if ($rating==1) echo "checked";?>>1[/CODE] | |
Re: The reason you are getting a new file created for each contact is coz of [CODE] $ContactFile = fopen("Open\\" . $LastName . ".txt", "w");[/CODE] For every contact if the lastname is different then it creates a new file. So please hardcode the textfile name. Also if you want all the … | |
Re: You cannot send any output to the browser before using the header() function. So put all the html content and your echo statements in your code after the header() function. If you still want to use the browser output before the header(), then you need to do something like this.. … | |
Re: In order to do that, you need to call your mail script at some prescheduled time. That can be done by setting up a cron job. I hope the following links will help you out to setup a cron for your php mail script. [url]http://drupal.org/node/31506[/url] [url]http://adminschoice.com/crontab-quick-reference[/url] [url]http://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/[/url] | |
Re: I couldn't find any errors, try to put some alert messages in the function userChanged(); and check what output you are getting from xmlhttp.responsetext. | |
Re: [CODE]$update_query = "UPDATE leave SET CL = CL - $clv_days where ecode=$ecode";[/CODE] | |
Re: [CODE]$query = "select count(*) from tablename where category='PHP'";[/CODE] | |
Re: Say you want to write the include function in one.php which is in maindir/test/one.php . Suppose you want to include a file called two.php in maindir/someothertest/two.php . Then your one.php will be something like this.. [CODE]<?php include "../someothertest/two.php"; . . . ?>[/CODE] | |
Re: $sql = "SELECT * FROM `Users` WHERE `Username`='$Username' and `Password`='$Password'"; mysql_query($sql); $count = mysql_num_rows($result); In the above part you are missing the variable $result to recieve the resource returned by the mysql_query(). It should be .. $sql = "SELECT * FROM `Users` WHERE `Username`='$Username' and `Password`='$Password'"; $result = mysql_query($sql); $count … | |
Re: The auto suggestion can be done using AJAX. To learn ajax you can go through the tutorials [url]http://w3schools.com/ajax/default.asp[/url] | |
Re: Hmm can't see any errors. What is the PHP version you are using ? | |
Re: [CODE]<?php $arr = array("Zero","One","9884127128","98841254554","Four",array("Delimiter"),"9554565545","six",array("Delimiter"),"seven"); echo "<pre>"; print_r($arr); echo "</pre>"; foreach ($arr as $key => $value) { if (is_array($value)) { foreach ($value as $k => $v) { // echo $v."<br />"; } } else { echo $value."<br />"; } } ?> [/CODE] I hope this helps. | |
Re: You can use the function: func_num_args(); Go through the following links [url]http://www.php.net/manual/en/function.func-num-args.php[/url] [url]http://php.net/manual/en/function.func-get-args.php[/url] [url]http://www.php.net/manual/en/function.func-get-arg.php[/url] | |
Re: Try to do the following way: [CODE] $sql="SELECT * FROM course_participant WHERE name like '%".$searchname."%'"; //Select Query $result = mysql_query($sql); //execute the query and get the result if(mysql_num_rows($result) > 0) //If there is a result, display it { echo "The search results are:<br />"; while ($row = mysql_fetch_assoc($result)) { echo … | |
Re: You can replace the code in the first few lines of every page withing <?php...?> with the following set of codes one.php [CODE] <?php session_start(); if (!isset($_SESSION['phone']) && isset($_POST['txt_phone'])) { $_SESSION['phone'] = $_POST['txt_phone']; } ?>[/CODE] two.php [CODE] <?php session_start(); if (!isset($_SESSION['name']) && isset($_POST['txt_name'])) { $_SESSION['name'] = $_POST['txt_name']; } if (!isset($_SESSION['email']) … | |
Re: [QUOTE=brijendra1;1155459]how can open uploaded resume in php[/QUOTE] Hi brijendra1, Please start a new thread to post your questions. | |
Re: This is not the problem with upload. This is because of the permissions to access that directory or file. Go through the link below [url]http://www.daniweb.com/forums/thread60497.html[/url] You can also try to change the mode of the uploaded file using the php chmod() [CODE]chmod($upload_path,777);[/CODE] [url]http://php.net/manual/en/function.chmod.php[/url] | |
Re: Can you please give the DB table structures which you are using ? | |
Re: Please check which is the php version you are using. The goto operator is available as of PHP 5.3. ![]() | |
Re: Use it this way [CODE]$sql = "Select * from table1 where table1.field1 not like '%". $name%."' ";[/CODE] | |
Re: I think you can remove checkOK() for $name and $comments. Having a check for 'To' and the 'Headers' field of the mail() function may be sufficient enough. | |
Re: Once you have fetched the data from the database, check the length of the string using strlen() function and if that exceeds your desired length to show description in the front end, Split the string using chunk_split() function to the desired length and display that. [url]http://in3.php.net/manual/en/function.strlen.php[/url] [url]http://in3.php.net/manual/en/function.chunk-split.php[/url] | |
Re: This is what i read in php.net [url]http://www.php.net/manual/en/features.file-upload.post-method.php[/url] [QUOTE] $_FILES['userfile']['type'] The mime type of the file, if the browser provided this information. An example would be "image/gif". This mime type is however not checked on the PHP side and therefore don't take its value for granted.[/QUOTE] so in your condition … | |
The End.