-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
Can't see any problem? what happens when you echo it?
-
Do you have a link? perhaps its a really simple silly error?
-
In this case perhaps, but die() does not redirect by normal... http://uk.php.net/die something has to be causing it to redirect in that circumstance.. perhaps on error or something?
-
why doesn't it work in IE ? Sounds like a HTML/CSS issue in which case PHP isn't really the answer... try fixing the error? reckon the users would appreciate that more being as IE is a widely used browser...
-
Going back to die() causing it to redirect, it doesn't .. die() basically kills the script and prints out an error message if ones passed. must be something in the rest of the script?? Can't imagine what, it's an odd one...
-
didnt notice the double ?, why do you use it? why not just use like .. ?this=this&that=that ... but that wouldn't effect it as it's within a string. I personally can't see anything wrong with that line at all, but i would advise you switch the quotes. ie... echo '<option value="http://www.zerodefex.net/ccf/redo/pages/admin.php?user=true?UserID=' . $row['id'] . '">' . $row['username'] . '</option>'; .. notice now the HTML is correct and valid.
-
Perhaps its using.. $string=md5(sha1(md5(sha1($string)))); can't imagine that's necessary anyway? md5 does the trick...
-
Show us all the code, must be something causing it to redirect...
-
Try looking at HTML symbols... http://www.w3schools.com/tags/ref_symbols.asp heart is represented as "♥" i believe..
-
what happens in the "protect" function? Try printing out the username and password variables... What is actually printed out when you try and login? Need little bit more information..
-
Say it didnt work one time though, he or the user won't know... Also the ()'s may not be required for it to work, but it's the right way to do it... as revraz says bad habbits...
-
i was going to say pretty much what they said... try: $comment = $_POST['comment']; $query = mysql_query("INSERT INTO comments (comment) VALUES ('{$comment}')"); if (!$query) { print 'MySQL Error: ' . mysql_error(); } else { print 'Comment: <strong>"' .$comment. '"</strong> entered successfully...'; }
-
try replacing the query line with this: mysql_query("INSERT INTO comments (comment) values ('{$comment}')") or die(mysql_error());
-
What error do you get? And what version of PHP are you running on your local web server?
-
Dont fully understand which bit you'd like help with? Adam
-
Think it works pretty much the same, not 100% but... while ($row = odbc_fetch_array($query)) { print 'Field 1: ' .$row[0]. ' Field 2: ' .$row[1]. '<br />'; }
-
By only checkin the username in the query you are still selecting that record, then having to do tests on the password field value to check if you actually needed the record. Quicker way round is to just add password to the query which then only returns records with the right username and password.. Making code neater, easier to understand and most likely saving some load time... If you've been getting an error did you try adding: mysql_query("...") or die( mysql_error() ); ??
-
If oyu mean a sort of true/false return from the mysql_query function you can use: $query = mysql_query("..."); if ($query) { ... } But to be honest I've found it a little unreliable in the past... If you don't mean that, then I don't know what you mean...
-
I'd say discomatt's ideas the best to go with.. Perhaps store the results in a database and then query it for files not matched to the original file list? So like a table called "original_filelist" and one called "used_files".... as you come across a reference to a file enter it into "used_files"... then obivouslly files in "original_filelist" without a match in "used_files" are unused files... Simple? Adam
-
probs better off doing it more like this.. $resource2 = mysql_query("SELECT * FROM users WHERE username='{$_POST['username']}' && password='{$_POST['password']}'"); if (mysql_num_rows($resource2) > 0) { print 'correct password!'; } else { print 'incorrect password!'; }
-
Ah yeah, to form an option of all the states.. foreach ($states['US'] as $state) print '<option value="' .$state. '">' .$states['US'][$state]. '</option>'; (Not checked) and to find the full title after selecting from database: $selectState = mysql_query("SELECT m_country, m_state FROM yourTable"); while ($stateRecord = mysql_fetch_assoc($selectState)) { if ($stateRecord['m_country'] == 'US') print 'US State: ' .$states['US'][ $stateRecord['m_state'] ]. '<br />'; } (Again not checked!) Adam
-
Look into sitemaps...
-
Well that can be quite complicated. Depends how you send the email in the script, would need to look into mail 'headers'... All email services like gmail and AOL have filters to try and filter out spam... I think sending a lot of emails at once probs won't help? Not sure, you'll probs learn from your experience... I don't know if gmail and that have limits... Adam
-
Help Needed With Syntax for Sending/Receiving Post Variables
Adam replied to fp2146's topic in PHP Coding Help
No they'll send the data to the POST array with their script... If they had sent the data to the GET array then there would be added values to the URL in the form of something like.. receivedata.php?something=this&somethingelse=that If thats what you were tryin to ask? Adam -
Could try something like: $highestID = 0; foreach($page['array'] as $c) { if ($c['id'] > $highestID) $highestID = $c['id']; } foreach($page['array'] as $c) { if ($c['id'] == $highestID) { echo 'some stuff'; } else { echo 'some other stuff'; } } It's not that efficient as it needs two loops, I dare say there's another way but.. I dont know it... Adam