1,741 Posted Topics
Re: shade out ? You mean read only ? <input type="text" name="id" readonly> | |
Re: [url]http://w3schools.com/php/php_mysql_insert.asp[/url] Check out the example. I think this is what you are looking for! | |
Re: Everything is fine in the above posted code. The only line which gave me an error was this line. [icode]$ext = $this->getExtension($img_name);[/icode] Remove $this and everything will work great ! | |
Re: There is something wrong with your query. Print out your query (print $sql ) and tell us what does it print. | |
Re: Well, these people have already told you which one is better and why. Here are my 2 cents. The maintenance of a php site is much cheaper than a asp.net site. (1st advantage for your client). The web hosting is also cheaper for php when compared to asp.net (2nd advantage … | |
Re: [code=php] if(empty($_REQUEST['hiddenfieldname'])) { echo "Blah"; } else { echo $_REQUEST['hiddenfieldname']; } [/code] Like this ? | |
Re: [url]http://www.tizag.com/phpT/fileupload.php[/url] If you notice, $target_path is the path where the image is being uploaded. Save $target_path in the database :) Btw, If you search Daniweb, you will find plenty of threads on the same question ! | |
Re: Mark inappropriate threads (like this one) as "Bad post". Moderators will take care of these ad guys! ;) | |
Re: I totally agree with Kkeith29. Having different tables for each movie is not a good idea. If you plan to implement something, for example, a "database search" for a movie name, would you go through each and every table ? Anyway, If you want all the tables in the database, … | |
Re: If you observe your query in any good editor, you will see the 'missing' factor. The last variable '$manufacture of' is causing the error. A variable name cannot have a white space. For example, [b]$variable name[/b] is NOT a valid variable name. It should be [b]$variablename[/b]. Thats the error. | |
Re: Your mail function is perfectly fine. Does it give you any error other than "Failure" ? Umm..have you disabled error reporting ? Have you set sendmail path in php.ini ? usually, [icode] /usr/sbin/sendmail [/icode] is the path for sendmail. | |
Re: If you want to add numbers, try [icode]total = parseInt(form1.balance.value) + parseInt(form1.buy.value); [/icode] | |
Re: LAMP is nothing but Linux Apache Mysql Php. WAMP is a windows package which has preconfigured apache, mysql and php. You just have to install Wamp on a computer with Windows OS. | |
Re: Try giving the session a name.. [url]http://nl3.php.net/manual/en/function.session-name.php[/url] | |
Re: I am not sure if its possible in Php. But its definitely possible in javascript. [code=javascript] <html> <head> <script type="text/javascript"> function getformname(form) { alert(form.name); return false; } </script> </head> <body> <form name="test" action="test.php" method="post" onsubmit="javascript: return getformname(this);"> <input type="submit" name="submit" value="submit"> </form> </body> </html> [/code] Cheers, Nav | |
Re: [quote]Sanitizing user input means stripping the posted data from anything that may be malicious[/quote] You can use [url=http://nl3.php.net/mysql_real_escape_string]mysql_real_escape_string [/url] for the user input or [url=http://nl3.php.net/manual/en/function.addslashes.php]addslashes. [/url] | |
Re: Well, when you submit the form, only the selected checkboxes will be posted to the next page. You can see what values are being posted by using [icode] print_r($_POST['checkboxname'] [/icode] You can loop through $_POST['checkboxname'] (since that will be an array of checked values) and display the data however you … | |
Re: Oh, You can access the values as [icode]$value = $_GET['variablename'] [/icode] Don't forget to sanitize the user's input by using mysql_real_escape_string or addslashes. | |
Re: Thats because of the first line of your code. The javascript redirection. Everytime you open the page, it will see if the session variable is set. Obviously, it will be empty. So it keeps redirecting :) | |
Re: [icode] $variable = $_POST['form_variable_name']; [/icode] More about it here. [url]http://w3schools.com/php/php_post.asp[/url] You should sanitize user's input by using [url=http://nl3.php.net/mysql_real_escape_string] mysql_real_escape_string [/url] or [url=http://nl3.php.net/manual/en/function.addslashes.php] addslashes [/url]. | |
Re: Umm.. No.. mysql_query returns different values for different queries. I just tested and I found out, for a query which doesn't return any resultset, like, update or delete,returns just true. But for a select query, it returns a result (resource id). | |
Re: Hmm.. I am not sure if your site is hacked.. But when that javascript was 'decoded', it gave me the url, [url]http://www.wp-stats-php.info/[/url] . The complete URL was [quote] <iframe src=http://www.wp-stats-php.info/iframe/wp-stats.php width=1 height=1 frameborder=0> [/quote] Umm.. Have you seen this iframe before ? I have never been in this position before, … | |
Re: You can set a cron job to run on the 1st day of every month (or the last day of every month) and execute the required script to generate the report. | |
Re: I haven't used PDO classes. But maybe a "return" in the connect function will do the trick ? [code=php] public function connect() { $pdoConnect = new PDO($this->dsn, $this->username, $this->password); return $this->connection = $pdoConnect; } [/code] | |
Re: Here is the idea. Pass the id of the image in the query string. [icode] <a href='deleteimage.php?id=4'>Delete now </a> [/icode] Then, in deleteimage.php, get the id, and delete the image. [code=php] //connection $id = mysql_real_escape_string($_GET['id']); $q = "delete from table where imageid = '$id'"; // if you are storing the … | |
Re: [code=mysql] update table set number=number+300 where condition; [/code] You mean like this ? Edit: Or are you talking about concatenation ? [code=mysql] update table SET number = concat( number, "00" ) WHERE condition; //this will concat 00 to the value in number field for that condition [/code] | |
Re: Your script looks good. But are you sure you have a varchar field in the table called user_password with length greater than 16 characters ? Thats the only thing that I can think of. [url]http://dev.mysql.com/doc/refman/5.0/en/password-hashing.html[/url] | |
Re: Doesn't this work ? [code=php] <?php $merc_list = explode(",",$merc_mailingList); for($i=0; $i<count($merc_list); $i++) { if($i <=200) { //send mail } else { //you can't send any more mails today } } echo "200 out of ".count($merc_list)." mails have been sent today !"; ?> [/code] | |
Re: You can do this. [icode]<input type="text" name="firstname" value="<?php echo $_POST['firstname']; >?"> [/icode] | |
Re: > Hi > > I would like to put a list of ids in an array > and loop to select data from a table using > "IN" in the where clause. > > I am not having any success getting this to work. > Any suggestions? > > > … | |
Re: Instead of echo, assign the value to a variable and insert it to the table. | |
Re: You can make use of max function to get the maximum value. [url]http://nl3.php.net/max[/url] This would be easy if you store the scores in an array and use max to get the maximum value. | |
Re: <offtopic> Cscgal, everytime I see your profile, I see different "solved threads" count ! Sometimes its 109, sometimes 110 and now its 108 ! :-/ how and why ? </offtopic> | |
Re: Umm.. just curious.. Are you trying sql injection ? | |
Re: You bumped into a 2.5 yr old thread :) ! | |
Re: [url]http://www.w3schools.com/PHP/php_mysql_intro.asp[/url] That should help! :) | |
Re: This works perfectly fine for me. [code=php] <?php $list = array("ID,Category,Description"); $file = fopen("./csv/DS20080507.csv","a+", 1000); foreach ($list as $line) { fputcsv($file,split(',',$line)); } fclose($file); $row = 1; $handle = fopen("./csv/DS20080507.csv", "a+"); for($i=1;$i<10;$i++) { fwrite($handle,"test1,\t test2, \t test3 \t\n"); } fclose($handle); $handle = fopen("./csv/DS20080507.csv", "r+"); while (($data = fgetcsv($handle, 1000, ",")) !== … | |
Re: I haven't done anything of this kind before. How bout storing the users comments in a table ? The blogger can decide what to publish and what to delete just by the click of a button ? After all, you need a table to store the comments. You can have … | |
Re: If only admin's details are stored in admin table, then you don't need to change anything. But if the table is used for all the users, then for relevancy, you can have your table name as users. Why not make id of contacts table a foreign key ? So, for … | |
Re: Try this. [code=php] //php.class.php <?php class page { var $title; var $keywords; var $content; function display() { $x="<html>\n<head>"; $x.=$this->displaykeywords(); $x.=$this->displaytitle(); $x.="</head>\n<body>"; $x.=$this->content; $x.='</body>'; $x.='</html>'; return $x; } function displaytitle() { echo '<title>' . $this->title . "</title>\n"; } function displaykeywords() { echo '<meta name="keywords" content="' . $this->title . '">'; } function … | |
Re: Print the query and execute it in mysql console/phpmyadmin. There is something wrong with your query. Please use code tags next time, as it will be easy for us to go through your code. | |
Re: You need to store the values in a table when someone votes. In that way, a user can vote only once. Displaying the result in % can be done by simple math calculation. I haven't worked with images, so, I am not very sure about graphs. | |
Re: Did you try [code=php] if(empty($_POST['imgfile'])) { //nothing posted } else { //image has been uploaded, proceed with the next step } [/code] | |
Re: [code=php] <?php echo "hi"; ob_flush(); flush(); exec("taskmgr.exe"); ?> [/code] This works ! | |
Re: You can start from [url=http://w3schools.com/php/default.asp] here [/url]. For username and password check, you can use a where clause and it works this way. [url]http://w3schools.com/php/php_mysql_where.asp[/url] | |
Re: [url]http://nl2.php.net/language.variables.variable[/url] I don't prefer using this because its too difficult to keep track of what is in $var. If something goes wrong in the script, for example, $var is empty, then that will cause a total failure. | |
Re: Here are some things you need to fix. You are checking if $_GET['id'] is set. Say, for example, the user follows a link and gets to this page. comments.php?id=4 . Then it will enter the condition isset($_GET['id']) and does the required action. But, when the user fills in the comment … |
The End.