fly904
Posts
-
Maths magic! Amazing answer -
The MastersThe only thing worse than golf on the TV is golf on the radio.
If at first you don't succeed, you're not Chuck Norris.
-
Broken linkThe "Mobile" link at the bottom of the page redirects to a 403 - Forbidden: Access is denied page. http://www.codeproject.com/MasterPages/?display=Mobile[^]
If at first you don't succeed, you're not Chuck Norris.
-
Redirect after executionIn the PHP documentation[^] it actually quotes:
php.net wrote:
Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP.
Two solutions:
- Have it (the header) at the top of the page before you output anything to the browser.
- Use Output Buffering[^] to hold the output before it is sent to the browser.
If at first you don't succeed, you're not Chuck Norris.
-
recursive array searchThen there would appear to be something wrong with your logic.
nhsal69 wrote:
if (((isset($index) AND ($it->key() == $index)) OR (!isset($index))) AND ($it->current() == $needle))
If at first you don't succeed, you're not Chuck Norris.
-
recursive array searchnhsal69 wrote:
return $aIt->key();
echo $aIt->key();
Is there any reason why you are returning and then outputing? The output code (echo) is unreachable.
If at first you don't succeed, you're not Chuck Norris.
-
To UKCPians: A Public Safety WarningAh yes, Calne, not been there before. However, this is getting weird now, I plan to take the GF to see the White Horse at Cherhill on Thursday, if the weather is nice. She likes White Horses, something about Deftones.
If at first you don't succeed, you're not Chuck Norris.
-
To UKCPians: A Public Safety WarningReading = West Country?
If at first you don't succeed, you're not Chuck Norris.
-
To UKCPians: A Public Safety WarningCastle Combe? It would be very weird if it is.
If at first you don't succeed, you're not Chuck Norris.
-
To UKCPians: A Public Safety WarningWhere abouts in the west country?
If at first you don't succeed, you're not Chuck Norris.
-
Project Management CMS -
Small Town Credit Card Transactions (The Cake is a Lie!)If I waste my day playing Portal tomorrow, I'm blaming you.
If at first you don't succeed, you're not Chuck Norris.
-
Gold for Britain!Britain + Tea Tray = A No-Brainer, no matter how we use it!
If at first you don't succeed, you're not Chuck Norris.
-
How to redirect ?You are more than likely outputing stuff to the browser before you set the header (redirect), which isn't allowed (read the docmentation[^]). You should also call
exit;
after you set a redirection header (also described in the documentation), to make sure the script is stopped.If at first you don't succeed, you're not Chuck Norris.
-
how to change PHP codewartotojas wrote:
how to output query results the same way as they are in while loop?
Many of the most basic tutorials demonstrate this. This Tizag Tutorial[^] is a good example.
If at first you don't succeed, you're not Chuck Norris.
-
So, I just lost my job.Andi Osho is going to be at my student unions Comedy Night later this month. Should be good.
If at first you don't succeed, you're not Chuck Norris.
-
Timestamps... Can't Seem to get it to work.....You are still not sanitizing your data inputs, to protect you from SQL Injection Attacks[^]. Use: mysql_real_escape_string[^]
thebiostyle wrote:
"".$get_user_data['username'].""
That does nothing useful. You don't need the empty strings either side, they do nothing, just have the variable.
thebiostyle wrote:
$start_passsess = $_SESSION['password'] = "".$get_user_data['password']."";
Are you sure you want to keep the hashed password as a session variable?
If at first you don't succeed, you're not Chuck Norris.
-
PHP Member Pages... Need major help...thebiostyle wrote:
Yes, I know that, but in an earlier post, it said that I was right to use the "GET" method.
thebiostyle wrote:
Okay... Thanks, it now shows the page and loads the information... But how do I fix the... "profile.php?username=USERNAMEOFCHOSENUSER&user=IDOFCHOSENUSER" to "profile.php?user=IDOFCHOSENUSER"
ALL the inputs in your form are sent to the URL, if you don't want them in the URL then don't have them in the form!
If at first you don't succeed, you're not Chuck Norris.
-
PHP Member Pages... Need major help...Before you continue, I suggest you tidy up your code and get into some good practices.
thebiostyle wrote:
include_once"CONFIGPAGE.php";
Encapsulate the target file in brackets:
include_once('CONFIGPAGE.php');
. And use single quotes, as it is quicker.thebiostyle wrote:
$fetch_users_data = mysql_fetch_object(mysql_query("SELECT * FROM `members` WHERE username='".$_REQUEST['username']."'"));
$fetch_users_id = mysql_fetch_object(mysql_query("SELECT * FROM `members` WHERE id='".$_GET['user']."'"));You need to check first whether or not 'user' and 'username' are set. If they aren't then it will throw errors.
$username = isset( $_REQUEST['username'] ) ? $_REQUEST['username'] : '';
$user = isset( $_GET['user'] ) ? $_GET['user'] : '';You seriously need to sanitise your data inputs to protect from SQL injection attacks. Use the mysql_real_escape_string[^] function.
$username = mysql_real_escape_string( $username );
$user = mysql_real_escape_string( $user );Then use those sanitized values as your SQL inputs.
thebiostyle wrote:
echo "".$fetch_users_data->username."";
There is no need for the
""
around the value. It will work just fine without it:echo $fetch_users_data->username;
thebiostyle wrote:
There is no need to have an onload attribute, with
$_GET['user']
. It is also bad practice to use bgcolor. Use the style attribute instead, or better still use CSS classes.thebiostyle wrote:
</div>
</table>From what I can see you haven't opened a div; therefore there is no need to close one. Note that you should also have a DOCTYPE which you should work from. http://www.w3schools.com/tags/tag_DOCTYPE.asp[^]
If at first you don't succeed, you're not Chuck Norris.
-
PHP Member Pages... Need major help...thebiostyle wrote:
<form action='profile.php' method='GET'>
Do you know what the GET method of submitting a form actually does? Every input within the form, has their value displayed in the URL on the action page (the page the form is submited to). E.g.
<form action="submit.php" method="get">
<input type="hidden" name="fieldName" value="fieldValue" />
<input type="hidden" name="fieldName2" value="fieldValue2" />
</form>Would direct to
submit.php?fieldName=fieldValue&fieldName2=fieldValue2
If at first you don't succeed, you're not Chuck Norris.