Jump to content

spiderwell

Members
  • Posts

    1,008
  • Joined

  • Last visited

Everything posted by spiderwell

  1. theres no while statement, so it isnt looping
  2. maybe, I not sure i know what a cron job is, but event is created on the mysql database and is a bit of SQL that is trigger at times you specify it for example: CREATE EVENT `myevent` ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY ON COMPLETION PRESERVE DO UPDATE `mytable` SET `myfield` = NULL; this sets a column to null once a day. events usually drop after execution the on preserve bit means it doesnt drop the event once executed, so will run daily find out more here http://dev.mysql.com/doc/refman/5.1/en/create-event.html
  3. i thought that was only necessary with file uploads in a form
  4. whats the full code of the page you post to at action="access/"
  5. yeah its like 10% building and 90% making it unbreakable. I am sure it will come back to you quickly!
  6. yeah i didnt look closely enough and if the script isnt changing the category is which is why my code didnt work
  7. yes you would want 2 tables say, one with artists, the other with songs, and use the primary key of artists to link to songs to identify all songs by that artist
  8. php self would work, but that wil stop working at some point if the querystring changes, why not do a substring check for the filename , thus avoiding the querystring. <li><a href="gallery.php?category=Wedding" id="wedding" <?php if (substr($currentPage ,'gallery.php')) {echo 'class="selected"';} ?>>Wedding Hair</a></li>
  9. perhaps if you used activeX? im not sure really, but maybe also a link to where you expect windows explorere to be: <a href="c:/windows/explorer.exe">clicky</a> if it works in browser why not use that
  10. the variable is only defined if this statement is true, i think if($results = mysql_num_rows($sql_query) != 0) and im a bit confused by that statement in itself anyways, what are you trying to do here exactly?
  11. wow 4 year old thread bump! i just learnt how to do this last week by reading the sticky located here, its about halfway down the first post: http://www.phpfreaks.com/forums/index.php?topic=31047.0
  12. everytime you use the header file you are implicitly setting the Session userid to 0, i wouldnt bother to do this, its either going to be filled with the users ID or not exist (ie login has failed) in effect you are logging them out on every call of a page with the htmlheader.php included in it just do: <?php if(!isset($_SESSION)){ session_start(); } then put the whole login script into an if statement that only triggers if form is posted.
  13. im pretty sure you can do it as simply as this <a href="ftp://mydomain.com">click here</a> if your domain name is set up correctly.
  14. mmmmm ok blobs are binary large object, essentially what an image is if its stored into a db, alternatively images can be just saved on the server in a folder. first off you should build a search form, that posts to a results page (or itself) then pull the information from the form, and take that to put into your mySQL search statement. then parse the results accordingly roughly something like this: $search = $_POST['searchinput'] $sql = "SELECT * FROM Tbl_BLah WHERE `Something` LIKE '%$search';" //i skip now to results loop, assume $row is my dataset aray echo "<img src='" . $row['image'] . "'>"; echo "<a href='details.php?id=" . $row['id'] . "'>Click for more info</a>"; echo "<br>" . $row['smalldescription'] ;
  15. what is the code on the index page look like,I assume you are starting the session on that page too ?
  16. create an event on mysql directly to trigger once a week?
  17. I not sure I folow what you are after, do you want a link that links via FTP instead of http? Not sure where a form would come into that. Do you want a link that goes to a website and then that website requires you to login to it?
  18. don't listen to your friend or anyone when it comes to how hard coding is, I find its different for everyone learning, and for me, PHP was VERY easy to learn, picked it up in about a week, but thats with a background of scripting in ASP for many years. For me, its all down to logic, and if you remember that its pretty easy really. THe problem I have I dont know half the commands available in PHP, and am probably missing some great little features. Also when i have 2 tables that share a unique ID, i tend to make the second table with an ordinary incrementing ID as the primary key and another column with the foreign key (although I am very bad at actually making it a foreign key, i just name it user_ID or something that indicates its an ID from another table) oh and everytihng I have ever learnt in code has pretty much come via google!! I bought the odd book years ago when I first started out, but the rest is just out there waiting to be discovered
  19. personally i wouldnt bother (I'm lazy), but i would say it better practice to declare, as it eliminates the possibility of what you see happening locally happening on the live site.
  20. $_SESSION['user'] is holding an email address, and therefore cannot be inserted into an integer field in a database, whereas the ID can
  21. if the relationship between tables is 1 to 1, is there really any need to have a second table? thats what i am thinking now, that said maybe its more efficient to have a small table for logging in.......
  22. yeah what confused me most was that I thought a count was necessary, when really its a sort of boolean search, there either is or isnt a curse word, one instance will make it true. thats why my final snippet was much shorter, as no counting was involved
  23. as per the last post, slot it in here on the login.php: list($user_id,$user_email) = mysql_fetch_row($result); // this sets variables in the session $_SESSION['user']= $user_email; $_SESSION['id']= $user_id [\code] then on the about me insert, do as Justin posted only substitute $_SESSION['user'] with $_SESSION['id'] personally i think emails work just as well as a unique identifier so you could still do it with the email address.
×
×
  • 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.