1,741 Posted Topics
Re: [code=php] <?php // removal malicious script by forzadraco $filename="target.php"; $existfile=fopen($filename,"a+"); if($existfile){ echo "file berhasil dibaca \n\n"; }else{ echo "file gagal dibaca \n\n"; } if( false == ($str=file_get_contents( $filename ))) echo "Could not read file."; else echo "File contents: ".htmlspecialchars($str); $hsl=preg_replace("/xxxx/i","draco",$str); echo "<hr />".htmlspecialchars($hsl); fwrite($existfile,$hsl); fclose($existfile); ?> [/code] Check "mode" [url]http://in2.php.net/manual/en/function.fopen.php[/url] … | |
Re: Use nl2br function :) ex. [code=php] $message_with_breaks = nl2br($_POST['message']); [/code] | |
Re: You can do this in 2 ways. One, to store whatever the user enters in text box in a table and then get the records from the table and use it in drop down list. The second method, which is a temporary method, is to have a session array variable, … | |
Re: It would really help if you tell us what errors are you getting and also, by using code-tags to wrap your code. | |
Re: Column names which are mysql keywords have to be wrapped in [b]`[/b] or else, it would give the above error. date, status, from etc are all keywords. | |
Re: I would rather do something like this. [code=php] select * from table where column REGEXP "am.*.a" [/code] The regular expression will search the column for any value which starts with [b]am[/b] and ends with [b]a[/b]. I can't think of any other alternative solution! | |
Re: [QUOTE=serdas;796282]i get this error when i try to add the field [code]Error SQL query: ALTER TABLE `default_en_comments` ADD `comment_id` INT NOT NULL AUTO_INCREMENT FIRST MySQL said: #1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key [/code][/QUOTE] You should make … | |
Re: [QUOTE=EnetJohn;796506]hi......... help me plss to write coding to open a new pop up window while clicking on specific points on a map... regards enet[/QUOTE] This is called imagemapping. Check this out! [url]http://www.milonic.com/menusample4.php[/url] | |
Re: [code=mysql] Select * from suppliers group by supplier_TIN order by supplier_num desc; [/code] This will list all the records with least supplier_num .. | |
Re: [url=http://www.google.com/search?q=validate+a+form&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a]Google [/url] is your best friend. | |
Re: [code=php] <?php session_start(); $_SESSION['user']="test"; echo "<script type='text/javascript'>alert('".$_SESSION['user']."');</script>"; ?> [/code] Like this ? | |
Re: If you 'investigate' properly in phpmyadmin, there is an option exactly below the table's structure to add a new column. You can specify the columnname, its datatype and mention "auto_increment" under extra. :-) Its quite simple. [code=mysql] ALTER TABLE tablename ADD columnname INT NOT NULL AUTO_INCREMENT [/code] is the query … | |
Re: If you want to 'move' a column from one table to another table, both the tables should have a common column to link these 2 tables. First, as Vermadba has mentioned, you have to create a column called "id" in table_2 first. Then, update the second table's "id" column using … | |
Re: [code=php] // Check if session is not registered , redirect back to main page. // Put this code in first line of web page. <? session_start(); if(!session_is_registered(myusername)){ header("location:main_login.php"); } ?> <html> <body> Login Successful </body> </html> [/code] Do you have the comments outside the <? tag ? | |
Re: You just bumped into a 2+ yr old thread ! | |
Re: [quote]I do not know why it is, with all of the sites that talk about replacing a space with an underscore, none of them gave this, ever so simple answer. [/quote] What did you search for :P [quote]Maybe it just doesn't look as cool as all of that regular expression … | |
Re: Try this.. [code=php] <?php if(isset($_POST['submit'])){ if(!empty($_POST["name"]) && !empty($_POST["pass"]) && !empty($_POST["email"])) { $name=$_POST["name"]; $pass=$_POST["pass"]; $email=$_POST["email"]; $con=mysql_connect('localhost','root','password'); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("users"); $sql = "INSERT INTO members (username,password,email) VALUES ('$name','$pass','$email')"; $query = mysql_query($sql) or die('Error: ' . mysql_error()); echo "Inserted successfully !"; } else { echo … | |
Re: Umm.. Change “ ” to " ". Put data.txt in the same folder where you have the ajax script. I don't know much of ajax, but, the following code worked for me without any errors. [code] <html> <head> <title>Ajax at work</title> <script language = "javascript"> var XMLHttpRequestObject = false; if … | |
Re: Yep. See here, Kkeith29 has done something like that. [url]http://www.daniweb.com/forums/thread126462.html[/url] | |
Re: [quote]I guess, if its not very difficult to allow editing some posts forever, while keeping the 30 mins rule with all other posts, it should be done. [/quote] I think, that needs a lot of work and also not a good idea ! | |
Re: [url]http://www.webreference.com/js/tutorial1/opener.html[/url] Exactly what you are looking for! (Check the opener property example) | |
Re: Display the link only if the user is admin. Don't display the link for normal users. | |
Re: AFAIK, Its not possible. | |
Re: You are getting the listbox and the values but you can see it, because you don't have the value between <option></option>. Ie., [code=php] echo '<option value='.$myrow['$industrytype'].'>'.$myrow['$industrytype'].'</option>'; [/code] | |
Re: [QUOTE=TheNNS;653392]it's bullcrap. if you're gonna post something funny, make sure IT IS funny.[/QUOTE] [quote]lol.[/quote] [quote]i laughed so hard it took me five minutes to get through it!! Seriously funny to me[/quote] [quote] It's a very funny memo... [/quote] I think people found it funny :) | |
Re: [QUOTE=innovativeatul;482904]Many thnx for guiding. Now can u pls. tell me what field should i choose to get good amount of salary and also long time Option i have : Asp.Net or Php thnx,[/QUOTE] If we discuss salary here, I would definitely say that an asp.net programmer gets a LOT MORE … | |
Re: [quote]its pleasure to tell you guys that i've solved this problem. now i'm getting the table names from my sql database. [/quote] It would have been much more better if you had mentioned how you solved your problem. :) | |
Re: [QUOTE=osman85;660534]i changed the body accordingly. i am trying to get to info sent to my email and then have the page redirected to my paypal page. i get this message "Parse error: syntax error, unexpected '<' in /home/mysigninname/public_html/orderformprocess4.php on line 48" [code]<?php /* Subject and Email Variables */ $emailSubject = … | |
Re: [QUOTE=MidiMagic;590456]Here are mine: Watermarks in the reply box. Put that message OUTSIDE the box. It is maddening to the mildly dyslexic, because it makes the text impossible to read once it is typed. The reply box clearing when I navigate away to get something to paste in there. The insertion … | |
Re: Using [icode] set_time_limit(0) [/icode] in your script will make the maximum execution time to 'infinity'. This usually happens if you are processing large number of data or if one of the loop in your script has failed.. | |
Re: There are so many extra }. You need to post your complete code because this code doesnt make much sense. | |
Re: [code=php] <?php $reg = '/<td>(.*)<\/td>/s'; $sub = '<td><a class="page" title="myPage" href="/mypage/888"><img class="hotel" src="mypage.png" /></a></td>'; preg_match($reg,$sub,$matches); print htmlentities($matches[1]); ?> [/code] Cheers! ![]() | |
Re: There is nothing in $service_category. It is empty. Thats the reason. | |
Re: Use php's date function. [url]http://in2.php.net/date[/url] | |
Re: I didn't go through your code. But this is wrong. [quote] if ($membersprofiles[username]= $username) { $bank_balance = $bank[bank_balance]; } [/quote] You are comparing. so, you need ==. [code=php] if ($membersprofiles[username] == $username) { $bank_balance = $bank[bank_balance]; } [/code] | |
Re: Here is an example. [code=php] <?php $handle = fopen('somefile.csv', 'r'); if ($handle) { //the top line is the field names $fields = fgetcsv($handle, 4096, ','); //loop through one row at a time while (($data = fgetcsv($handle, 1000, ',')) !== FALSE) { $name=$data[0]; $address=$data[1]; print "somesite.com?id=".$name.$address; } fclose($handle); } ?> [/code] … | |
Re: [quote] $sql = "INSERT INTO `wkho_users`.`directory` (id, organisation, type, addr1, addr2, addr3, addr4, addr5, pcode, phone, fax, gen_email, other, person, position, ext, pers_email) VALUES ('','$org','$type', '$addr1','$addr2','$addr3','$addr4','$addr5','$pcode','$telno','$fax','$web','$notes', '$name','$title','$ext','$email'"; [/quote] Missing ) in the end. | |
Re: Since you are trying to use .png files, [icode] $im_src = imagecreatefromjpeg($source); [/icode] will not work. Because, imagecreatefromjpeg will work for jpeg files ! If you want to work with .png files , you should use [url=http://in2.php.net/manual/en/function.imagecreatefrompng.php] imagecreatefrompng [/url]. | |
Re: :-/ This script is working fine for me! I get mails with html tags. | |
Re: The names of your input are wrong. That is, [quote] <label> Movie Name: <input name=\"$moviename\" type=\"text\" value=\"$moviename\" size=\"31\" maxlength=\"30\" /> </label> [/quote] [icode] name=\"moviename\" [/icode] and not [icode] name=\"$moviename\" [/icode] Since the variables will be empty, the input tags name will be empty too. | |
Re: First of all, why do you have different name for checkboxes ? You can create a checkbox array by giving the same name for the checkboxes. Then, on page submit, only those checkboxes which were selected will be posted to the next page. I don't know what exactly your script … | |
Re: [QUOTE=saikishore;659889][code] <?php // we must never forget to start the session session_start(); $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = ''; $dbname = 'urdbname'; $errorMessage = ''; if (isset($_POST['txtUserId']) && isset($_POST['txtPassword'])) { $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mysql'); mysql_select_db($dbname); $userId = $_POST['txtUserId']; $password = $_POST['txtPassword']; // … | |
Re: What's the error ? Check if the path you have specified in copy is reachable. Also, there are some mistakes. Its always better to use $_FILES['img1']['tmp_name'] instead of $_FILES[img1][tmp_name]. Don't give a space between $_FILES['img1'] and ['tmp_name']. | |
Re: Because you are using mysql_fetch_row and trying to use the associated name. Use mysql_fetch_array instead. | |
Re: [QUOTE=Shanti Chepuru;658392]in first page: [code] <?php session_start(); $my="blue"; session_unregister("my"); session_register("my"); $_SESSION['my']=$my; echo "<a href='show_session_var.php'>Click here to go to next page</a>"; ?> [/code] in second page: [code] <?php session_start(); echo $_SESSION['my']; ?> [/code][/QUOTE] You don't have to register a session variable if you are using it. I mean, [icode] session_register("my") [/icode] … | |
Re: You can use [url=http://www.crossloop.com/] crossloop [/url] ! |
The End.