Jump to content

roopurt18

Staff Alumni
  • Posts

    3,746
  • Joined

  • Last visited

    Never

Everything posted by roopurt18

  1. I would change the method="POST" to method="post"; it may not make a difference but I never see anyone use capitalized attribute values like that. Also, it would seem that submitting your form is creating a GET request to welcome.html. Is Apache configured to serve .html files through the PHP processor? Is the file this code resides in actually welcome.html?
  2. I just saw this, hence my new post. I hope you meant addslashes() and not stripslashes(). You should be doing one or the other, but not both. Anyways, mysql_real_escape_string() is sufficient for escaping data to be inserted into your MySQL database. No other function is necessary when inserting or updating data.
  3. Passwords are character data so you sanitize them the way you would any other piece of character data before inserting them into the database. The "special format" you speak of is password protection, of which there are two types: 1) one-way hashing 2) two-way encryption A hashing function will convert a text-input into a random string. The length of the random string is predetermined by the hashing function. For example, and md5 hash is 32 characters (I believe) and a sha1 hash is 40 characters. Thus the hashing function you choose will determine the field length in your database. It is impossible to retrieve the original password from a hash. Therefore a hash is suitable for any situation in which you will never have to re-display the original information. Encryption essentially scrambles the data into what looks like garbage. There are many different encryption algorithms and strengths at which they can run. Encryption can be reversed in that you can retrieve the originally encrypted data. Thus encryption is suitable for data that needs to be protected but possibly re-displayed to a human at a later point in time. There is no set length for encrypted data; so a varchar field of 32, 64, or 128 chars may be appropriate. Additionally, encryption functions return binary data, which not all database engines store neatly. Sometimes it is appropriate (or just plain easier) to base64 encode / decode binary data when inserting / retrieving from the database. Lastly, a salt is a form of protection against dictionary based attacks. A salt is just a string of random characters that your program will add to the user's password before hashing it. The purpose of the salt is to change the range of outputs from the hashing function so that attackers can't use pre-built dictionaries to compromise stolen databases. If that doesn't make any sense to you, that's ok. Just add a salt anyways.
  4. I advise against that. Your framework or central code base should have a nifty way of handling that information so you don't have to rewrite the same old code all over again, but the data itself should still be separate!
  5. Is there any particular reason you named your textarea with name="divisions[]"?
  6. Hmmm. I just had two windows of FF open. I tried to drag a tab from one instance to another and all it did was replace the existing page in the other with the page I dragged over. Which version of FF are you running? Mine is 3.0.15.
  7. Must be a recent addition.
  8. Both. Nothing compete's with Chrome's ability to drag tabs from one window to another. <3
  9. Instead of website I'm going to use the term project, because you might be writing more than just websites. Each project should be independent of all others. This includes the database, program files, and any miscellaneous files created by the application, such as configuration files, uploaded files, etc. If you start combining project data into a centralized location, then you have issues performing certain tasks: + How will you create a backup of just "Project A?" + How will you restore a backup of just "Project A?" + What happens when you want to move just "Project A" and no other projects to another server? This doesn't mean that you can't have a centralized, single-install framework that all applications refer to. But you must keep the applications themselves separate. I might be able to pop in later with more advice.
  10. All you really need is a map of words to urls. You can store that internally in PHP as an associative array or an array of objects. If you go that route then you'll have to manually edit PHP code to change associations. You could just as easily store this list in a database in a two-column table. As far as doing the find-and-replace algorithm, I don't think str_replace() will be suitable for your needs. Just examine the following code and its output: <?php $str = 'My dog is so nice.' . "\n"; echo $str; $str0 = str_replace( array( 'dog', 'nice' ), array( 'cat', 'mean' ), $str ); echo $str0; $str1 = str_replace( array( 'cat', 'dog' ), array( 'bird', 'cat' ), $str ); echo $str1; $str2 = str_replace( array( 'dog', 'cat' ), array( 'cat', 'bird' ), $str ); echo $str2; ?> My dog is so nice. My cat is so mean. My cat is so nice. My bird is so nice. As you can see, the order in which you declare the search and replacement terms is important. You'd probably want to write your own algorithm for parsing each word of the text you want to search over. strtok() may come in handy for this. Lastly, depending on the content-size of the document you're searching and the size of the replacement list, this could be an expensive operation in terms of computing resources required. As such, you may want to consider implementing some sort of caching feature.
  11. Take three days, a week, whatever it takes, to watch the video in its full length, and you'll see that those comments show a superficial understanding of the tip of the iceberg that is this problem. Bottom line is there is an elite world order, which the video refers to as "the money changers," that have an agenda to drive the world into poverty so they can accumulate wealth. The "money changers" have installed a national bank in every nation they can in order to control that nation's money supply and it's through this control of the money supply that they slowly strangle the nation of its wealth. When their agenda can't be met through peaceful means, they instigate war so that they can loan to both sides, ensure the victor of their choosing, and then use the resulting economic instability to convince a nation's public that only a national bank will stabilize the economy. Not content to control individual nations' and their money, they are the primary backers of the United Nations and world bank so that they can perform the same actions on a global scale. The current U.S. depression and world recessions are not accidents; they are carefully calculated and controlled events. The only reason so much of the population has been caught off-guard is because nobody really understands what is happening and exactly how long it has been happening. As an example, I was always taught the United States has only ever had two national banks and I was under the misconception the Federal Reserve was part of the United States Federal government. Neither is true. The U.S. has had eight national banks over its history and the Federal Reserve is a private bank with private investors and it does not answer to the government. If you live in a nation with a national bank, then it is likely your national bank operates in the exact same way. If everything in this video is true and the "money changers" so desire, then it's not inconceivable that the world's currently wealthiest nations could soon become the worlds next third-world nations. I know people with accounting and finance degrees that were never taught the slightest bit of information presented in this documentary.
  12. http://www.youtube.com/watch?v=QlIhhYGujoQ&feature=related A coworker lent me the DVD and quite honestly I was blown away. I have a four year college degree and took numerous classes that could have touched on the subject but I'd never heard any of this. The entire thing is about 3 1/2 hours long and took me three evenings to watch. It's mostly directed at U.S. citizens but this information is useful for any citizen of any country with a national bank.
  13. From the moment I asked you to run modified code so I could see the array returned from the function until you actually posted the array, it took 9 posts. You said you didn't notice I modified your code, which tells me you are not reading my replies carefully. The modified code I used had a print_r(), you used var_dump(), which dumped out a ton of extra crap I didn't need to see. So you don't follow directions very well. Then when you post the output, you just plopped it into the post body and made no attempt to preserve the pretty output that var_dump() (and print_r()) both use. So I had to spend an extra 5 minutes fiddling around with your post to make a nice pretty output (that I think but am not sure) is the correct output from var_dump(). I don't have the time or patience to continue in this manner, so this is probably my last post in this thread. I suggest that when you request help from others in the future: 1) carefully read any replies 2) follow instructions 3) run any modified code (if it is safe to run (they might try to embed code that steals your database credentials for example)) 4) make information readable to others (unlike your post with the var_dump()) Anyways, after reformatting your post, var_dump() appears to look like this: array(5) { [0]=> array(11) { ["row_index"]=> int(1) ["eltype"]=> string(2) "ls" ["name"]=> string(7) "fldlst1" ["lbl"]=> string(12) "select_field" ["dflt"]=> string(0) "" ["lsttype"]=> string(1) "n" ["lstpop"]=> array(3) { [0]=> array(3) { ["row_index"]=> int(1) ["li"]=> string(10) "first_name" ["selected"]=> string(1) "f" } [1]=> array(3) { ["row_index"]=> int(2) ["li"]=> string(9) "last_name" ["selected"]=> string(1) "f" } [2]=> array(3) { ["row_index"]=> int(3) ["li"]=> string(5) "email" ["selected"]=> string(1) "f" } } ["lstpop_type"]=> string(1) "a" ["multi"]=> string(1) "f" ["size"]=> int(1) ["html"]=> string(0) "" } [1]=> array(12) { ["row_index"]=> int(2) ["eltype"]=> string(2) "ls" ["name"]=> string(6) "oplst1" ["lbl"]=> string(15) "select_operater" ["dflt"]=> string(1) "=" ["lsttype"]=> string(1) "n" ["lstpop"]=> array(4) { [0]=> array(3) { ["row_index"]=> int(1) ["li"]=> string(1) "=" ["selected"]=> string(1) "t" } [1]=> array(3) { ["row_index"]=> int(2) ["li"]=> string(2) "!=" ["selected"]=> string(1) "f" } [2]=> array(3) { ["row_index"]=> int(3) ["li"]=> string(4) "LIKE" ["selected"]=> string(1) "f" } [3]=> array(3) { ["row_index"]=> int(4) ["li"]=> string(2) "IN" ["selected"]=> string(1) "f" } } ["lstpop_type"]=> string(1) "a" ["multi"]=> string(1) "f" ["size"]=> int(1) ["align"]=> string(6) "center" ["html"]=> string(0) "" } [2]=> array(7) { ["row_index"]=> int(3) ["eltype"]=> string(2) "tx" ["name"]=> string(9) "criteria1" ["lbl"]=> string(23) "enter_criteria_value(s)" ["align"]=> string(4) "left" ["size"]=> int(80) ["html"]=> string(0) "" } [3]=> array(5) { ["row_index"]=> int(4) ["eltype"]=> string(2) "ab" ["name"]=> string( "add_row1" ["lbl"]=> string(7) "add_row" ["html"]=> string(0) "" } [4]=> array(5) { ["row_index"]=> int(5) ["eltype"]=> string(2) "sb" ["name"]=> string(10) "submit_cri" ["lbl"]=> string(6) "submit" ["html"]=> string(0) "" } } If I remove all the sub-array information, we are left with: array(5) { [0]=> array(11) { } [1]=> array(12) { } [2]=> array(7) { } [3]=> array(5) { } [4]=> array(5) { } } So your function is returning a numerically indexed (and thus not an associatively indexed) array. When we read the documentation on the extract() function: http://us.php.net/manual/en/function.extract.php Your keys are: 0, 1, 2, 3, 4 From elsewhere in the PHP documentation: None of your keys are valid variable names so extract does not work. Which is what I predicted in my very first post: And if you had just followed directions, you would have had your answer two days ago and the problem would likely be solved by now. You could try something like calling extract on each element returned in the array, like so: $a = get_el_ary_cri(); foreach( $a as $v ) { extract( $v ); // do stuff here } But you will need to be careful in how you apply that because the sub-arrays have overlapping index names and will thrash the previous values in the symbol table.
  14. I need to know what the array is just before it is returned; I'm not going to take your word that it is as expected because you might be mistaken. You can't be helped if you're not going to provide any information that will be useful in helping you.
  15. I modified your function to print the value of the array before it returns. When you run it you should see extra output.
  16. What does this output: function get_el_ary_cri(){ $a_fldlst = get_lst_ary_fn(); $a_oplst = get_lst_ary_op(); $el_ary_cri = array(array('eltype'=>'ls', 'name'=> 'fldlst'.$_SESSION['rowcount'], lbl'=> 'select_field', 'dflt'=>"",'lsttype'=> 'n', 'lstpop'=>$a_fldlst, 'lstpop_type'=>'a', 'multi'=>'f', 'size'=>1,'html' =>''), array('eltype'=>'ls', 'name'=> 'oplst'.$_SESSION['rowcount'], 'lbl'=> 'select_operater', 'dflt'=>"=",'lsttype'=> 'n', 'lstpop'=>$a_oplst, 'lstpop_type'=>'a', 'multi'=>'f', 'size'=>1, 'align'=>'center','html' =>''), array('eltype'=>'tx', 'name'=> 'criteria'.$_SESSION['rowcount'], 'lbl' =>'enter_criteria_value', 'align'=>'left','size'=>40, 'html'=> ''), array('eltype'=>'ab', 'name'=> 'add_row'.$_SESSION['rowcount'], 'lbl'=> 'add_row', 'html' =>''), array('eltype'=>'sb', 'name'=> 'submit_cri', 'lbl'=> 'submit', 'html' =>'') ); echo '<pre>' . print_r( $el_ary_cri, true ) . '</pre>'; return $el_ary_cri;// <---------everything is fine at this point } I'm guessing your array doesn't have any associative indexes.
  17. I'm not upgrading until it has better support for the existing pr0n software.
  18. You could probably build a new atari, or something close to it, from off the shelf components at Radioshack. With all that money they're raking in they can easily modify that old atari hardware!
  19. Time for a little graph theory! Q: What is the minimum number of colors required to color every country on the map such that no two adjacent countries have the same color! I'm not going to bother coming up with the answer so this would be an exercise for your own benefit, not mine! Lastly, every time I come into this thread I get another cool advertisement, this time its from www.thailovelinks.com; I could find my Thai love today!
  20. It is a dedicated server and it is $1.99 / month. They're using old Atari 2600s as their hardware though.
  21. I second this. Great content and easy to read.
  22. Turn 'em upside down and they're all sisters.
  23. It's been a while since I've used MySQL, but I seem to remember you can run queries across databases. insert into `database1`.`users` ( `username`, `password` ) select `username`, `password` from `database2`.`users` where 1=1 You could try that out with two test tables. Then you don't have to write all this silly code, just execute one sql statement.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.