
scootstah
Staff Alumni-
Posts
3,858 -
Joined
-
Last visited
-
Days Won
29
Everything posted by scootstah
-
PhpMyAdmin - What's the newest version that doesn't use javascript/ajax?
scootstah replied to Jessica's topic in Applications
All of the old functionality is still there. I think you are just clicking the wrong things. -
For starters you'll need to remove the two header() calls to stop it from prompting to save the file in the browser. From there you will need to modify the functions to return data rather than echo it. Finally, you can use file_put_contents to save it to a file.
-
Regarding what exactly?
-
Pros: it works. Cons: your application is still broken.
-
There is a sticky for this at the top of this forum. http://www.phpfreaks.com/forums/index.php?topic=37442.0 And no, this is not what output buffering is for. This is but a quick band-aid, but it is not a solution. You need to move your presentation logic out of your business/application logic.
-
Sure. $old_array = array(1,2,3,4,5,6,7,8,9,10); $new_array = array(); foreach($old_array as $old) { if ($old != 3 && $old != 5 && $old != 7) { $new_array[] = $old; } } /* $new_array = Array ( [0] => 1, [1] => 2, [2] => 4, [3] => 6, [4] => 8, [5] => 9, [6] => 10 ) */
-
Like I said, just put that code anywhere. For example here is the top of the code that you posted with that little snip added: <html> <body bgcolor="#FFFFFF"> <?php $mydate = isset($_REQUEST["date5"]) ? $_REQUEST["date5"] : ""; echo '<pre>' . print_r($_FILES, true) . '</pre>'; EDIT: And the snippet will give you all of the information contained in the $_FILES array which may be useful for debugging, so please post the output here.
-
div position messed up after using php codes
scootstah replied to lobfredd's topic in PHP Coding Help
Is that what it should look like? If so, removing the inline-style from the font tag did it. And really, don't use the font tag. That stuff should be handled with CSS classes. -
hw can i get drop down form to change sort by form asc or desc?
scootstah replied to Lisa23's topic in PHP Coding Help
You would have to actually submit the form and then use the value of $_POST['sortby'] (note you'll need to give your select a name attribute) for your switch statement. If you want to use the onchange event or otherwise do it without actually submitting the form you will have to use Javascript. -
Firstly you should be using $_FILES and not $HTTP_POST_FILES. Also, you should be using move_uploaded_file and not copy. With that out of the way, please put this in your script (anywhere as long as a file would have been uploaded at that point): echo '<pre>' . print_r($_FILES, true) . '</pre>'; Then post the output.
-
Are you using any sort of CMS, framework, or some other third party script to upload things? Or just a simple run-of-the-mill file upload?
-
The general idea is something like: <option value="something" <?php echo $_POST['dropdown'] == 'something' ? 'selected="selected"' : ''; ?>>Something</option>
-
Countdown timer not working in IE do you know why?
scootstah replied to Presto-X's topic in Javascript Help
It's going to be pretty hard to debug without knowing what's wrong. You're pretty much shooting in the dark. -
You'll just need to run a foreach loop to iterate through the $_POST elements and build an array for use with the insert_batch() method. They have examples in their docs for what the format of the data should be.
-
My grandmother used to be almost that bad, but she's starting to get the hang of it now. She now has a laptop that she goes on Facebook with and plays all the games, uploads photos, ... you know, Facebook crap. My other set of grandparents, though, have pretty much zero experience with computers. My grandmother knows how to move the mouse and play solitaire, but I don't think my grandfather has ever even touched a computer. They don't even have cable/satellite TV, just the few local stations. God help me if they ever decide to get internet.
-
Saw this on reddit today, thought you guys would get a chuckle.
-
I believe you want header('location: students.comp.glam.ac.uk/08023190/taxi/userentry.php');
-
I don't see [tt]$sqlquery[tt].
-
It should be $parent->child[0]->tagData
-
Can you post the actual code that defines $sqlquery please?
-
Then obviously the condition isn't being met. What is $sqlquery?
-
PHP + MYSQL: best way to handle connections for autosuggest
scootstah replied to j1982's topic in Applications
Generally you don't ever need to explicitly close a MySQL connection, PHP does that for you. Are you implementing any kind of cache for the autosuggest? It might be a good idea, since they can tie up the database if not done properly. -
I would think $arepasssame should be a boolean.
-
You need to use brackets. if ($sql1==1) { // ... code if statement is true } else { // ... code if statement is false } I would seriously look into some tutorials regarding SQL JOIN's. Whenever you have queries running inside loops, you are probably doing it wrong. Queries are expensive, don't run them needlessly. Also, normally you wouldn't need to query the same table twice, since you should be able to get all of the data you need the first time 'round. For example you are querying the same table several times to get nearly identical data. $sql = mysql_query("SELECT * FROM bids WHERE Quote_ID='$qid' AND DeclienedByCustomer=0 "); $sql1 = mysql_query("SELECT * FROM bids WHERE Quote_ID='$qid' AND DeclienedByCustomer=2 "); $sql2 = mysql_query("SELECT * FROM quotes WHERE Quote_ID='$qid' AND accept_Decline=5 "); $sql3 = mysql_query("SELECT * FROM quotes WHERE Quote_ID='$qid' AND accept_Decline=2 "); $sql4 = mysql_query("SELECT * FROM quotes WHERE Quote_ID='$qid' AND accept_Decline=3 "); $sql5 = mysql_query("SELECT * FROM quotes WHERE Quote_ID='$qid' AND accept_Decline=4 "); You could instead use logic flow and do something like: $query = "SELECT * FROM bids WHERE Quote_ID=$qid"; $result = mysql_query($query); $row = mysql_fetch_assoc($result); switch($row['accept_Decline']) { case 0: // do something break; case 2: // do something break; // ... etc ... }
-
Differences between isset($_GET['']) and !$_GET['']
scootstah replied to 3raser's topic in PHP Coding Help
You can also use array_key_exists which is basically the same as isset() (for array's) except that it will return true even if the value of the key is null.