-
Posts
1,008 -
Joined
-
Last visited
Posts posted by spiderwell
-
-
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?
-
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 **
-
again i dont have it with me, ill have to come back when i get home.
-
ok seems i have missed out some bit, i will have to come back to this as I dont have it here with me right now
-
yes sorry that is my mistake, in the database there are some french characters still, is there a way to find and replace an entire table/database?
-
i thought I had provided all the information?
-
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.
-
PHP simply outputs content to the browser. In your case, it would output the JavaScript contained in your else statement. Wether it *runs* or not depends entirely on your JavaScript code.
you can redirect in php, so maybe you dont need javascript at all?
-
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.
-
the php if statement should work just like any other time you use one, just in this instance you are telling php to output javascript, there is no reason why it would run both.
-
thats the very beer i had in mind, although its name does conjure up images not so beer related
-
As random as spiderwell's comment is, he actually said the right answer:
keeping this for signature!
-
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)
-
Yuengling lager for me and I'm set. Nom nom nom.
must be a thick brew if its nom nom nom and not glug glug glug
i gotta say i love the belgian white beers!
-
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...
-
perhaps new forum handle of emperorphilip..
well done
-
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)
-
proabably a bit late but i would say no to converting images to jpgs if gif or png, due to jpg inability to do transparency.
-
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
-
where does teh email body break? is it always at the same point?
try having it echoed out in the page as you debug, it should pinpoint a bit better for you I hope
-
well i cant add much, other to say that this could be achieved in almost all scripting/programming languages, so I suggest you use the one you know best!
-
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.
-
this isn't even programming is it, just plain old mathematics?
-
I'd do anything for your wife :o
I jest.
I moved successfully so the offer still stands
my contributions to helping others
in PHPFreaks.com Website Feedback
Posted
good reply! I think i was trying a little bit to get the answer in first, but like you pointed out, quality is better than quantity. roll on the tipping point