708 Posted Topics
Re: Here is an upload example I created a day or two ago. It needs to be modified a bit, but you get the basic idea. Its pretty secure, making it so people can't upload scripts to the server and run them. [url]http://www.daniweb.com/forums/post905365-3.html[/url] | |
Re: good job for the most part. you need to work on your form validation though. i clicked submit on the register page, and it made a blank account. then i went to the login page and just pressed the login button and i got into your system. you need to … | |
Re: i would use the onsubmit attribute in the form tag for this. [code] <form action="something.html" method="post" onsubmit="return confirm('Are you sure?')"> <input type="submit" name="submit" value="Submit" /> </form> [/code] | |
Re: MVC is different from 3-tier from what I have read. MVC uses a triangle type layout where 3-tier is linear (I put this in his other thread, don't see why this one was created). | |
Re: I really hate trying to rewrite urls. I found using a basic rewrite and having php parse the url is much easier. I use a url class that parse the url. This makes it so you can change the rewrite via php and not have to edit .htaccess. Dynamically I … | |
Re: add a unique index to the database table. it won't let it happen. ![]() | |
Re: why?!?!? reduce the footprint? what does that mean. I anything I have coded, I have never needed to do this, I can't even think of a reason to. btw, I don't think its possible | |
Re: so pretty much you want to take the insertion uid and use it in the second table. something like this maybe. [code] $sql = "SQL HERE"; $query = mysql_query( $sql,$con ); if ( $query ) { $iid = mysql_insert_id( $con ); $sql = "SQL HERE WITH {$iid}"; $query = mysql_query( … | |
Re: Ardav, can you elaborate on why they should use a formhandler page? I have seen you say this twice now, any reason why? ![]() | |
Re: do you have a mailing list setup that someone can unsubscribe from. if not, i recommend using [url]www.mailing-manager.com[/url]. they will have everything you need. i have a class to export mysql database to excel file. i have a working example if you need one. | |
Hello, I have been working on a php/xml/ajax chat program which requires no database for the last few days and was wondering if anyone could test it out for me. It has a few bugs that I would love to have someone help me fix (I am running out of … | |
Re: Try this: [code] <html> <form method="post" action="test.php"> User Name : <input name="UserName" type="text" id="UserName" value="User Name" size="20" maxlength="30" /> <input type="submit" name="submit" value="Submit"> </form> </html> <?php if (isset($_POST['submit'])) { mysql_connect("Localhost","username","password") or die("Failure to communicate"); mysql_select_db("mydb") or die("Could not connect to Database"); if ($_REQUEST['UserName'] == NULL) { echo "Please Enter a … | |
Re: I would say this is one of those problems that can't be solved with one query. Couldn't you just select the first id: [code=sql] SELECT `id` FROM `bible` WHERE `book` = 1 AND `chapter` = 1 AND `verse` = 1 LIMIT 1 [/code] and the second: [code=sql] SELECT `id` FROM … | |
Re: Can you post the rest of code so we can see what is going on? From what you gave, I can't get you a definitive answer. Also, mysql_numrows() is depreciated. Use mysql_num_rows() instead. | |
Re: You can just do a query to get the number of moons for a planet. Ex. [code=sql] SELECT COUNT(*) FROM `moons` WHERE `regularplanet_id` = 1 [/code] Looping through them would be cumbersome. I would just use a subquery to get the number of moons in one query. I can't help … | |
Re: Here is a function I found in about 1 minute of searching. [code] function url_exists($url) { // Version 4.x supported $handle = curl_init($url); if (false === $handle) { return false; } curl_setopt($handle, CURLOPT_HEADER, false); curl_setopt($handle, CURLOPT_FAILONERROR, true); // this works curl_setopt($handle, CURLOPT_HTTPHEADER, Array("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; … | |
Re: Won't happen. Search engines won't fill out your form. I would suggest a tag cloud that search engines can index. This would work in the same manner as what you are wanting. | |
Re: For this you just need to store the data in another array. Ex. [code=php] $mysqli = new mysqli('localhost','root','','test'); $sql = "SELECT * FROM food"; $results = array(); if ( $result = $mysqli->query($sql) ) { while( $row = $result->fetch_object() ) { $results[] = $row; } } $result->close(); echo "Please Select a … | |
![]() | |
![]() | Re: What data type of data are you collecting in these forms? ![]() |
Re: Here is one I wrote a long time ago. [url]http://www.daniweb.com/forums/post832028.html#post832028[/url] and [url]http://www.daniweb.com/forums/post832231.html#post832231[/url] It shows some good practices you should use and has a pretty easy structure to follow. | |
Re: If you are just trying to restrict access to the those pages, just move them outside of public domain and use the main page that you are talking about to include them. Seems simple enough to me, but I may be missing the point. | |
Re: You realize all you have to do to get around that is to disable javascript right? | |
Re: Notice the "==" besides the enctype attribute. I would also remove the brackets "[]" from the name. | |
Re: I think that using the bitwise operators (<< and >>) are causing problems. Try using < and > instead. | |
Re: This can be tricky but its doable. The best way would be to use a mysql database and store the users answers. Each answer will need to be stored with a timestamp, so you can determine who answered first so you can distribute points correctly. | |
Re: Using firebug for Firefox, I found that on the page the ajax posts to it is saying that post.php cannot be found. | |
Re: You are mixing javascript and php. This is not possible. PHP is a server-side language where as javascript is client side. They cannot communicate with each other directly. Your best bet would be AJAX, which is the workaround to your problem. Since your experience with web development is limited, trying … | |
Re: You should be using the $_GET superglobal when trying to retrieve values from the url. | |
![]() | Re: You can do it on each page load. Just have a function to run a query to delete all records that are expired. You can also do a cron job that runs at the end of each day. ![]() |
Re: Usually I agree with quasipickle about showing effort, but your thread is interesting and I am really bored, so I wrote a quick example on how to do it. This is just a very basic way of doing things. [code=php] <?php $data =<<<MADLIB One day, I was walking through the … | |
Re: Are you serving the page as php? For example, does it have the php extension. | |
Re: Sometimes $_SERVER['DOCUMENT_ROOT'] doesn't display the right path. /usr/local/apache/ etc. should not be there. Do: [icode]echo __FILE__;[/icode]. That should show you the real that should work. | |
Re: Is there an "or die()" statement in your database handler? Also, never use inline error suppression. Its not very good performance wise. | |
![]() | Re: I guess you don't understand how sessions work. Even when you store sessions in a database, a cookie stored on the clients browser is still needed to identify them. I guess if you passed the session id with the url, you wouldn't need cookies (but this is very insecure and … |
Re: fopen, fwrite, fclose or file_put_contents would do it. It would be very insecure and your site will mostly be compromised but you can try it anyway. | |
Re: Are you running the numRows() function before running query()? That would cause that problem. | |
Re: Usually its [icode]mysql_query("call prodecure_name(params)");[/icode]. Why couldn't you find this with a search engine? Its simple. | |
Re: Do you have control of the links posted on websites A and B? If so, then this is pretty easy. If not, then you might have to use the referrer, which will not always work. | |
Re: Here is something simple, but still would cost money. This type of service will never be free. [url]http://invalid.name/wiki/index.php/Setting_up_an_SMS_Gateway[/url] | |
Re: After selecting a table, it brings me to tableparam.php which has a few errors. On line 20 of the tableparam.php file you have the variable $database which doesn't exist. I am also getting: Notice: Undefined offset: 1 in C:\programming\stillwaters\public_html\forms\inc\mysqlAjaxForm.class.php on line 88 genform.php also has the $database variable error, along … | |
Re: By coordinates, are you meaning latitude and longitude. If so, then the best way to do this is with mysql only. Ex. [code] $lat = ''; //latitude of user $lng = ''; //longitude of user $lat_col = ''; //latitude column in database table $lng_col = ''; //longitude column in database … | |
Re: Here is something I typed up a while ago. Its a complete login and registration system. Just create the following pages and create the database and tables. After that it should work. This system is safe from sql injection, spam bots, and cross-site request forgery. It doesn't have any xss … | |
| |
Re: you need to use brackets: [code] $listbox2 = $_POST['listbox2']; [/code] is the select box multiple or not. is it returning only one value. | |
Re: The brackets of the open_connection function don't match up. ![]() | |
Re: [icode]array_chunk()[/icode] would be very useful here. | |
Re: here is an upload code i just typed up for you. change the variables to what you need and also change the sql query to your database specifications. Remember: always store images in a folder on the server and have the path to the file in the database. here is … ![]() | |
Re: Sometimes, when encoding a page as UTF-8 it puts a character at the beginning of a file that causes errors like that. It might not be the case here since the error is on line 12 but it might cause you problems later. | |
Re: You can't use session_is_registered() with the $_SESSION array. They don't work nicely together. You might also want to look at mysql_real_escape_string to prevent sql injection. |
The End.