1,741 Posted Topics

Member Avatar for Designer_101

[code=php] if($variable) { //statements } [/code] This simply means, [i] if(true) [/i]. If a variable is set and if doesn't have values 0,false,'', it will execute corresponding statements. Example, [code=php] <?php $a = NULL; if($a) { echo "$a is true<br />"; } else { echo "$a is false<br />"; } …

Member Avatar for Designer_101
0
109
Member Avatar for gagan22
Member Avatar for nav33n
0
203
Member Avatar for AutoC

[QUOTE=kadimi;827098]As a beginner, I suggest you use the function "require" like this: [code=php](require "includes/common.php");[/code] Yes, require has a different syntax, to avoid future problems, always surround the hole statement with parenthesis.[/QUOTE] What future problems are you talking about ? Could you explain this a bit better ?

Member Avatar for kadimi
0
122
Member Avatar for serkan sendur

I haven't used tomcat, but for apache, its [url]http://localhost[/url] to access the root directory. You can find the config file httpd.conf in conf directory.

Member Avatar for nav33n
0
60
Member Avatar for serkan sendur

[QUOTE=serkan sendur;825894]by the way you usually save my ass adding to my reputation points, rashakil fool needs to wait a week to deduce your one contribution.[/QUOTE] Stop calling him Rashakil fool, maybe he will stop the 'war of words' too! ;)

Member Avatar for Ancient Dragon
1
668
Member Avatar for rjrasmussen

What is the error ? I am still confused about what you want and what is the problem. Do you mean something like this ? [code=php] <?php if(isset($_POST['submit'])) { $total = $_POST['field1']+$_POST['field2']+$_POST['field3']+$_POST['field4']; if($total % 4 == 0) { echo "$total Divisible by 4.."; } else { echo "$total Not divisible …

Member Avatar for nav33n
0
81
Member Avatar for nmakkena

Try[icode] or die(mysql_error()); [/icode] instead of your custom message. This will let you know what exactly is the error.

Member Avatar for nav33n
0
139
Member Avatar for bimaljr

[code=php] <?php $reg = '/<h2>(.*)<\/h2>/s'; $fulltext="<h1>Welcome</h1> <h2>Welcome to this website</h2> <p>Some text here. </p>"; preg_match($reg,$fulltext,$matches); print $matches[1]; ?> [/code] This will do.

Member Avatar for nav33n
0
142
Member Avatar for darkagn

Yeah! Use ad block plus (firefox addon) and block all the unwanted scripts/frames/images/ads/whatever! Life has been good since I started using ABP. :cool:

Member Avatar for nav33n
0
171
Member Avatar for achiman

if($_POST['list1']=='m2' && $_POST['list2']=='m3') { //show from table1 } elseif($_POST['list1']=='m3' && $_POST['list2']=='m2') { //show from table1 } else { //some other option was selected } Unless you have some logic to know what to do on selection of particular option, you have to build your script with alot of if's and …

Member Avatar for nav33n
0
92
Member Avatar for stevehart808

[QUOTE=stevehart808;826118]Maybe it got to do with [code] $date = $date15_year.'-'.$date15_month.' '.$date15_date; [/code][/QUOTE] No. That is just fine. Use print_r($_POST); to see what is getting posted and what is not.

Member Avatar for stevehart808
0
87
Member Avatar for tominic

@vinothkumarc, The OP fixed the problem himself using the function number_format. :)

Member Avatar for nav33n
0
87
Member Avatar for tashy

[code=php] <?php /** *.Hack Name: Shop Hack * Version: 3.0 Beta2 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, …

Member Avatar for nav33n
0
426
Member Avatar for HB25

The simplest way to validate username and password is to query the table with both username and password and see how many rows it returns. For example, [code=php] $query = "select * from table where username='$username' and password='$password'"; $result = mysql_query($query); if(mysql_num_rows($result) == 1) { //echo valid user } else …

Member Avatar for HB25
0
174
Member Avatar for Codethat

Most of the time (like 99% of the time), people tend to forget how important it is to sanitize the user's input. Using mysql_real_escape_string will prevent sql injections by escaping [b]'[/b] and [b]/[/b].

Member Avatar for nav33n
0
71
Member Avatar for santhanalakshmi

The simplest answer to your question is, No. Its not possible to disable 'back' button of the browser. As far your question is concerned, When the user logs in, you can set a session variable, say,[icode] $_SESSION['validuser'] = true; [/icode] And on every page, check if $_SESSION['validuser'] is true. If …

Member Avatar for serkan sendur
0
131
Member Avatar for chinmayu

[code=php] <input type='text' name='name' value=<?php echo $_REQUEST['name']; ?>> [/code] When the submit button is pressed and if the captcha is wrong, it will still show the posted values.

Member Avatar for chrishea
0
5K
Member Avatar for veledrom

Are you sure your query returns ASP developer/WEB developer/PHP when you use [icode]LIKE '%PHP developer%'[/icode] :S This, infact should return only "PHP developer".

Member Avatar for veledrom
0
213
Member Avatar for serkan sendur

My first post was in [url=http://daniweb.com/forums/thread98890.html] Community Introduction forum. [/url] :)

Member Avatar for Narue
0
309
Member Avatar for lllllIllIlllI
Member Avatar for claritydigital

Pretty simple. Check this example. [code=php] <?php if(isset($_POST['submit'])) { $string = nl2br($_POST['textarea']); echo $string."<br />"; echo substr_count($string, "<br />"); } ?> <html> <body> <form method='POST'> <textarea rows="30" cols="30" name='textarea'> </textarea> <input type="submit" name="submit" value="submit"> </form> </body> </html> [/code] I am using nl2br function to convert newline to <br />. Then …

Member Avatar for somedude3488
0
156
Member Avatar for kg_ally

> Before i propose any other solutions, did you try removing the `<b></b>` tags from this line: `<input type="checkbox" name="chkRecipeBook" id="chkRecipeBook" onclick="javascript<b></b>:disableAddressBook();" />` ? mschroeder, That is a bug with code-tags. I have even posted a thread for the same (`<b></b>`) [here](http://www.daniweb.com/forums/thread178010.html).

Member Avatar for mschroeder
0
133
Member Avatar for Designer_101

> Hi > > I seem to be getting this error on the reply section of my forum. I've never had this problem before and have tried google but found nothing. So, now i turn to daniweb, surly someone must be able to help me here. > > **This is …

Member Avatar for nav33n
0
620
Member Avatar for HelenLF

Without submitting the page, You can't get the selected option's value in php. However, in Javascript, you can access it.

Member Avatar for HelenLF
0
73
Member Avatar for rohnni

Use [icode] error_reporting(E_ALL ^ E_NOTICE); [/icode] on top of your script (after session_start).

Member Avatar for rohnni
0
146
Member Avatar for lifeworks

[quote]the submenu just stays out...[/quote] I tried your code and it works perfectly ! The only thing I changed was, [code=javascript]<script language="Javascript" type="text/javascript">[/code] which earlier was, [code=javascript] <script language="Javascript" type="javascript/text"> [/code] I haven't seen anyone using javascript/text :-/

Member Avatar for nav33n
0
253
Member Avatar for Rooking

Instead of having separate names for checkbox, use checkbox array and assign different values to it. When you click on the submit button, only those checkboxes which were checked would be posted. You can then use a foreach loop to get what was checked. [code=php] print_r($_POST['checkboxname']) //will print the array …

Member Avatar for nav33n
0
70
Member Avatar for cdeniz

[QUOTE=cdeniz;821610]i have a code like this [CODE]select * from tableX group by fieldA order by fieldB[/CODE] this code sort according to fieldA. but i need to sort according to fieldB. please help me ??[/QUOTE] You should have started a new thread. But anyway, Your query is fine and it [B]should …

Member Avatar for almostbob
0
99
Member Avatar for rariti

Instead of creating a comma separated string, why don't you use foreach loop ? You can get the key as well as the value. Use the 'key' as variable name!

Member Avatar for rariti
0
153
Member Avatar for rajeesh_rsn

[quote] Now I need to check whether the user must enter minimum 6 letters in the box. [/quote] Use [url=http://www.tizag.com/javascriptT/javascript-string-length.php] length [/url]. [code=javascript] if(form.username.length < 6) { alert('Username less than 6 characters..'); } [/code] Btw, I don't understand your code. What will with [icode] (contact) { [/icode] will do ?

Member Avatar for essential
0
91
Member Avatar for frank754

The way you are doing it is wrong. Try this. [code=php] $qa = mysql_query("SELECT DATE(DATE_SUB(now() , INTERVAL 31 DAY)) as actual_date"); while ($row = mysql_fetch_array($qa)) { $a = $row[actual_date]; } $qb = mysql_query("SELECT CURDATE();"); while ($row = mysql_fetch_array($qb)) { $b = $row[0]; } mysql_query("SELECT * from $vtable WHERE (trxdate >= …

Member Avatar for nav33n
0
163
Member Avatar for aashishn86

[code=html] <html> <head> <script type="text/javascript"> function validateCB(loctext) { if(document.rec.loc.value=='') { loctext.innerHTML = "please select one option"; return false; } else return true; } function validatePID(inputfield, helptext) { if(inputfield.value.length !=9){ if(helptext != null) helptext.innerHTML = "please enter excatly 9 digits"; return false; } else { if(helptext != null) helptext.innerHTML = ""; …

Member Avatar for nav33n
0
97
Member Avatar for MoDe52

What if 2 people (authors) have the same name ? :S Its never a good thing to query the table on fields like name. But anyway, you can do it this way (but I don't recommend it :) ) [code=php] $query = "select * from authors where name='".$author."'"; $result = …

Member Avatar for nav33n
0
93
Member Avatar for rEhSi_123

Here are my 2 cents. You can disable those notices by using [icode]error_reporting(E_ALL ^ E_NOTICE);[/icode] on top of your script. If you don't want to disable it but still want to fix the notices, initialize a variable to 0 (or null if its a string). ie., $i = 0; $string …

Member Avatar for rEhSi_123
0
354
Member Avatar for prawin@123

Edit your post. Use [code] tags to wrap your code for better readability (and better response).

Member Avatar for nav33n
0
161
Member Avatar for Aamit

In the script (the url), check if the user is a unique user (by checking his IP address). If he is a unique user, update count. :-/ You can't call a javascript event (onclick) to update the table. You can try the same with Ajax though. ie., Onclick, call the …

Member Avatar for nav33n
0
82
Member Avatar for kevin wood

@Kevin wood, Your script seems fine. Try this. [code=php] $query = "SELECT email FROM emails"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { $emailaddress[] = $row['email']; } // Contacts //$replyName = $merc_replyId; //$replyEmail = $merc_replyAddress; $i=0; foreach($emailaddress as $contactemail) { $replyName = "PiPonliine"; $replyEmail = "info@piponline.info"; $contactname = ""; …

Member Avatar for nav33n
0
1K
Member Avatar for NicAx64

[quote]My idea is also that , if we learn technology contribute it to , and even use it only for the good things ( not like to build mass killing machines ) only , then why the ppl hates a good person just for he is still single ?[/quote] Are …

Member Avatar for MosaicFuneral
0
289
Member Avatar for rohnni

[QUOTE=rohnni;819543]hii i m designing a php event based calendar this is my code, can anyone tell me its script code,mine is not working.. <!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=iso-8859-1" /> <title>Untitled Document</title> <link href="style/style.css" rel="stylesheet" type="text/css" /> </head> <body> <?php // …

Member Avatar for peter_budo
0
198
Member Avatar for xodus1

You cannot access $_POST['startdate'] in action2.php . Its only available in action.php since it is posted from form.php to action.php . In order to make it available in action2.php (which is a hyperlink), you have to pass it in the query string like this. [code=php] echo "<a href=action2.php?startdate=".$_POST['startdate'].">Click here to …

Member Avatar for xodus1
0
1K
Member Avatar for OmniX

If you use die function and if an error occurs and prints the die message, then its pretty obvious where exactly the error has occurred ! For runtime errors, php parser will only let you know where the error has occurred if you have error_reporting turned on.

Member Avatar for ahmksssv
0
117
Member Avatar for Andrieux

Someone posted a question in mysql forum which almost resembles this one! [url]http://www.daniweb.com/forums/thread179456.html[/url] Modify those queries and it should work for you!

Member Avatar for Andrieux
0
169
Member Avatar for happygeek

[QUOTE=RamyMahrous;811001]I prefer for each forum a man of forum each month, that's would be good idea[/QUOTE] I don't think that is a good idea! It would be a herculean task for the committee to find one person in every community every month (not that there aren't enough people, but there …

Member Avatar for jbennet
0
617
Member Avatar for OmniX

Apart from that, If you are sure that the 'input' is an integer, you can validate it using [url=http://in.php.net/manual/en/function.is-numeric.php] is_numeric [/url].

Member Avatar for OmniX
0
114
Member Avatar for gagan22

[b]*Repeats* [/b] Its not the 'invisible character' in your script that is causing this error. Its the permissions. Change the permission of the folder php-ses and tmp to 0766. Ie., Read, write and execute to the owner Read, write to groups and others. :) It will fix the problem. If …

Member Avatar for gagan22
0
2K
Member Avatar for OmniX

[url]http://in2.php.net/manual/en/ref.mysql.php[/url] Most of the functions which interacts with the database can have this $link_identifier as an optional parameter.

Member Avatar for nav33n
1
227
Member Avatar for OmniX

[quote]But im just wondering if I can do the same thing using headers header("Location: index.php?variable=1")[/quote] Yes you can. Then you can acess the 'variable' in index.php just like how you do it using $_GET['variable'].

Member Avatar for nav33n
0
107
Member Avatar for nav33n

Hello everyone! I am not sure if someone has already reported this bug, but here it is. An example: [code=javascript] <form method='post' onsubmit='javascript: validateform(this);'> [/code] When you click on "Toggle Plain Text", you can see < b >< /b > getting appended to javascript ! :-/ Some more example threads. …

Member Avatar for nav33n
0
222
Member Avatar for kevin wood
Member Avatar for nav33n
0
106
Member Avatar for deesudesu

Php is very easy to learn. You can start by going through these pages. [url]http://www.w3schools.com/php/php_intro.asp[/url] You can also find how php and mysql interacts on this link. [url]http://www.w3schools.com/php/php_mysql_intro.asp[/url] One suggestion. Saving images in the database is not a good idea. You can save the image on the server and save …

Member Avatar for Shanti C
0
109

The End.