1,741 Posted Topics
Re: [code=php] $filename = "test123.jpg"; $file = substr($filename,0,strpos($filename,".")); echo $file; [/code] You can do it this way too. But the problem is, if there is a . in the filename itself, for example, test.123.jpg , then this will return only test and not test.123 . The function given by allexxei is, … | |
Re: [code=php] $tablename = "test"; $query = "create table ".$tablename." (name varchar(200) not null )"; mysql_query($query); [/code] Like this. | |
Re: Specify td width. [code=php] <tr> <td width=33%><?php include "1.html"; ?></td><td width=33%><?php include "2.html"; ?></td><td width=33%><?php include "3.html"; ?></td> </tr> [/code] | |
Re: [code=mysql] select SUBSTRING_INDEX(description," ",3) from table [where condition]; [/code] description = column name " " = delimiter 3 = count For example, if we apply the above query to the following text, [quote] This is an example of substring_index. [/quote] it returns, [quote]This is an [/quote] Umm.. Clear enough ? | |
Re: Umm.. wouldn't it be better if you post your question in Java forum ? | |
Re: Where are you assigning a value to $count, $delete and $checkbox ? If register globals are turned on(which is off by default), $checkbox and $delete will work. Does it even enter this condition ? [quote] for($i=0;$i<$count;$i++){ $del_userid = $checkbox[$i]; $sql = "DELETE FROM contacts WHERE userid='$del_userid'"; $res = mysql_query($sql); } … | |
Re: [QUOTE=sreein1986;635799]No... No ... I already sent some replies for solved threads please check once with your account[/QUOTE] Does that make any sense ? | |
Re: How do you want to save it in the table ? comma separated selected values in one row ? | |
Re: [quote] How do I use the calendar? The calendar functions in a way similar to the forums in that there can be multiple calendars. One calendar could hold just events that you are able to see, while another may list birthdays. There are two types of events on the calendar: … | |
Re: offtopic, But the font used in search box doesn't look too good. The font size is large. Please check the screenshot! | |
Re: [quote]$checkbox = $_POST['chkexpert']; $result = mysql_query("select * from register where checkbox =('$checkbox')");[/quote] You can't do it this way. $checkbox is an array and your query will not return any rows. You have to go through each element of the array (ie., $checkbox) and then use it in your query. And … | |
Re: Well, Your structure is good.. You can use month function to get the month. [code=mysql] select * from table where month(datecolumn)="06" [/code] If you want to narrow your search and get both year and month, [code=mysql] select * from table where year(datecolumn)="2008" and month(datecolumn)="06"; [/code] And, date is a keyword. … | |
Re: `mysql_close($link)` before the update query. Btw, You don't have a condition for your update query. This will update all the records in the table and set jobtite to the value that you have entered. P.S. Next time, please wrap your codes within code-tags. | |
Re: I don't understand what you mean by your title.. :) Can you be more specific ? | |
Re: There is something wrong with this url. [quote] [url]http://www.365netmarketing.co.uk/adds/banner.php?action=b&t=true&ref=20&w=468&h=60&grp=13[/url][/quote] It seems like you have a loop which never ends! And, you can have html in a php file. [code=html] <html> <body> Test </body> </html> [/code] You can call that test.php .. So, I think the problem is with your php … | |
Re: [quote] and I need to pass the variable "1stOtherStuff" (which is an element in an array) to a PHP script, how do I do that? [/quote] Have an onchange event for select tag. Submit the page in onchange event. When the form is submitted, you can access the value of … | |
Re: I guess the error has something to do with the script browsercheck.php because I don't see anything strange on line 49 of this script. | |
Re: As Luckychap has mentioned, validations should be done in the function formCheck. If you have an action specified (eg. action="test.php"), it will then go to the test.php if formCheck returns true. If the function returns false, it will remain in the same page. | |
Re: Php has a default upload size of 2mb. You need to change your php.ini file to increase it. This might be of some help! [url]http://us3.php.net/manual/en/ini.core.php#ini.post-max-size[/url] [url]http://us3.php.net/manual/en/ini.core.php#ini.upload-max-filesize[/url] and [url]http://us3.php.net/features.file-upload[/url] | |
Re: [code=html] <html> <head> <script type="text/javascript"> function showmsg() { alert("welcome!"); } </script> </head> <body> <input type="image" src="calendar.jpg" onclick="javascript: showmsg();" /> </body> </html> [/code] Like this.. | |
Re: And, mysql_fetch_row returns numeric indexes. Use, mysql_fetch_array or mysql_fetch_assoc instead. P.S: Plz make it fast isn't the right way to post a thread in the forum :) | |
Re: Remove @ before mysql_query. Use die(mysql_error()); ie., [icode] mysql_query($sql) or die (mysql_error()); [/icode] | |
Re: What is the error ? $pimage is null ! If you want the image name to be inserted to the table, you should insert $_FILES['pictureFile']['name']. | |
Re: Everything about php [url=http://en.wikipedia.org/wiki/PHP] here [/url] and also [url=http://php.net/] here [/url]. | |
Re: Read [url]http://in2.php.net/types.string[/url] You have to either escape " or use '. Eg. [icode] echo "this will "throw" an error"; [/icode] The above sentence will cause an error. When it encounters " before throw, it will consider it the end of the statement. So, instead, you can use, [icode] echo "this … | |
Re: 1. What if $result3 returns more than 1 row ? It will never enter the condition [icode] elseif(mysql_num_rows($result3) == 1) [/icode] 2. $bw = $_GET['id']; and $id is empty. | |
Re: [quote]$result=mysql_query("SELECT * FROM artists_details, attendance WHERE ethnicity='maori' AND date='record_id' BETWEEN 'date1' AND 'date2'");[/quote] The query is wrong. Try this. [code=php] $result=mysql_query("SELECT * FROM artists_details, attendance WHERE ethnicity='maori' AND date='record_id' and date BETWEEN 'date1' AND 'date2'"); [/code] You have to specify which column to check while using 'between' clause. | |
Re: Few questions.. 1. Why are you using sessions before authenticating the user ? 2. Why are you having 2 different queries for checking a valid user ? 3. order by user_name ? You don't need that actually ! And mysql_fetch_array's syntax is mysql_fetch_array(result, result_type); result_type = MYSQL_ASSOC or MYSQL_NUM. [quote]$_SESSION['authuser1']==1; … | |
Re: What exactly do you want ? How is the value stored in the database and how do you want to split it ? | |
Re: I don't know about C program, but, I wrote a simple java program and it worked. This is how I did. [code=php] <?php if(isset($_POST['submit'])) { $filename = $_POST['filename']; //user will enter the filename with .java extension $program=stripslashes($_POST['program']); // java program $fp = fopen($filename,"w+"); //open the file and write the program … | |
Re: You can also use <pre> tag. [url]http://www.w3schools.com/TAGS/tag_pre.asp[/url] [code=php] <?php mysql_connect("localhost","root"); mysql_select_db("test"); if(isset($_POST['submit'])) { mysql_query("insert into tst (name) values ('".$_POST['tarea']."')"); } ?> <html> <body> <form method="post"> <textarea name="tarea" cols="30" rows="20"></textarea> <input type='submit' name="submit" value="submit"> </form> </body> </html> <?php $q = "select * from tst"; $r = mysql_query($q); if(mysql_num_rows($r) > 0 ) … | |
Re: For "quick learning" you can start [url=http://w3schools.com/php/default.asp] here [/url]. For php reference guide and detailed php functions description, you can check php.net ( [url]http://www.php.net/manual/en/[/url] ) | |
Re: But is there a way to avoid the confirm dialog box in IE while using window.close ? And, window.close doesn't work in FF :-/ | |
Re: [url]http://www.walterzorn.com/tooltip/tooltip_e.htm[/url] | |
Re: [code=php] <?php $subject = "PHP Hypertext Preprocessor"; $pattern = '/xt/'; preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE); print "<pre>"; print_r($matches); print "</pre>"; ?> [/code] $matches[1] returns 11. [url]http://in2.php.net/manual/en/function.preg-match.php[/url] It works but I didn't understand the concept of flags ! | |
Re: I think [quote]foreach ($result as $entry) { [/quote] $result is null or doesn't return an array. | |
Re: [code=php] <?php $a = 1; $b = 2; $c = 3; $alpha = $a." ".$b." ".$c; echo $alpha; //prints 1 2 3 echo "<br />"; list($a1,$b1,$c1) = explode (" ",$alpha); echo $a1; //prints 1 echo $b1; //prints 2 echo $c1; //prints 3 ?> [/code] . is the concatenation operator not … | |
Re: [code=html] <html> <body> <form method="post" name="test"> Name : <input type="text" name="name" /><br /> <input type="submit" name="submit" value="submit" /> <input type="button" name="button" value="Reset" onclick="javascript: document.test.reset();" /> </form> </body> </html> [/code] Reset works fine this way! | |
Re: And also, there is no guarantee that the active members of a forum knows everything. | |
Re: Hi there! I haven't heard of bouncy castle light weight cryptography, but php has many encryption techniques. There is [url=http://in.php.net/manual/en/function.base64-encode.php] base64_encode [/url] and [url=http://in.php.net/manual/en/function.base64-decode.php] base64_decode [/url]. You can also use [url=http://in.php.net/manual/en/function.sha1.php] sha1 [/url] or [url=http://in.php.net/manual/en/function.md5.php] md5[/url] encryption. Remember! php.net is your php bible :) | |
Re: Select "I approve" to the respective post (and write some comments if you want to) and click on "Add to reputation". | |
Is there a way to know the members you referred to Daniweb ? ( I don't remember referring anyone to Daniweb but I have Member Referrals: 1 ) :-/ How is that ? | |
Re: Why not decide what value to choose after you submit the page ? Check this for example. [code=php] <?php if(isset($_POST['submit1'])) { print $_REQUEST['firstname']; } if(isset($_POST['submit2'])) { print $_REQUEST['lastname']; } ?> <html> <head> <SCRIPT language="JavaScript"> function decide_action() { x = document.pressed if (x == "First") { myname =document.forms['frm1'].elements['firstname'].value; document.frm1.action ="test.php"; } … | |
Re: Umm.. [code=php] if($row['col1'] == "2008") { //print } //else do nothing [/code] If the record in the table has more than 2008, for example, some text with it, you can try it this way. [code=php] <?php $str = "test - 2008 is as boring as 2007"; if(strstr($str,"2008")) { echo "2008 … | |
Re: I don't know if this is an answer to your question, but you can get the contents of the third party url and use it in your script! [icode] <a href="list.php">Click here to see the list </a> [/icode] [code=php] //list.php <?php $contents = file('http://www.quickonlinetips.com/archives/2005/02/secrets-of-domain-masking-how-it-works-for-you/'); foreach ($contents as $data) { echo … | |
Re: Try this. [code=php] $link = "<a href=reset-password.php?ui=".$row['user_id']."&ak=".$upassword.">Reset the Password </a>"; [/code] and $update-password is not a valid variable name. You can't use -. More about it here. [url]http://in.php.net/language.variables[/url] So, your update query should be like this. [code=php] $update_password = mysql_query("update tbl_auth_user set user_password ='$upassword' where user_id = '".$row['user_id']."'") or die("Password … |
The End.