premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
In what context are they being used? There are correct ways to use globals and incorrect ways. Maybe a code example will help clear up what your intentions are.
-
I might just be stupid - php/mysql problem. please/thx in advance
premiso replied to flemingmike's topic in PHP Coding Help
For anyone helping on this topic, it is double posted. http://www.phpfreaks.com/forums/index.php/topic,240254.0.html Please use that one as it contains more updated information than this thread. Just an FYI. -
$query = "SELECT gymnasts.firstname, gymnasts.lastname, meet.meethost, meet.meetname, meet.meetdate, meetresults.level, meetresults.vault, meetresults.vaulplace, meetresults.unevenbars, meetresults.unevenbarsplace, meetresults.beam, meetresults.beamplace, meetresults.floor, meetresults.floorplace, meetresults.aaplace, meetresults.vault+meetresults.unevenbars+meetresults.beam+meetresults.floor AS AATotal, meetresults.agegroup, meetresults.ID, meet.meetid FROM meet INNER JOIN (gymnasts INNER JOIN meetresults ON gymnasts.gymnastid = meetresults.gymnastid) ON meet.meetid = meetresults.meetid WHERE meet.meetid=".$_GET['meetid'] . " ORDER BY meetresults.`level`, AATotal DESC"; Should work.
-
It is doing exactly what you told it to do. while( $tagging = mysql_fetch_assoc( $tagquery ) ) { $temp = explode(",",$tagging['tagging']); $tags[$tagging['tagging']] = $temp; } You explode it, then do nothing with the exploded value. And why are you using the original tagging data as an index, I would use the game name for the index, but that is just me.
-
Along with that, post how you changed it to make it "break" (the actual SQL you tried).
-
Agreed. This is not a lie, just he was just a substance of a bad book and never bothered to update himself on new security tactics. I used to do that too for my sites, now I know how sessions work and I store a hash for "loggedin" in a cookie if remember me is checked and this is stored in the DB for that user. If his time expired or that session was changed it is trashed. If he comes back on validly then I regenerate a new hash at that time and update the cookie. But as stated, he did not lie. He is just mis-informed.
-
Problem with php mysql - please help if you can.
premiso replied to flemingmike's topic in PHP Coding Help
2 items in your loop do not have an id set is what it seems like to me. Check your raw data in the database and make sure that the id column is populated properly. -
Do you own both the domains? If so it can be done by including the file. You can also do a 301 redirect from example.com to test.com. If you just want the end result, you can always use file_get_contents and just pull that file (web or on the server) into that file.html. I am not really sure what you are after though. Let me know if you need more information, and I may be able to find out for ya.
-
$prodass2 = (isset($_POST['prodass']))?$_POST['prodass']:null; Should remove those notices. They are showing up because the form probably has not been posted. This will prevent that error if that is the case.
-
Mixing outputted html with php is not very good practice, especially if you need to output it before header calls. You should store output in a string and output it at the end of the script to avoid such issues. Here the header is it needs to be before any data is output to the screen. So right after <?php and the <?php needs to be at the very top of the script. You may have to re-work your code to get this to work, by either re-thinking the logic and figuring out a way to get that header redirect up top, or by storing output into a string then outputting at the end of the script.
-
http://sourceforge.net/projects/php-proxy/ Googled terms "proxy php script" As far as work banning you, if your work uses remote desktop connection they must really not trust you. That and most works block proxy sites, so yea. Do not be surprised if it gets blocked in the future once they figure it out. As far as working off the network at work, look into using your own laptop with a KVM switch and a Broadband Air Card. Guaranteed that your work cannot monitor that, other than your logs which they would have to get a court order to have them wireless supplier open their logs to them. As a disclaimer, it is unethical to do that and I do not recommend or condone such acts as it could get your fired. I am not to blame for you using these techniques etc, use at your own risk.
-
Yes. That gives permission to the owner only. You would need to give read access to the public (the last 0) I am not sure what that is (5 or 6).
-
[SOLVED] how to put html into a string; problem with quotes
premiso replied to sillysillysilly's topic in PHP Coding Help
I think that was mal-information on my part. I thought they were doing it with magic quotes, but just magic quotes will be depreciated from what I gathered. -
[SOLVED] how to put html into a string; problem with quotes
premiso replied to sillysillysilly's topic in PHP Coding Help
\' add a \ before the single quote that needs escaping. Do not use addslashes it is not the solution. (I believe it is also going to be depreciated in PHP 6 but not 100% sure on that.) It is not, magic quotes are. Sorry for the confusion on that portion. EDIT: In the code I posted, if it wouldnt mess up like it did, should be correct. -
[SOLVED] how to put html into a string; problem with quotes
premiso replied to sillysillysilly's topic in PHP Coding Help
Escape the single quotes: <?php $string = '<DIV id="richBorder"> <TABLE cellspacing="0" cellpadding="0" width="100%" border="0"> <TR> <TD><table width="98%" align="center"> <tr> <td><table width="100%" cellspacing="0"> <tr> <td width="65%"><a id="PropertyHeader_propertyNameLink" class="subtitleXLarge" href="http://www.gables.com" target="_blank">Gables West Avenue</a> <a id="PropertyHeader_mapit" href="javascript:__doPostBack(\'PropertyHeader' . $mapit . '\',\'\')" style="font-weight:bold;">(Map It)</a></td>'; EDIT: Something is flaking out and it is not posting correctly =\ but the above should work as long as you make sure to put the single quote before <DIV id= portion at the beginning. EDITEDIT: Error fixed, the above should work right. -
[SOLVED] PHP problem (Error) Help, please :)
premiso replied to ryanwood4's topic in PHP Coding Help
Put the html code before the <center> and after the ?> It is causing your error as that is "output" which is not allowed before a header call. -
Use .htaccess to set the error document or modify the apache http.conf file and set it there (.htaccess is probably a safer and easier bet). Google htaccess errordocument and you should find examples. EDIT: Re-read the post: Additionally, this can indicate a problem with your server. Verify that image is there and that the directory is accessible via web, if you have it setup to not be accessible via web you will need a script that can locate and readfile the image you want to grab.
-
On occasion. Feel free to PM for contact info.
-
Edit to the above: if (mysql_query($query)) { echo "Your budget has been updated! <br> Would you like to make another modification? <a href='budg_retrieve.php'>Yes</a>"; }else { die(mysql_error()); } That may fix it, as you were checking if that did not run display the success message.
-
[SOLVED] PHP problem (Error) Help, please :)
premiso replied to ryanwood4's topic in PHP Coding Help
You have output before the header call. Check that your script does not have a whitespace before the <?php (As this will cause issues). -
You would put your PHP code above the output, outputting php as you go is not a "Great" practice. It is far better to output after the processing or store the output in a string and echo that one statement out at the end. A "bandaid" for this issue is ob_start but I would suggest fixing your code to flow properly.
-
Honestly it looks fine, as you said, you have tried the (double) cast of $amount? A small change I would recommend: if (!mysql_query($query)) { echo "Your budget has been updated! <br> Would you like to make another modification? <a href='budg_retrieve.php'>Yes</a>"; }else { die(mysql_error()); } That could be causing some issues, given the semicolon after an if. If that fixes it great, if not, than I do not know what to tell you. I cannot re-create this issue, and my code posted is pretty close to what your code is (as far as I can tell).
-
PHP in itself is a templateing engine. No need to use a template system, when php already is one.
-
The way you had it originally is correct. What you want to do is explode the search criteria at the space, then create a query based off of that. $search = $search . " "; // add a space so in case of 1 word this should work. $searchArr = explode(" ", $search); // split variables into separate words. $search = array(); foreach ($searchArr as $keyword) { if (!empty($keyword)) { $search[] = "`keywords` LIKE '%{$keyword}%'"; } } if (count($search) > 1) $search = "(" . implode(" AND ", $search) . ")"; else $search = $search[0]; // no need for the implode. $query = "SELECT * FROM sites WHERE {$search} ORDER BY totalrating DESC"; Give that a try and see what comes of it.