1,741 Posted Topics

Member Avatar for MDGM

[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, …

Member Avatar for MDGM
0
102
Member Avatar for MDGM

[code=php] $tablename = "test"; $query = "create table ".$tablename." (name varchar(200) not null )"; mysql_query($query); [/code] Like this.

Member Avatar for MDGM
3
3K
Member Avatar for ishlux

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]

Member Avatar for GGAB
0
328
Member Avatar for antwan1986

[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 ?

Member Avatar for nav33n
0
2K
Member Avatar for chicago1985

Umm.. wouldn't it be better if you post your question in Java forum ?

Member Avatar for nav33n
0
113
Member Avatar for chocciies

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); } …

Member Avatar for nav33n
0
91
Member Avatar for sreein1986

[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 ?

Member Avatar for Ancient Dragon
0
141
Member Avatar for Serunson
Member Avatar for yournamehere

How do you want to save it in the table ? comma separated selected values in one row ?

Member Avatar for nav33n
0
210
Member Avatar for sreein1986

[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: …

Member Avatar for nav33n
-1
130
Member Avatar for Dani

offtopic, But the font used in search box doesn't look too good. The font size is large. Please check the screenshot!

Member Avatar for linux
0
113
Member Avatar for a4tech

[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 …

Member Avatar for R0bb0b
0
104
Member Avatar for antwan1986

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. …

Member Avatar for ferminselvin
0
114
Member Avatar for psathish2

`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.

Member Avatar for nav33n
0
181
Member Avatar for psathish2
Member Avatar for nav33n
0
2K
Member Avatar for 365resell

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 …

Member Avatar for 365resell
0
3K
Member Avatar for mgt

[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 …

Member Avatar for ~s.o.s~
0
3K
Member Avatar for mustafaneguib

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.

Member Avatar for nav33n
0
121
Member Avatar for trouble706

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.

Member Avatar for mgt
0
120
Member Avatar for maydhyam

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]

Member Avatar for maydhyam
0
397
Member Avatar for heels

[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..

Member Avatar for heels
0
77
Member Avatar for psathish2

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 :)

Member Avatar for nav33n
0
82
Member Avatar for s_susanta
Member Avatar for prabhatrahul

Remove @ before mysql_query. Use die(mysql_error()); ie., [icode] mysql_query($sql) or die (mysql_error()); [/icode]

Member Avatar for nav33n
0
110
Member Avatar for wandie

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'].

Member Avatar for nav33n
0
255
Member Avatar for allena

Everything about php [url=http://en.wikipedia.org/wiki/PHP] here [/url] and also [url=http://php.net/] here [/url].

Member Avatar for harinatt
0
78
Member Avatar for psathish2

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 …

Member Avatar for nav33n
0
104
Member Avatar for bww

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.

Member Avatar for nav33n
0
92
Member Avatar for harrence

[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.

Member Avatar for harrence
0
98
Member Avatar for mustafaneguib

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; …

Member Avatar for nav33n
0
111
Member Avatar for kvdd

What exactly do you want ? How is the value stored in the database and how do you want to split it ?

Member Avatar for kvdd
0
1K
Member Avatar for gyanu

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 …

Member Avatar for nav33n
0
88
Member Avatar for joshmo
Member Avatar for michael123

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 ) …

Member Avatar for nav33n
0
143
Member Avatar for sreein1986

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] )

Member Avatar for servis
0
104
Member Avatar for soosai
Re: exit

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 :-/

Member Avatar for R0bb0b
0
100
Member Avatar for harinatt
Member Avatar for isomillennium

[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 !

Member Avatar for nav33n
0
132
Member Avatar for blufab

I think [quote]foreach ($result as $entry) { [/quote] $result is null or doesn't return an array.

Member Avatar for R0bb0b
0
79
Member Avatar for OmniX

[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 …

Member Avatar for R0bb0b
0
204
Member Avatar for soosai
Member Avatar for soosai

[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!

Member Avatar for soosai
0
69
Member Avatar for Jishnu

And also, there is no guarantee that the active members of a forum knows everything.

Member Avatar for Jishnu
0
375
Member Avatar for boomar

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 :)

Member Avatar for pritaeas
0
447
Member Avatar for tuse

Select "I approve" to the respective post (and write some comments if you want to) and click on "Add to reputation".

Member Avatar for Dani
0
121
Member Avatar for nav33n

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 ?

Member Avatar for nav33n
0
59
Member Avatar for gcarterm

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"; } …

Member Avatar for gcarterm
0
139
Member Avatar for OmniX

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 …

Member Avatar for R0bb0b
0
175
Member Avatar for successws

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 …

Member Avatar for R0bb0b
0
130
Member Avatar for servis

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 …

Member Avatar for nav33n
0
78

The End.