These are chat archives for FreeCodeCamp/HelpJavaScript

10th
Jun 2018
Joseph
@revisualize
Jun 10 2018 01:27
@sjames1958gm Do you know HTACCESS?
Bjorn van de Peut
@bjorno43
Jun 10 2018 04:23
@revisualize I know it a bit
Joseph
@revisualize
Jun 10 2018 04:23
@bjorno43 I got it kind of worked out.
Bjorn van de Peut
@bjorno43
Jun 10 2018 04:23
Ah cool :)
Joseph
@revisualize
Jun 10 2018 04:23
if you remove the &t=90 that makes the gif 1x1px
the &t=### changes the size and adds the text for testing.
Bjorn van de Peut
@bjorno43
Jun 10 2018 04:25
That doesn't tell me much.. I see my ip, some RGB values and some unknown values to me, haha
Joseph
@revisualize
Jun 10 2018 04:25
Yeah.
You can change the RGB to any hex color you want.
@bjorno43 That's the front end for a project that I'm working on.
Bjorn van de Peut
@bjorno43
Jun 10 2018 04:26
Ah I see. But why would you need htaccess for this? I mean, I'd probably do it with Imagic or something
Though I think that's PHP only.. not sure
Joseph
@revisualize
Jun 10 2018 04:28
@bjorno43 Imagic?
@bjorno43 You do understand that this dynamically generated image is just the front end for a larger project?
Bjorn van de Peut
@bjorno43
Jun 10 2018 04:29
Ye I do. Imagic is a library that allowes you to dynamically create and / or edit images. Even gifs
Joseph
@revisualize
Jun 10 2018 04:30
Link?
I use it myself in one of my fun projects. It's rly quite easy
Joseph
@revisualize
Jun 10 2018 04:32
I'm using imagecreatetruecolor() , imagecolorallocate()
header("Content-type: image/gif");

imagegif($img);

imagedestroy($img);
@bjorno43 The most important thing for me to capture is that c id and the s id and pass those off to another application.
Bjorn van de Peut
@bjorno43
Jun 10 2018 04:33
Hmm. In what way do they have to be passed? Inside the image or just as variables like request headers?
Perhaps it's easier if you just explain what you're trying to achieve :smile: PHP is like my main programming language, so I know quite a lot about it
Joseph
@revisualize
Jun 10 2018 04:35
variables.
I'm trying to dynamically create images and then log when that image was accessed.
Bjorn van de Peut
@bjorno43
Jun 10 2018 04:36
Alright. How are you saving the logs? MySQL database?
Joseph
@revisualize
Jun 10 2018 04:36
No idea yet.
Maybe.
crap. I need another variable.
Bjorn van de Peut
@bjorno43
Jun 10 2018 04:39
Hmm. What I would do is use Imagick to create the image. It gives you a lot of options and freedom to work with those images. Then, after creation, just save the data somewhere. A database is probably best as it's a whole lot faster than simple text or ini files for example. After that you simply create a script that automaticly updates the database when the image is accessed
Joseph
@revisualize
Jun 10 2018 04:40
Why would I use Imageick when I have what I need for the front end working?
Bjorn van de Peut
@bjorno43
Jun 10 2018 04:41
That's why I asked why you needed htaccess. Because htaccess is not 100% reliable
Joseph
@revisualize
Jun 10 2018 04:42
@bjorno43 I got it kind of worked out.
My .htaccess issue earlier isn't an issue anymore.
Bjorn van de Peut
@bjorno43
Jun 10 2018 04:43
Ye I know :P That didn't tell me if you no longer used it or not. Just that you figured it out, haha
Joseph
@revisualize
Jun 10 2018 04:43
I got it worked out.
Not only did I tell you that I got it worked out I showed you an example of my project working.
Bjorn van de Peut
@bjorno43
Jun 10 2018 04:44
Right. Maybe just a misunderstanding then. My apologies :)
Joseph
@revisualize
Jun 10 2018 04:44
@bjorno43 I know you're trying to help. But, .htaccess issue that I had earlier... Wasn't actually an issue that I needed to focus on and I rewrote all of my .htaccess and stripped out the crap that made everything overly complicated.
So, my front end is done. (kind of there's a bunch of HTML for testing.)
Now, I need to work on the back end.
Bjorn van de Peut
@bjorno43
Jun 10 2018 04:46
I see. Well I'll leave you to it then. As you said, just trying to help. That's all^^
Joseph
@revisualize
Jun 10 2018 04:47
@bjorno43 Thanks for the MySQL suggestion. I think I need to work on that before I try to use something to make an API to fetch that data.
Bjorn van de Peut
@bjorno43
Jun 10 2018 04:49
@revisualize You're welcome. Make sure you read upon Prepared Statements if you haven't worked with MySQL before. Otherwise you might run into SQL injection issues
That said, I suggest using PDO and not MySQLi. Simply because it's easier and supports a lot more database drivers
dinesh
@1532j0004kg
Jun 10 2018 16:51
Anybody share major project idea in webdevelopment !
Some ideas
Joseph
@revisualize
Jun 10 2018 21:44
@bjorno43 (or anyone) ... Here's a question that I have...
If I'm trying to create a back end that just captures data and does some verification and logs that data to a database. Let's say it is just logging USER_ID, ITEM_ID, SELECTION_ID, USER_IP, TIMESTAMP...(plus a few other things) to a database. But, only logging this data if there is an ITEM_ID that has a correlating SELECTION_ID. (IE. The ITEM_ID doesn't exist but, someone put in a fake ITEM_ID and SELECTION_ID. I don't want to log random data that doesn't actually get tracked.)
What's the best way to accomplish this without causing the front end data collection script to halt or hang? Do I need to pass the collection call to another system that is separate from the front end data collection portion?
Shijie Zhou
@shijiezhou1
Jun 10 2018 23:16
@bjorno43 @czhower