-
Posts
2,965 -
Joined
-
Last visited
Everything posted by mikesta707
-
the same result as what? I don't quite understand your question can you explain a little better?
-
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)
-
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
-
PLEASE HELP! Need help w/ database_exists() function...
mikesta707 replied to ShadowIce's topic in PHP Coding Help
you should set error reporting to all ini_set("display_errors", 1); error_reporting(E_ALL); it should be $row['Database'] not database. -
Need to know what this code lines means... Thank you
mikesta707 replied to co.ador's topic in PHP Coding Help
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 -
Need to know what this code lines means... Thank you
mikesta707 replied to co.ador's topic in PHP Coding Help
That is just variables being defined. What exactly don't you understand about that script? Here is a tutorial -
you also don't have a semi colon after this line $yoursnow = mysql_query("UPDATE flags SET mod = $duuuude WHERE flagid = $flaggle")
-
most modern browsers will ignore the value attribute of input file fields for security concerns
-
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 }
-
Sendmail.php - heading error following check_input
mikesta707 replied to Dennisg's topic in PHP Coding Help
Oh i mean on the forums. either [code] [/code] Also there are php tags for specifically php [code=php:0] [/code] -
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.
-
You can create a database with a sql query, as brandon said, and simply use mysql_query(). check out this for the syntax
-
Sendmail.php - heading error following check_input
mikesta707 replied to Dennisg's topic in PHP Coding Help
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 -
Hi everyone need some help with a php code im using on my website
mikesta707 replied to pavlos1982's topic in PHP Coding Help
Can i see the is_page function -
mysql_real_escape_string making variable equal nothing
mikesta707 replied to emopoops's topic in PHP Coding Help
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() -
I do not like it when you touch my breasts
-
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
-
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.
-
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
-
hmm maybe try 5 ../, and make sure that you have the right directory seperator. if its windows it may have to be ..\ rather than ../
-
yeah I ctrl+click and it selects whatever files I want...
-
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
-
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.
-
how can i send data from input tags to page.php ?
mikesta707 replied to co.ador's topic in PHP Coding Help
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 --> -
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