-
Posts
2,965 -
Joined
-
Last visited
Everything posted by mikesta707
-
$id = array_search($_GET['id'],$episodes_array); this won't get the ID number. $_GET['id'] is the ID number, $id would be the key at that number. you could access it via $num = $episodes_array[$id]; but that is kind of pointless because the value that would get is the value of $_GET['id'] and what is $pos? how are position and ID different? i know id is the id number of the show. what is pos in relation to the show? does it have any relation? and if you have purely php code, use php tags, not code tags. it makes it nicer to read nvm you did... hmm i must be hallucinating again... ignore that last line
-
Unable to Insert Values into database
mikesta707 replied to surajkandukuri's topic in PHP Coding Help
try wrapping your arrays with {}, IE $sql = "INSERT stuff (stuff), values({$stuff[0]})"; -
im not looking through your entire page. post the relevant code
-
Please help with insertion of code....
mikesta707 replied to robert.access's topic in PHP Coding Help
if lang.php is included in that page.. just put it in there... $affheaderb = header5(MSG_INVITE_FRIENDS); did you even try that? -
$key = array_search($array, "Value Im Looking For"); $key would be the key of the array with that value. assuming all entries in the array are different, this should suit your needs. if you need to get multiple keys that might have to same value, use the array_keys function with and use the optional third search parameter. check out the manual for more information
-
the error is happening because, as people have said, PHP doesn't know where your functions.php file is. The address you are giving it is wrong. PHP can't just guess where your file is, and even if it could, it refuses to. make sure that functions.php is in the same directory as your script file. if its not, either move one of the files so it is, or make the path to the file correct
-
looping, then array a certain $breed from a $petspa
mikesta707 replied to JasonGreen's topic in PHP Coding Help
well first of all. you dont do for loops like that. second of all, you probably want to use the comparison operator (==) not the assignment operator (=) for loops are structured (for the most part, of course there are some variations) like so for ($counter, $counter < $timesToLoop; $counter++){ i'm not sure what you are trying to even do, but I suggest you do study the basics of PHP a little more before you tackle this problem. It will be a lot less of a headache then.. But for your problem. Can you describe, exactly, what works and what doesn't, and what you expect to happen. -
try Top::go(). I am not sure if thats how you do it in PHP, but if you were using C++ that would be the way
-
A Cron is the best option.
-
that means that $Year and $Month are undefined when you are trying to use them. PHP is pretty forgiving about when you can define and use variables, and usually will allow you to just create and use variables on the fly. However, when you try to use variables in boolean expressions like you do, I think you have to define them first. try defining them to blank (IE "") in the start of your script
-
Alright, well as far as your mysql problem, i probably couldn't help fix that without more information. however, you don't seem to need sql for this script. but to start your server, you should be able to click or right click on the icon in your tray, and there should be an option to turn the server online. If you can't find one, try opening the server control window. you can stop it, start it, restart it, etc. from there. you also have to put php files in the htdocs folder of your server directory. this is more or less the directory that is opened when you load localhost/
-
well since regardless of what country is, if it is either UK, US, etc, its going to do the same thing (based on OP's code) so a switch statement will probably be worse than what OP has now (worse meaning taking more code, and being rather sloppy)
-
the string reverse is pretty easy, just use the strrev function. $string = "Hello World!"; $reverse = strrev($string); As for the validation, you can accomplish that with regex. its a very simple regex expression match, but i'm awful with regex, so I don't want to give you something that is wrong
-
$_SERVER['REMOTE_ADDR'] problem on windows
mikesta707 replied to stormen81's topic in PHP Coding Help
maybe post the code or the actual error message? -
[SOLVED] cannot modify header information error
mikesta707 replied to mraza's topic in PHP Coding Help
so its working? than whats the problem -
How to display a numbered random output.. Help!!!!
mikesta707 replied to tsuoshiro's topic in PHP Coding Help
make a counter before the while loop $result=mysql_query($query,$connection) or die(mysql_error()); $i = 1; //$switch=true; while($row=mysql_fetch_array($result)) { ?> <tr> <th colspan="2" scope="col"><div align="left"><<?php echo $i.$row['question']; ?></div></th> </tr> <tr> and increment it at the end of the loop $i++; }//end while -
[SOLVED] cannot modify header information error
mikesta707 replied to mraza's topic in PHP Coding Help
you can't have any output at all before the header call. judging by how far down in the code it is, im willing to bet something is output before you try to call that -
have you considered a cron job?
-
How to display a numbered random output.. Help!!!!
mikesta707 replied to tsuoshiro's topic in PHP Coding Help
what is the problem you are having. if you describe the problem, it would be easier for someone to come up with a possible solution -
it seems like qty and cost are numeric columns . you dont need to surround numeric columns with single quotes
-
try surrounding strings with single quotes.
-
create an array of possible values, and use in_array $array = array("US", "AU", "UK", etc); if (in_array($country, $array)){ //do whatever }
-
use number_format() $price=250.00; $quantity=2; $total=number_format($price*$quantity, 2); echo $total; //outputs 500.00
-
how to set max file size for each file upload field?
mikesta707 replied to Mr.Canuck's topic in PHP Coding Help
um, you werent supposed to just copy and paste in in there. if(count($Files)>0){ foreach($Files as $filename){ if (is_uploaded_file($_FILES[$filename]['tmp_name'])) { $size *= 1024;//now size is in kilobytes $size *= 1024;//now its in megabytes $max (1024)*(1024)*8;//1024 bytes in a kilobyte, 1024 kilobytes in a megabyte, then times 8 for 8 megabytes //you could do the following conditional to test if the file is too big if ($size < $max){//upload the file if(move_uploaded_file($_FILES[$filename]['tmp_name'], $SETTINGS["uploadDir"].$_FILES[$filename]['name'])) { //stuff below }//end if(move_uploaded }//end if($size < $max) else { echo "File too large!"; exit(); -
how to set max file size for each file upload field?
mikesta707 replied to Mr.Canuck's topic in PHP Coding Help
if(count($Files)>0){ foreach($Files as $filename){ if (is_uploaded_file($_FILES[$filename]['tmp_name'])) { if(move_uploaded_file($_FILES[$filename]['tmp_name'], $SETTINGS["uploadDir"].$_FILES[$filename]['name'])) { chmod($SETTINGS["uploadDir"].$_FILES[$filename]['name'],0777); $attach_filepath[] = $SETTINGS["uploadDir"].$_FILES[$filename]['name']; }; }; } this area