Jump to content

spiderwell

Members
  • Posts

    1,008
  • Joined

  • Last visited

Posts posted by spiderwell

  1. I guess I am addressing the members of the forum who are better than me at php, which is probably most of you.

     

    I just wondered if my responses were sometimes better off not made, as I can often answer things not quite correctly, mostly down to my knowledge not being the best. my responses can be often rambly and missing correct names and so on, such as this great example here:

     

    http://www.phpfreaks.com/forums/index.php?topic=354288.0

     

    I love trying to help out people who are stuck and often find it benefits me as much as the person posing the questions.

     

    I'm not sure where I am going with this post really, I guess what I am trying to say is, am I making a worthwhile contribution and where is my free beer?  ::)

     

     

  2. internet can cause many mis understandings, anyway have you got it working now?

     

    does the edit profile page double check against a session variable, or can i just change the querystring to profileUpload.php?username=notme-someoneelse

     

    thats where the security needs to work

     

    **stop posting everytime i submit theres a new post making my response less and less relevant  :P**

  3. I would imagine that when a user logs in, you create some session variables to identify that user?

     

    lets say im user 1, you might set $_SESSION['userid'] = '1', and when i view a page which is profile.php?ID=1 which is my profile, you have a small statement that checks if both match and if so, show an edit button, otherwise not. So if i went to profile.php?Id=2 it wouldnt show me an edit button.

    however it would be good to have a another similar check on the edit profile page to ensure that it the right person editing the right profile.

     

     

  4. first thing is make a public profile page.

     

    you could add a little if statement at the top of that page, that checked if user viewing profile is owner of siad profile and redirect to the editable version.

     

    Alternatively you could keep both seperate and have the editable version only available from the user's menu under a button/link like my profile.

     

    The important thing is to ensure that logged in user only can access their own page, and not be able to edit other users.

  5. if nothing == nothing then its true!

     

    if '000' === '000' if EXACTLY the same then true

     

    its like when you have a 0 return for some function which can be seen as false and not 0

     

    so you use 3 equals signs!

     

    (i think i didnt explain very well but I hope you get the idea)

  6. You have to make your own opportunities sometimes too. I got some paid work from this forum just last week, in the freelance section.  just casually reading, saw one that i knew i could do easily, so thought I would send an email,  few exchanges later resulted 1 hours work for £30!

     

    Now if i could convert that rate into a 40hour week...

  7. also load weight of the page should be considered (if thats the right name)

    suppose you increase this page to have 20 images, and each large image on the right is say 800k thats a page with 16meg to load! not desirable at all. you could use iframe and avoid any overlaying of divs, and just use thumbnails to target the iframe. another alternative is a bit of javascript to update the large image src so it only loads the image needed(clicked on)

     

  8. hi all, having a problem with my multi table sql statement. I have 4 tables, vehiclesales,vehiclemake,vehiclemodel and vehicleimages

    I am trying to return rows from vehiclesales and join vehicle make and model and images onto it. now the make and model work fine as its a straight forward 1 to 1 but vehicle images can be many rows per vehiclesale, and I only want it to return 1 image, doesnt matter which one really. my statement works fine until i add in the vehicle images bit, i was using inner jons for all but i tried using left and right but it doesnt seem to make any difference, as soon as i add the vehicleimages join, instead of 4 unique vehicles i get them repeating each with a different image in the row. What join would i need to get just 1 image per vehicle without repeating the vehiclesales.

    SELECT * FROM vehiclesales LEFT JOIN vehiclemake ON vehiclesales.makeid = vehiclemake.ID LEFT JOIN vehiclemodel ON vehiclesales.modelid = vehiclemodel.ID LEFT JOIN vehicleimages ON vehiclesales.ID = vehicleimages.salesid ORDER BY `vehiclesales`.`ID` DESC LIMIT 30
    

     

    I have read some join tutorials and it seems that left join should do the trick but alas not.

     

    any suggestions much appreciated

     

  9. mmm well not really i tend to build things in php that i need as i go. I don't care for them(cms systems) really, much prefer making code, however that said, i am often re inventing the wheel and its never quite a perfect circle when i do it either!!

    most cms out there which are popular are pretty good, but nothing covers everything, if you know what i mean.

    only one i have ever used to make a site is wordpress, i have maintained sites which use drupal. thats about it.

×
×
  • 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.