Reputation: 12 Tradesman
- Active Members
- Active Posts:
- 768 (0.57 per day)
- 31-August 11
- Profile Views:
- Last Active:
- Apr 19 2015 03:25 PM
- Dream Kudos:
Posts I've Made
Posted 20 Nov 2014Hey guys I know this is VERY OLD, but I've been researching C++ and pointers have always got to me. So I've looked back at this for educational purposes ONLY because as one person here stated worrying about machine code is ridiculous in most cases.
In any case I understand the memory buffer part and how the CPU jumps to the start of the array address (seen in the code at the top of this post) and it then executes what's there.
The part I don't understand is HOW THIS IS HAPPENING with
((void (*) (void))buf)();
Can someone please read this to me verbally that really knows what they're doing? I'm trying to go through this in my head sooo:
There's a giant like void but it's being casted to just a pointer with (*) and then casted again to (void) and then buf)();
What's going on here? I feel like I just don't understand verbally or otherwise HOW this is using pointers etc. to make the CPU jump to the said memory buffer. Thank you guys so much!
On the server-side you might investigate UPDATE TRIGGERs, together with log-tables - to write the username, date/time, field-name, old-value, new-value. (UPDATE triggers may or may not be helpful in this process.)
If you are trying to note every change to the database then this will quickly escalate into a v.large task. It is best to concentrate on a handful of significant fields if possible.
Complicated yes I fully agree with you friend lol. I'm actually someone that can be good at thinking of complicated algorithms like this because I fear in this case friend Triggers won't work. I believe triggers only work for things IN the MYSQL database. I suppose you could update columns somehow called has_change_xyz as you suggested but this seems sloppy as usually triggers are intended for other things like summing up data etc. and not for something like this to my knowledge. I have a decent idea in my head and I'd be more than willing to show a solution for email updates via changes like this and maybe you can think of improvements?
In this case the project I'm being required to work will REQUIRE that this be a feature somewhere along the line.
Posted 14 Jul 2014Jon thanks I'm not asking about how to update the user input etc. I already have a form that does this and it works just fine, rather when the user uses the controls to update everything the drop downs for True False etc. change made to EXISTING vales in the table that users can edit need to be recorded.
When these changes are recorded they need to be emailed to a list of emails (admins) about the updates/edits that occurred.
I also know how to email the admins too what I'm asking about the best way to acquire the long string of changes/edits that a user could potentially change and change one a few or all variables for a given item.
So for example: I have a MYSQL table that contains the following columns for houses:
has_ac, has_tub, has_atrium, has_pool, has_closet, additional_comments
For simplicity lets say the has values are boolean and additional comments is just a TEXT column. A user can than change EXISTING values so BOB logs in and there's a Form (again I'm not asking about how to update the values via a form) I know how to do this.
In any case Bob logs in and he wants to change some values on a house (he's doing an edit)
He goes to the Edit listing page and changes some values around he changes has pool from true to false and has_has_tube from false to true. He also adds some comments. He clicks the update button. Now I know how to update this via mysql but what I'm asking is at that point I would like to have an email dispatched to admins that says something along the lines of;
"Attention Admins Bob updated XYZ house values: Has Tub To True, Has Pool To False, And additional_comments were added".
The problem with this idea though is if while Bob is on the same edit page and before he submits that page what if he changes back has_tub to false? You would need to add that to the algorithm so it's removed from the concatenated string since no changes were made. This gets VERY COMPLEX.
Another way to do it is comparing values already in the MYSQL table to values submitted AFTER the form is submitted and creating a string that way. I'm trying to figure out an efficient way of doing this though. Do you have any ideas?
Thanks Friend I hope this helped explain what I want.
Posted 10 Jul 2014thanks ctbweb and artificial soldier. You've answered my question. I know. Session poisoning can pose a real threat but that shouldn't be a problem with my configuration. Also you're right php scripts aren't pages but server code lol I see your point(s). Thank you guys for the help!
- Member Title:
- D.I.C Addict
- Age Unknown
- Birthday Unknown
- Click here to e-mail me
adn258 hasn't added any friends yet.