1,741 Posted Topics
Re: just echo it. die is an alias of exit and once exit/die is encountered, the execution of the script stops there itself. You can print the error in this fashion ! [code=php] <?php if(isset($_POST['submit'])){ if(empty($_POST['name'])){ $error="Name field is empty !"; } else { //process the information } } ?> <html> … | |
Re: Say if the output is of 2 pages. Then how can you output everything in 1 page ? You can specify the width and height of the page, but if the output is more, I dont think you can avoid scroll. | |
Re: [quote]I actually wasn't even aware PHP could use that format for while loops[/quote] Yeah.. I wasn't aware too.. :) | |
Re: in validated.php page, print out the session variables. [icode]print_r($_SESSION); [/icode] | |
Re: Its expensive, but the features are good. Some features are Syntax highlighting,easy debugging, automatic end tag insertion, analysing the code, etc. | |
Re: What is this [icode]$expected = array('menuassignment'); [/icode] for ? Where are you using it ? What is the array you are trying to validate ? Could you explain your problem in detail ? | |
Re: Instead of [quote]$f = fopen($main_url,"r"); $inputStream = fread($f,65535); fclose($f); [/quote] use, [icode]$inputStream = implode("",file($main_url)); [/icode] The problem with your code was, it was reading only a part of the file. | |
Re: [QUOTE=joker40;546473]hey man untill now i am using the localhost , so i want to know if its possible to send an email from the localhost server (which is Apache server).[/QUOTE] You need to configure your apache to send mail. You need a valid smtp server to send a mail. You … | |
Re: umm.. Are you using php 5+ on apache 2.0+ ? By default, mysql service is disabled in php5. You need to add 2 lines in httpd.conf file in apache/conf. [icode]LoadModule php5_module php5apache2.dll AddType application/x-httpd-php .php [/icode] Open php.ini and uncomment mysql extension. Check the extension_dir folder in php.ini. Specify the … | |
Re: :) Welcome to Daniweb Amanda! | |
Re: Or, you have to make php parse the files with html extensions. Add [icode]AddType application/x-httpd-php .html[/icode] to your httpd.conf file of apache. It will parse html files as php. Cheers, Naveen | |
Re: Basically, SHA1, md5, password, encrypt, etc are the encrypting functions. If you encrypt a password field, your application will be more secure. That's all. | |
Re: Sorting non-alphabetical/non-numerical records is not possible AFAIK. But you can have one more field of type int in the table, eg, type. You can enter the order of title, then sort by type ! | |
Re: Try this. [code=php] <table width="1000" height="95" border="1"> <tr> <td bgcolor="#0000FF"> </td> </tr> </table> <?php include("connect.php"); //this is your validation in the form,put it here.... if (empty($_POST['name'])) { $errors[] = 'Please enter a name'; } if (empty($_POST['email'])) { $errors[] = 'Please enter a valid e-mail address'; } else if (!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$", $_POST['email'])) { … | |
Re: to loop ? Which loop ? Put the whole thing in whatever loop you want. [code=php] <?php for($i=0;$i<10;$i++){ if ($daybooked == 1){ print sprintf('<td align="center" bgcolor="%s"> %d </td>',$opts['today_color'],$day); } else{ print sprintf('<td align="center"><font color="#999999"> %d </font></td>',$day); } } //this will loop 10 times. .... ?> [/code] If thats not what you looking for, then … | |
Re: [code=php] <?php if(isset($_POST['team'])) { foreach($_POST['team'] as $value){ $insert=mysql_query("INSERT INTO team('team') VALUES ('$value')"); } } ?> <html> <body> <form method="post" action="chk123.php"> <input type="checkbox" name="team[]" value="AG"> Argentina <br /> <input type="checkbox" name="team[]" value="GE"> Germany <br /> <input type="checkbox" name="team[]" value="BR"> Brazil <br /> <input type="submit" name="submit" value="submit"> </form> </body> </html> [/code] There! … | |
Re: [quote]If memory serves me, that would not be a correct variable for mysql_num_rows.[/quote] Nope. [icode]$result=mysql_query($query) or die(mysql_error()); [/icode] will assign the resultset to $result if the query executes without any error. If it encounters any error, the script print the die statement and exit. When you call the function, instead … | |
Re: [code=php] $query="select * from table where date_column between date1 and date2"; [/code] | |
Re: Instead of sending him his username and password, why not send him a link pass_update.php followed by a string of encrypted key. For example, pass_update.php?secure=hash(email).hash(prev_password_field) When the user clicks on the link, check if hash of email and hash of previous_password is valid. If yes, then let him change his … | |
Re: As far as I can see, both are coming from the same query. [quote]SELECT a.strLodgeName, a.intLodgeNumber, a.strDistrictName, a.strLodgeWEB, a.strLodgeCounty, a.dtChartered, a.strLodgeMailingAddress, a.strLodgeMailingAddress2, a.strLodgeMailingCity, a.strLodgeMailingStateCode, a.strLodgeMailingPostCode, a.strLodgeEmail, a.strLodgePhone, a.strLodgeFax, a.strDrivingDirectons, a.dtMeetingTime, a.dtMealTime, a.strFloorSchool, a.strLodgeNews, b.strOfficerTitle, b.strFirstName, b.strLastName, b.BusinessPhone, b.PersEmail FROM tblLodges a LEFT JOIN tblOfficers b ON a.lngLodgeID = b.lngLodgeID WHERE … | |
Re: [quote]But I wasn't sure if anyone can learn php without programming knowledge because a friend of mine said one needs programming knowledge to proceed to php learning. Thanks for clearing my doubt.[/quote] Well, You should know the basics of any programming language, like, loops, conditions, etc. But php is VERY … | |
Re: Since 'naveen' was already taken and nav33n wasn't, I decided to 'take' it ! Btw, Naveen is my name. | |
Re: Welcome to Daniweb Jeff! Thats an interesting intro ! Umm.. Installing Borland C ? Read the first readme of [url=http://www.daniweb.com/forums/forum118.html] this [/url] forum. Cheers, Naveen | |
Re: uhmm..welcome to Daniweb djcolej.. But you have to post your question in respective forum ! | |
Re: Very simple. While redirecting, redirect with a value in the query string. And if that variable is set, display the error message. eg. [code=php] <?php //incorrect login header("location: login.php?err=1"); ?> [/code] And in login.php, [code=php] <?php if(isset($_GET['err'])){ $errormsg="Incorrect login.."; } //display $errormsg whereever you want, to indicate an invalid login. … | |
Re: [QUOTE=richie513;543247]Try taking the single quotes away from the zero in this line: if($english_level!='0') change to if($english_level!= 0) :)[/QUOTE] No. That ain't the reason for this error. !='0' works just the same like !=0, as in the following example. [code=php]<?php $english_level=0; if($english_level=='0'){ $query_array[]= "reg_english_level.english_level1 = '". $english_level . "' OR reg_english_level.english_level2 … | |
Re: pog generator ? umm.. Never heard that before.. What do you mean by save method ? Save what ? Could you post your code please ? | |
Re: Hi ! missing semicolon in these lines. [code=php] $msg=$user << here header ("Location:vote_page.php?$msg=$msg"); break; case "Jim": $msg=$user << here [/code] Cheers, Naveen Edit: Btw, this [icode]header ("Location:vote_page.php?$msg=$msg")[/icode] should be [icode]header ("Location:vote_page.php?msg=$msg")[/icode], if you want to use $msg value in vote_page.php ! | |
Re: url has slashes which should be stripped or escaped. Check [url=http://in2.php.net/addslashes]addslashes [/url]. | |
Hi, Dani! Are you changing the layout again ? In [url=http://www.daniweb.com/forums/thread109955.html] this [/url] particular thread, the border is acting weirdly and the menu on the right isn't visible(in IE) ! Here are the screenshots of IE and FF. Cheers, Naveen |
The End.