Jump to content

AMcHarg

Members
  • Posts

    84
  • Joined

  • Last visited

    Never

Everything posted by AMcHarg

  1. Try using an IF statement... //loops their name out while ($user = mysql_fetch_array($getfriends)) { if ($user[username] == $_SESSION['MM_Username']}) { echo "<a href='members.php?user=$user[friendname]'>$user[friendname]</a><br>$img <br>"; } else { echo "<a href='members.php?user=$user[username]'>$user[username]</a><br>$img <br>"; } } Hope it helps.
  2. I'm not sure I entirely understand the question but your SQL is incorrect. You need: $getfriends = mysql_query("SELECT friendname, username FROM friends where friendname = '{$_SESSION['MM_Username']}' OR username = '{$_SESSION['MM_Username']}'")
  3. Yep, just list them all one after the other.
  4. Just use a string replace on the $pagetitle, replacing ".php" with "". Assuming you never have ".php" written into the $pagetitle, this will always work.
  5. $winners.$roundnumber[] = $array[$i]; Does this line actually work? It's meant to be a variable variable... right? I thought you required two $ at the beginning... $$winners.$roundnumber[] = $array[$i]; Might not be connected to the errors you are receiving though.
  6. Oh right, I misunderstood what you meant by entity.
  7. $array = array_slice($array, 0, $amount, false); Simply having array_slice on it's own doesn't work in the same way as it does with shuffle. Edit: Hey you changed it when I was writing the above! Is it still not working?
  8. But it can't be done directly on one of his web pages?
  9. What would be the reason for grouping them in the same entity?
  10. Try the below as an alternative to your method. It should produce a random winner and then remove that player from the array. The same principal will work if more winners are required. $players = array("Player1","Player2","Player3","Player4"); shuffle($players); $winner = $players[0]; $players = array_slice($players, 1);
  11. Shuffle your array, select the first as the winner and then severe that one from the array. Edit: Or where you want more than one winner, select the first however many from the array and then remove them from the array. Shuffling the array randomizes their order in the array, so selecting the first few in the array after it has been shuffled will always pull out random results.
  12. As far as I am aware it's impossible. For what reason do you want to do it anyway?
  13. Ah, I see now. Well that's quite a lot for one question. You'd be better getting the form to store information on a database and having a single php page to extract particular records using a unique id, than creating a new page each time. I'd suggets you probably need to learn a bit about php as I doubt someone will just give you a full, working example in here. It's not quite as simple as just telling you what to do if you have no experience.
  14. Are you asking how to change the link on an html page? Sorry; a little confused. :-\
  15. Right, so you want php to open the file, generate keywords from it's content and then write the keywords to the database, connecting those keywords to that individual CV/person. The idea being that the when a recruiter searches for those keywords then your site will suggest candidates? Also worth considering in your code would be the incorrect spelling of keywords in the search. You'll want to research the below function, where $pdf_data is your pdf file. $pdf_data = file_get_contents($pdf_data);
  16. It's worth your while reading about the MYSQL LIMIT syntax. Example: LIMIT $start_record, $number_of_records_per_page So if you have 100 records and want 10 per page then to show page 5 it would be something like: $start_record = 50; $number_of_records_per_page = 10; LIMIT $start_record, $number_of_records_per_page
  17. Just to clarify, you want your php code to read the pdf file which has been uploaded and take key pieces of information from it to write into a database? This isn't easy to achieve because every CV is different. Your code would need to look for strings following common titles, such as knowing that the person's name is likely to follow the words "Name: ". A better idea would be after the user uploads their CV as a pdf they are then forwarded to a form where your code has "suggested" the inputs in the fields (based on how it interprets the pdf) and asks them to confirm the details. Just some thoughts.
  18. Where are you defining $week in the initial $sql? :-\
  19. Variables in double quotes "$variable", will use the correct value, but in single quotes '$variable' will literally return the string $variable.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.