Jump to content

mikesta707

Staff Alumni
  • Posts

    2,965
  • Joined

  • Last visited

Everything posted by mikesta707

  1. the same result as what? I don't quite understand your question can you explain a little better?
  2. this if ($userlocation = "London") should be this if ($userlocation == "London") = is the assignment operator and always returns true unless whatever is being assigned to the variable is false (or coerces to false)
  3. also, if you want to put arrays straight into strings without concatenating, you should surround the array variable with curly brackets IE $string = "some strings with an {$array['key']} in it"; also in emails, you should comply to RFC standards, because emails that don't comply are discarded by isp's a lot (they consider them spam) use \r\n for line breaks (rather than \n) and you should check to see that the post or get (or request in this case) are set before you do anything, to prevent people sending empty emails, and stuff like that
  4. you should set error reporting to all ini_set("display_errors", 1); error_reporting(E_ALL); it should be $row['Database'] not database.
  5. The variable, in that case, would be an empty string. Kind of. You define whatever is inside the array with the array function $myArray = (1, 2, 3); I can access the stuff in that array by using the square bracket operators "[]" like so echo $myArray[0];//echos 1 echo $myArray[1];//echos 2 $myArray[1] = 4; echo $myArray[1];//echos 4 The numbers inside the brackets are called keys. They determine which value in the array you are accessing There is a link in my sig that has a tutorial on arrays. I highly suggest you check that link out, or the tutorial i linked to in my earlier post. I'm assuming he means that he is going to use the array to build an HTML drop down box with some other code. But it's hard to say without seeing the other code. Seeing those few lines out of context can be misleading. Yes it is an array of two arrays. but values isn't really a variable, its an array key. this is called an associative array because the array keys are a string, rather than numbers like in my first example. This means that instead of typing $array[0] to get the first array, you could type $arrRestaurantsFoodTypes['value']; and that would be the inner array. as far as output, if you echoed the line above, it would echo "Array()" because simple echo statements can't echo an array. you can use print_r($arrRestaurantsFoodTypes['value']) to see the structure of the inner array
  6. That is just variables being defined. What exactly don't you understand about that script? Here is a tutorial
  7. you also don't have a semi colon after this line $yoursnow = mysql_query("UPDATE flags SET mod = $duuuude WHERE flagid = $flaggle")
  8. most modern browsers will ignore the value attribute of input file fields for security concerns
  9. There are quite a few problems with this script. For one I don't see where you ever define $available. Nor do I see where you define $choice. Like Rarebit said, you need to close your select tag after the for statement. if you want to access the post variables, you will probably have to go through your database again to get the array key names. like $select = "your select statement"; $query = mysql_query($select); while($row = mysql_fetch_assoc($query)){ //how ever you define $choice do it here $post = $_POST[$choice];//this is the amount they selected $price = $row['price'];//price $total = $post * $price;//total price }
  10. Oh i mean on the forums. either [code] [/code] Also there are php tags for specifically php [code=php:0] [/code]
  11. you don't need to make a row in a mysql table to use sessions. Sessions have nothing to do with sessions really (as far as their mechanics go). I gave you an example in my first post, thats pretty much all you need to do. However, that's assuming you want them to only pray during a session (IE whenever they close the browser) or they can only pray once per prayer, or once a day/week/month etc. That would be different.
  12. You can create a database with a sql query, as brandon said, and simply use mysql_query(). check out this for the syntax
  13. you can't have any html before the header is sent. if you look at the error it says output started on line 3. check out that line and the lines around. Also, put your code in code tags please
  14. do you have error reporting on? ini_set('display_errors', 1); error_reporting(E_ALL); have you connected to a mysql database? mysql_real_escape_string() needs a link identifier to work, without it it returns false (actually a little more happens, but you can read about it in the manual) You can also try var_dump() on your variable to see if it actually an empty string, or just a boolean false mysql_real_escape_string()
  15. I do not like it when you touch my breasts
  16. for each session? just do something like if (isset($_SESSION['pray'])){ //dont pray { else { //pray $_SESSION['pray'] = true; } don't forget to add session_start() at the beginning of your page
  17. Upload tutorial Introduction to MySQL once you get a simple script running, don't be afraid to post questions on how to upgrade it here.
  18. basically thats the bulk of what you have to do, but you probably want to check that the dir doesn't exist before hand, among other stuff. but yeah thats about it
  19. hmm maybe try 5 ../, and make sure that you have the right directory seperator. if its windows it may have to be ..\ rather than ../
  20. yeah I ctrl+click and it selects whatever files I want...
  21. not really, besides the overhead in the latter example of calling a function. You could similarly use extract() for the same kind of effect. When register_globals was turned on this happened automatically
  22. and the page you want to load is wordpress/wp-load.php right? well that is 4 directories back, so ../../../../wp-load might do it.
  23. if you want to send inputs, you need a form field, and you need to set the action of the form field to whatever page. for example <form action="page2.php" method="post" > form stuff <input type="submit" value="submit" /><!-- this is the submit button that submits the form -->
  24. http://php.net/manual/en/function.array-push.php array_push returns an int. you can just call it like so and it will work array_push($notify_list,"$user_em"); but since you are just pusing one element into the array, this would be slightly faster $notify_list[] = $user_em; since you don't have the overhead of calling a function
×
×
  • 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.