708 Posted Topics
Re: You are overwriting your first query with the one in the loop. Name your second query something different. | |
Re: i had a problem like this recently where I was trying to give an image preview when the mouse went over a link. I was trying to fill a div that followed the mouse and when I ran over another link it would append another image to the div, not … | |
Re: Do you get an error with this code? [code] if (!$_POST['username'] | !$_POST['pass'] | !$_POST['pass2'] ) { die('You did not complete all of the required fields'); } [/code] The single | makes me think it would cause an error because "OR" is "||". [EDIT] I tested it on my server … | |
Re: run two queries in a while loop. [code] <?php $html = "<ul>\n"; $query = mysql_query("SELECT `cat_id`,`cat_name` FROM `tblCategory`"); while( list( $id,$name ) = mysql_fetch_row( $query ) ) { $html .= "\t<li>{$name}"; $query2 = mysql_query("SELECT `topic_id`,`topic_name` FROM `tblTopics` WHERE `cat_id` = {$id}"); if ( mysql_num_rows( $query ) > 0 ) { … | |
Re: The best way is to not store them in a place accessible to the public. I put all of my config files ect. outside the web root. | |
Re: You will have to have a inactivity timeout. Probably around 20 to 30 minutes. Just have some code to check to make sure the user is still active otherwise delete them. You can also implement a javascript solution. I have seen where you can use a function run onunload via … | |
Re: I think you are going about this the wrong way. Why not take advantage of what php has to offer to simplify everthing. You can have one php page generate a different blog for each member without having to create seperate static html pages. | |
Re: i don't think you can export and fill a template with php. I have however exported data from a database to excel with php. My suggestion is that you recreate the template in html and have server side code fill the template then export. Excel will read html tables. | |
Re: i don't think this would be to hard. you can use opendir and readdir to find directories and files and then add them to a zip file (I just saw a few good zip classes online, search "php zip class" in google). then have that emailed to you, which isn't … | |
Re: reverse the order. the string you want to escape goes first, then the database connection. | |
Re: Have a landing page that users go to before being redirected to a site. If every image has an id in a database, then you can just change all the links in your page to something like click.php?id=[image id] on click.php you update the database with the new click and … | |
Re: Here is how I would do it. It minimizes the number of queries and should work (at least in my head it does). I don't have time to test it right now. [code] <?php $con = mysql_connect('localhost','user','password'); mysql_select_db('database',$con); $result = array(); $path = '../images/gallery_images/'; $query = mysql_query( "SELECT * FROM … | |
Re: i finished the pagination script you needed. PM me your email so i can send it to you. | |
Re: NO. That is not enough. Javascript can be disabled. Also, instead of all of that redundant code, why not use: [code] array_map('mysql_real_escape_string',&$_POST); [/code] | |
Re: First of all, there are some problems you need to address before anyone even thinks about downloading/using this. You have a username and password stored in plain text on the server. Not Good! A database should be used to store them. The password should be hashed as well. You also … | |
Re: That is only a notice, not an error. Change your error reporting. | |
Re: So you are wanting one image to be displayed every 5 seconds, right? If that is the case, I would have php echo a javascript array with the image names. Then javascript could change the picture easily. Otherwise, I would use ajax. | |
Re: I take a more hands down approach to such a question. The acquisition of knowledge is man-kinds greatest asset and biggest liability. We strive to know as much as we can and it just hurts us. With limited time on this earth, I don't understand why we spend so much … | |
Re: So pretty much you are wanting a tree like the one you have in pieces, to be expandable so it won't have to be in pieces? If so, I have a basic idea on how I would do it. I would like to know if I understood your question right … | |
Re: Here is a good example of a secure login system: [url]http://www.daniweb.com/forums/thread183049.html[/url] With proper implementation of sessions, the possibility of hacking them goes down drastically. | |
| |
Re: You are not sending the managers id in the confirmation form. You have [icode]$mGinNo = $_POST['mGinNo'];[/icode], but there is no 'mGinNo' in the form. | |
Re: check this thread. i helped the poster with a similar problem. [url]http://www.daniweb.com/forums/post833398.html#post833398[/url] | |
Re: why not use an array name as the inputs name. [code] <input type="checkbox" name="check[]" value="1" /> [/code] then the results will already be in an array in the $_POST array. all you do after that is validate. | |
Re: move [code] $login= $_POST['user']; $password= $_POST['pass']; [/code] under the if statement [code] if (isset($_POST['user'] ,$_POST['pass'])) { [/code] in login.php | |
Re: not possible the way you are doing it. you are displaying the output of that function in a js variable. php is writing the javascript. javascript did not call the php function. the only way you can do that is by ajax. | |
Re: store comments in a separate table and reference them by id. it would be very inefficient to store them in the same row. | |
Re: make the checkbox name "id[]" and then you can process the data using [code] foreach( $_POST['id'] as $key => $val ) { //delete query using $val as $id } [/code] thats just a simple example, there still are some security issues to take care of | |
Re: Did you ever edit the page via a editor on the website? I have had permission problems when the file is created/changed by a script on the server. | |
Re: Form on [url]www.111.com/form.html[/url] [code] <form action="http://www.222.com/process.php" method="post"> <!-- rest of form here --> </form> [/code] | |
Re: its not a php problem. your html syntax is wrong. | |
Re: in IE7 and Firefox3, I really don't see any difference. Which browser are you using? | |
Re: Why do you have a file for every location? Couldn't you just send an id to a landing page that could get the data you need. I think you might be over-complicating things. As I don't know the whole situation I can't be sure though. | |
Re: What errors are you getting in IE? | |
Re: This doesn't make sense to me. A session shouldn't be lost if you use absolute links. When a session starts a cookie is set with the session id for that domain. The only problem I can think of if you are changing domains or using a subdomain. I have never … | |
Re: I would use array_diff. The way you have your form setup, you should get an array of answers. Its really the easiest way to get data from a checkbox. Try: Your correct answers need to be in an array though, which isn't hard. [code] <?php $options = $_POST['option']; if ( … | |
Re: Your variables are overwriting each other. And you are using the wrong variables names. The [icode]i[/icode] should be [icode]$i[/icode]. The method you are trying to use won't work easily either. I am typing up a solution now. | |
Re: Uploading via ajax and php isn't the easiest thing to do. You have to submit a form to an iframe on the page. Here is a good example: [url]http://www.anyexample.com/programming/php/php_ajax_example__asynchronous_file_upload.xml[/url] or just google "php ajax file upload" | |
Re: here is a regex that will make sure the password has at least 1 uppercase letter, 1 lower case letter, and a number. which is a pretty secure password. [code] preg_match( "/^.*(?=.{3,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$/",$password) [/code] | |
Re: that won't stop all urls. [url]http://google.com[/url] would work. for a simple solution, change "/www/" to "/(http:\/\/|www)/" | |
Re: you need to escape the " in the css/html. example: [code] $css = "<style type="text/css"> body { background -color: #ffoocc; }"; [/code] should be [code] $css = "<style type=\"text/css\"> body { background -color: #ffoocc; }"; [/code] You could also use the heredoc syntax [code] $css =<<<CSS <style type="text/css"> body { … | |
Re: You should make a new password and send that to them. Thats how you have to do it. It would defeat the purpose of hashing if you could get the orginal text back. | |
Re: i just created a function to make dynamic multi-level menus. it uses an array to make the menus. i think if you can get the data from the database into the right format for the function it should work nicely for you. example: $menu['testing'] = array( 'href'=>'path/to/page','title'=>'Page Title' ); $menu['testing']['submenu']['test2] … | |
Re: put the validation on the same page. don't let them go to the next page until the first page is completed successfully. | |
Re: does $myusername have a value? you are using shorttags "<?", does your server allow them? | |
Re: why not just use [icode]header('Location: index.php');[/icode] instead of the redirect function. i don't see a need for it. | |
Re: you will need to be more specific so we can help. we are not mind readers. general solutions rarely help, more details helps us solve your problem faster. | |
Re: you have your emails sending to "someone@example.com". replace that with $councillor. After you do that, change the $_REQUEST['councillor'] to $_POST['emailler']. change [icode]if (isset($_REQUEST['emailler']))[/icode] to [icode]if (isset($_POST['send']))[/icode] i recommend using $_POST array instead of $_REQUEST because it more secure. you need to make this much more secure before putting this live. … |
The End.