-
Posts
2,965 -
Joined
-
Last visited
Everything posted by mikesta707
-
as long as you don't scan the temp directory, you will be fine. All uploaded files go to the temp directory, and have to be moved after upload (by PHP or some other scripting language) to a normal directory or they will be deleted. so if they are not in the temp directory, they have been fully uploaded
-
i guess you could use str_pad(), like so $arr = array("jan", "feb", "mar","april"); foreach($arr as $key=>$value){ echo '<option value="'.str_pad((int)($key+1), 2, '0', STR_PAD_LEFT).'">'.$value.'</option>'; } but thats not much better... if you already have it, and it works just use it oops slight edit
-
I dont see any place where you call the lookup function (which is where the hidden field is.) I dont actually even see where you put the beginning for tag. I do see t his bit of code <?PHP $contact_form = '<form method="post" action="sendeail.php"> <!-- DO NOT change ANY of the php sections --> <?php $ipi = getenv("REMOTE_ADDR"); which, besides being completely invalid, won't echo the beginning form tag. if you want to echo it, put an echo <?php $contact_form = '<form method="post" action="sendeail.php">; echo $contact_form; ?> do note that I fixed the invalid markup also. and if you want to the hidden field to be a part of that form, you have to echo it also. having a function won't do anythign if you don't call it Attention:<br /> <select name="attn" size="1"> <option value=" Sales n Billing ">Sales n Billing </option> <option value=" General Support ">General Support </option> <option value=" Technical Support ">Technical Support </option> <option value=" Webmaster ">Webmaster </option> </select> <br /><br /> <?php echo lookup(); ?> Mail Message: <br /> <textarea name="notes" rows="4" cols="40"></textarea> <br /> <input type="submit" value="Send Mail" /> <br /> </form>'
-
if your function returns the folder name you want, than just do $movie = glob(myReturnFunction());
-
if you test being logged in by (isset($_SESSION['login']) than that should work fine. have you tried it?
-
I would look into regular expressions
-
[SOLVED] Need help rid of stuff in a string
mikesta707 replied to newcoder21's topic in PHP Coding Help
you can use regex, or a combination of str_replace, strstr() and strrstr(). try reading the manual on regex, or those functions -
do a print_r on $episodes_array and post the output
-
what do you mean declare a variable? that has different meanings in different langauges. like do you mean you tried to do $var1; $var2; ? similar to something you would do in C++/C or Java? (among other languages of course) declaring and setting ARE two different things, but a variable that is defined doesn't have to be set to any value. A definition of a variable basically just creates it for the program to use. However, in PHP, the act of assigning a value to a variable that hasn't been defined yet will define the variable for use, and assign it a value. They are two different actions. but regardless, you really need to think about a better way to accomplish what you are doing. you have like 6 different submit buttons in 1 form (forms should only have 1 submit button) You should really just have a link to edit certain entries, and when you click that link, you go to the update page. it will be much easier to change how stuff updates if you have your different sql functions (insert, update, etc) on different pages, rather than mashing everything into one page.
-
[SOLVED] Updating a quantity by checking the product_model
mikesta707 replied to Colton.Wagner's topic in PHP Coding Help
that means that you are using variables that you haven't defined yet. Either you misstyped the variable names, or you need to define them.. -
where do you get the value for ID? I would suggest splitting up your different types of queries (inserts, deletes, updates, selects, etc.) into different pages also, where are next, previous, etc. ever set. you are testing if they are set without ever setting them, so nothing happens...
-
thats the exact same code I told him to try. if it is returning just an empty array than there is something wrong with your query, or your query doesn't return anything. try echoing the query string and see what it says
-
from your first post, $episodes_array isn't multidimensional. change $id = $episodes_array[$pos]['id']; to $id = $episodes_array[$pos]; and see what happens
-
what does print_r return?
-
actually, thats untrue. Depending on which version of PHP you have, and what you have your error reporting is set to, echoing a variable that has not been defined before will create that variable, with null value, and echo it. so if you do something like <html> <body> <?php echo "something" .$var; ?> </body> </html> the output would be something no notices or anything. EDIT: meant to say, except with the following, you will get a notice ini_set ("display_errors", "1"); error_reporting(E_ALL); at the top of the page. However, do realize that this is system and version dependant
-
online > '$timenow' this might have to be online > $timenow You may be getting an error because you are comparing a number (or a timestamp, or whatever) to a string.
-
um... of course it prints array if you just do echo $arr. you cant just print arrays like that. if you want to echo them you have to iterate though each entry...
-
what is pos... exactly. what does it represent. you are not being clear on what exactly pos is. from the looks of your code, pos seems to be the key in the array of what episode id you are watching
-
Well, if its guarenteed that each will start with www, then you could just do an explode on www, do an array map to remove every instance of http, then do another array_map to add http://www to the beginning of each entry. then an implode to add the line breaks. if you give me some test data I can try to whip up a function that will do that for you
-
if you are passing the key of the array as the get variable pos than use it... $id = myarray[$pos];
-
will urls always start with http:// ? if so you could do an explode on the string, and then use an array_map to put the http:// back on if you wanted, and do an implode with the line break tag
-
well, if your query failed, it would give you an error.. this won't work because return leaves the function all together, so you would only get the first result row while($comment = mysql_fetch_array($this->run_commentsql) { return($comment['comment']); } you could build an array, and then return that array like so $arr = array(); while($comment = mysql_fetch_array($this->run_commentsql) { $arr[] = $comment['comment']; } return $arr;
-
yes, its a CSS problem, not a PHP problem