
Mad Mick
Members-
Posts
72 -
Joined
-
Last visited
Everything posted by Mad Mick
-
Or you can store the files on the server - jobseeker uploads his CV. The recruiter then accesses only those CVs which you have allowed. Just a suggestion but sounds more user-friendly and modern than sending emails.
-
As your function has no return value it's just: processforms();
-
Looks like you're mixing your POSTs and GETs. action="admin.php?edit='.$_GET["field"].'&action=true will create two GET variables 'edit' and 'action' but you are checking for $_POST['action'] and $_POST['edit']
-
$rows['username'] is updated everytime the while loop runs bringing in the next row from the database. So you are effectively just checking against the last line of the database not all of them. You can either put the error checking within the while loop or (better in my opinion) lose the while loop and do the error checking the way I suggested. Oh and "Succesfull" is spelt "Successful" - sorry to be petty...
-
[SOLVED] Echoing arrays through a for() statement
Mad Mick replied to bloodgoat's topic in PHP Coding Help
Unless what you are doing is urgent I would get on and set yourself up so you are confident in your hosting. I have my own linux web server test setup on an old PC chucked away from work but have used www.awardspace.com as a testbed as well without any problems. Writing PHP etc. is frustrating enough on its own without the additional hassle of not knowing whether your hosting service is working properly... -
What doesn't work? Why not check for the existence of $username or $email with a SQL query: $result=mysql_query(SELECT * FROM users WHERE username='$username'); $num_records=mysql_num_rows($result); If $numrecords is greater than 0 then username in use. Not sure how you are doing it.
-
Use print_r($temp) or print_r($City) to see what's in your arrays - will help you track in down...
-
[SOLVED] You have an error in your SQL syntax
Mad Mick replied to almightyegg's topic in PHP Coding Help
Where does $result3 come from? Sure it's not from that query? Do $id and $f definitely have a value? -
[SOLVED] Newbie - Trying to read from a second table
Mad Mick replied to colinsp's topic in PHP Coding Help
You commented out the $village definition: //@$village = addslashes($_POST['vil']); -
How do you mean "will not open for writing". The 'w' will helpfully wipe the file first. Maybe you want 'a' for append?
-
Newbie Help needed - preg_match regex line break issues!
Mad Mick replied to youngnickodemus's topic in PHP Coding Help
Tried that here, and seems OK: http://erik.eae.net/playground/regexp/regexp.html I'm no regex expert though - use it v rarely so can't help much more... -
[SOLVED] Newbie - Trying to read from a second table
Mad Mick replied to colinsp's topic in PHP Coding Help
Try: $sql1 = "SELECT * FROM records where church='$village'"; So you are passing back a number - unique - to the form. But you are using this in the sql query: $sql1 = "SELECT * FROM records where church=$village"; so church is a number? Not sure whats happening but the variable names are a bit confusing... Try using a standard notation like church_id or church_name and try to organise variables a bit i.e. you might easily assume a field called 'church' contains a name of a church not a number and not something to do with a village. Try to keep field names common between tables i.e. the church ref number should be called church_id in both tables. Only suggesting all this as you say you are new - its best to start off structured and organised, it will make life easier later! -
Newbie Help needed - preg_match regex line break issues!
Mad Mick replied to youngnickodemus's topic in PHP Coding Help
You missed the space/tabs between the span open tag newline and the £ -
Sounds like you answered it yourself - keep looping until file is not ., .. or thumbs then break out of it.
-
Does it not matter which file it is? If not then just lose the loop. Not sure what you mean otherwise... Otherwise keep the loop but load images into array then search it for the image you want.
-
Problems displaying user specific data from a MySQL table
Mad Mick replied to WillUK's topic in PHP Coding Help
With respect to: while($row = mysql_fetch_array($balance)) $balance is the number of rows, this function wants a query resource i.e. $result = @mysql_query($query); Also I'm a bit confused what the general problem is since you have got $_SESSION['balance'] from your first login script -
For starters does it really need to be so flexible? Can you not just hard code the page you want to go back to in the header() function? If not then the method you are using is fine. If the page does not load then echo what the header() function is supposed to be acting upon so you can see where it thinks it should redirect. I'm sure it can only be typos etc...
-
Ah sorry - I'm thinking of PHP_REFERRER. I'll get my coat...
-
Its never a good idea to rely on PHP_SELF anyway even if you do get it to work. Why not save the address as a session variable or GET/POST variable then extract it to use for the header() function.
-
$url = "<a href=\"bankcapupgrade.php\">UPGRADE</a>";
-
Tested this code out and all options are displayed, nothing missing... Don't try to fiddle the database but see if you can understand why a row is missing.
-
Learning array functions need help and examples please.
Mad Mick replied to redarrow's topic in PHP Coding Help
Are you reading the right manual? This is the array_diff example. I have never used it before but it seems clear to me what it does from the example. <?php $array1 = array("a" => "green", "red", "blue", "red"); $array2 = array("b" => "green", "yellow", "red"); $result = array_diff($array1, $array2); print_r($result); ?> Result: Array ( [1] => blue ) Yes there are a few pitfalls but it is enough to be aware of them now rather than get in too deep or you will never progress... -
There's only one query for appetizers shown here. Are soups and salads in the same table? If they are then you need to distinguish them from appetizers to be able to extract what you want. If they are in a separate table then you just need a second query like you did the first.
-
Learning array functions need help and examples please.
Mad Mick replied to redarrow's topic in PHP Coding Help
To be honest I think the php.net examples are easier... For me the best thing is to have an awareness of what is possible with arrays and then when you need to do some array work have a look at php.net for the details. -
Well this might do it - could probably be tidied up for the optgroup bits but hopefully it gives a good idea... $sql="SELECT * FROM tablename ORDER BY groupname"; $result=mysql_query($sql); $oldgroup=""; $first=1; while ($row=mysql_fetch_assoc($result)){ if ($row['groupname']!=$oldgroup){ if (!$first) echo "</optgroup>\n"; echo "<optgroup label=\"".$row['groupname']."\">\n"; $oldgroup=$row['groupname']; $first=0; } echo "<option value=\"".$row['id']."\">".$row['name']."</option>\n"; } echo "</optgroup>";