373 Posted Topics
Re: [QUOTE=Millsy013;1038197][code=php]//create and issue the first query $add_topic_sql = "INSERT INTO forum_topics (topic_title, topic_create_time, topic_owner) VALUES ('$_POST[topic_title]',now(),'$_POST[topic_owner]')"; $add_topic_res = mysql_query($conn, $add_topic_sql) or die(mysql_error($conn)); //get the id of the last query $topic_id = mysql_insert_id($mysql);[/code][/QUOTE] You messed up with parameters of the mysql_query(), it should have been - [CODE]mysql_query($add_topic_sql, $conn)[/CODE] | |
Re: It seems that, its the code in sql.php which is working for it. You need to post that script here. | |
Re: If you upload the same script as it is to work on the server, it's supposed to throw errors. Look your few variable settings, you need to change them to the server values. [CODE]$host="localhost"; // Host name, should be actual db server name now, and not the localhost $username="root"; // … | |
Re: Don't just think about everything at the moment..!! Try to learn step by step. Start from the simple registration script first. try it here, if you search here too you will get some thread dedicated for writing the registration script. post here if you get any difficulties.we would love to … | |
Re: [QUOTE=rukshilag;1037778]what is the script to customise a login. for example if "abc" logs in to the website, how do i get it to display "Welcome abc", if "pqr" logs in "Welcome pqr" and so on... please help![/QUOTE] once the user logs in, save his username in the session variable. [code]session_start(); … | |
Re: @ez123 : Apart from above, there is one more mistake on the same line- [CODE]name=site[/CODE] should be like - [CODE]name="site"[/CODE] | |
Re: You can refer [URL="http://www.daniweb.com/forums/thread235903.html"]this thread[/URL].It has the same discussion. At the same time , its never advisable to store the entire file in the database. | |
Re: yes you can validate in php only, For example, validate against the blank field like - if($str ==''){ echo "You have not entered anything";} or you can use the regular expressions for checking the correct format of data like format of email id etc. and size exceeding more than 100 … | |
Re: Do what adatapost says above and use your improved code below - [CODE] <? if (isset($_POST[submit])) { foreach($uploadArray as $file) { //This is the directory where images will be saved $target = "orders/"; $target = $target . basename( $_FILES[$file]['name'] ); $arr_allowed_types = array("image/gif","image/jpg","image/jpeg","image/pjpeg"); if( in_array($_FILES[$file]["type"],$$arr_allowed_types) && $_FILES[$file]["size"] < 5000000) { … | |
Re: I assume you want to mail on click of this link, if so, execute the php script to send a mail using ajax on click of this link. | |
Re: yes you can always do that provided that the field name has unique constraint on it.Otherwise you will end up deleting more than one row with the same field name but different ids. Is this a duplicate thread you created. If in case, you forgot the one, after you created … | |
Re: try to code something like this - [CODE] function validate() { var truePassword = 'test'; var password = prompt('Enter the password',''); alert(">>"+password+">>"); if(password !='' && password !=null) { if(password != truePassword) { alert("You don't have download permissin for this"); } }else { alert("Enter the password"); } } [/CODE] | |
Re: you can search for any ready made spell checked available else where. You won't be able to do it alone with php unless you have a huge database of the words, against which you can check your spellings. ![]() | |
Re: maybe you not getting the current reference in this. Did you tried like below- [CODE]document.getElementById('elem_id').style.border-width = '1px'; [/CODE] | |
Re: web design is the right forum for this thread.You can transfer it there to get the quick response | |
Re: I guess, you trying to upload the user supplied files to the server. If am right , storing them on the server inside some folder and saving their file name & path in the database is the proper way to handle this scenario. Storing the entire file in database table … | |
Re: you can get the aspect ratio of the image and decrease the height and/or width accordingly to make it as thumbnail. you will get lots of threads for this topic [URL="http://www.daniweb.com/forums/thread204704.html"]like[/URL], [URL="http://www.daniweb.com/forums/thread159566.html"]one more[/URL] and [URL="http://www.daniweb.com/forums/thread117154.html"]this[/URL] | |
Re: [QUOTE=pushpakalpana;1036176]hello... i am doing shopping cart. in that there is billing address is there and shipping address is there. in there between "copy" link is there. when that page is loading "billing address fields comming and 'copy' link is also comming. but shipping address fields are not comming. after 'copy' … | |
Re: I think what you are looking for it, is .htaccess | |
Re: are you looking to backup the database for few table or columns? | |
Re: you can use PHP's FTP functions for that like ftp_put() | |
Re: refer this for learning [URL="http://w3schools.com/soap/soap_header.asp"]SOAP [/URL] | |
Re: better post your script here, we will modify it to solve the problem | |
Re: A barcode is a graphical representation of string. All barcode readers take this graphic SCAN and convert it into a String for the computer to understand.Most automatically input it into the computer as the string had been typed on the keyboard. Additionally, most scanners come with the default set to … | |
Re: [URL="http://php.net/manual/en/ref.simplexml.php"]simpleXML[/URL] is always the good choice when it comes to parsing the XML | |
Re: on click of the select element run the php file through ajax which will fetch the values from the db and will populate the select element. | |
Re: No its fine, if you are sure that there will be just single user for your script, then no need to use the database for any reason. You can simply store the user name & password in the script only(you can encrypt the password). For storing what comes from the … | |
Re: think of using - if (mysqli_num_rows($data) !=0 || mysqli_num_rows($data)!=FALSE) { } | |
Re: yes, using frameworks like joomla will save lots of coding in html, where you can get ready-made forms. Joomla is a content management system, where you will get the all types of controls used in the website, and just need to manage the data/content in it. | |
![]() | Re: describing your problem precisely and with short code, help to diagnose the problem quickly. your php tags never ends in above code, almost all the closing tags hide behind the comment. like - <?php echo "=>".$test; //this is comment ?> |
Re: Though there are lots of more comfortable tools than just notepad, like dreamweaver(which is smart enough to understand your html and syntax highlighting or syntax restructure features etc.) or more advanced than this like Zend, which has php code completion ability also.and can suggest php functions etc and lots more. … | |
Re: writing this in the hpptd.conf file will restrict those php files to parse. | |
Re: your syntax for the else is wrong, it should not have been square brackets there. your code below - [CODE] if(isset($_POST['log'])) { $username = $_POST['username']; $pass = $_POST['passd']; include("connectOrder.php"); $sql = "SELECT * FROM users WHERE user_name='$username' AND password = '$pass' AND access_level != 0"; mysql_query($sql); $num=mysql_num_rows($sql); if($num == 1) … | |
Re: post your code here, it might need some small improvement. | |
Re: one more thing, apart from above - $PK = $_POST["PK"]; you doing this thing twice which is not needed actually, just delete the line24 and it should work. | |
Re: No its not true, what error you get..? | |
Re: what you did seems to be right. why do you want it to be turned into foreach. foreach works for arrays only. | |
Re: here you will find the error log - "\wamp\bin\apache\Apache2.2.11\logs\error.txt" | |
Re: [CODE] $str1 = array('[gallery]','[enquiry]'); $str2 = "include('modules/gallery/index.php');"; str_replace($str1, $str2, $target); [/CODE] This will do the same for you, provided $target is the target string inside which you want to do the replacement. try to escape the '/' inside the string if it troubles | |
Re: check if the javascript is enabled in the browser in the Tools-> options -> content -> see if the checkbox saying enable javascript, is checked. | |
Re: try using 'id' attribute in the textfields.make sure your html page and another php file are in the same directory.if not make the proper file path changes in action. also this thing can be done in the same page, if you save the html page as .php and put your … | |
Re: the switch should have '{' opening brace and not the closing brace '}' . that's why there's that syntax error. | |
Re: if you want to allow access your website through secure http only, then putting this code in the htaccess will do that - [CODE] IndexIgnore * RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [/CODE] it will rewrite all your url from http to https also.though i haven't tested it … | |
Re: that can be done with the setting in your browser itself. check this - select Tools, then Internet Options from the menu at the top of the Internet Explorer window. The Internet Options window will appear. - Select Security from the list of tabs at the top of the Internet … | |
Re: Another idea, before uploading you can check , if the file with same name exists using file_exists() function and if another file found you can rename it using rename(). This way it will be possible what you are trying to do, but this is not the best way to do … | |
Re: probably you just need to code a simple script for registration which will insert into the mysql table using above query. Just create few html elements inside a form. and once you submit the form using submit button, process those values using $_POST['elem_name'] and your query there. | |
Re: The "allow_url_fopen" parameter in the php.ini enables the url-aware wrappers , just check if its 'TRUE' .. what code is on 78 inside home.php? |
The End.