Jump to content

Tommie84

Members
  • Posts

    10
  • Joined

  • Last visited

About Tommie84

  • Birthday 07/28/1984

Profile Information

  • Gender
    Male
  • Location
    The Netherlands
  • Interests
    PHP,JS,HTML,VB.NET,Mercedes,Denon,Pentax

Tommie84's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. there goes my arguments in just one sentence.. let me than just make a comment on your signature.. it makes more sense like: while(!$succeeded) {foreach ($life as $day) {try('Harder');}}
  2. add this in your index/header/config.php: if ($_REQUEST['e'] == "all") { echo "<br>Now reporting ALL errors/warnings!<br>"; error_reporting(E_ALL); ini_set('display_errors', '1'); } when something is not right.. append ?e=all to the adress bar
  3. i used to run servers @ home, later on i managed servers @ my company with better internet resources (many servers on ESX, all accessible for me only hehe). nowadays i discovered i dont want all the hassle anymore of updating/protecting/maintaining/repairing annd all the stuff that comes along with it. my main argument for using "heavy equipment" was that its unlimited (unlimited databases, unlimited resources, install all software u want, code on server via remote desktop, etc). i discovered that for my needs its not a bad thing to be limited in everything. if u never reach the limits when you have.. whats the point than of all the trouble and being limitless. so its entirely up to what your needs are. for de coding/designing part is the same argument. for me i use notepad++ to write html/php/js/css/etc. before i used windows notepad for ages (thought it was cool to being handicapped lol). i dont like designing software to spit out all kinds of blurrish that i dont write myself. debugging and modificating gets real difficult when u dont hav the special software with u at some points. but its not impossible to create/develop/master websites with click&drag software and be less awesome than the very best notepadder. i do think that mastering notepad(++) is easier than mastering dreamweaver on the same level of output. when u can do the same thing with dreamweaver that an experienced coder with notepad can do... u have magic click&dragging hands :-)
  4. i place content on their domains using get_contents().. it would not be fair to send reporting JS along with the dynamic content. if u place snippets from google on your domain, u place the JS code yourself. you think its legit/honorable to include JS code in the dat they receive? (the dynamic content is text only, no html markup or anything (but could be)).
  5. what are the ways ? i dont want to validate the client is honest (there is no input asked from the client), he doesnt need to say where it is heading. i only need/want to know..
  6. nah its a simple thing. i offer some dynamic content (nothing important). the main goal is that the user only has to click 1 button to retrieve 1 line of code (for simplicity sake). there are features on my site that require registration. this feature is however completely registrationless :-) the generated key is already a unique id in my db with diverse data tied to it. but ask user for website details is too easy too cheat. users can fill in "some.com" and get away with it. the first part of the snippet would work fine, but its way too long (and alterable) for me i like to know where my dynamic content is placed, and dont depend on honesty of my non-registered visitors. while writing this post some idea popped: since im delivering some dynamic content.. i could simply add some generated JS and send back the ['HTTP_HOST']. but i dont like hijacking my visitors cpu's (grown out of that age ). ohw yeh.. checked all SERVER vars: Array ( [CONTEXT_DOCUMENT_ROOT] => /home/########/public_html/software/shortSum [CONTEXT_PREFIX] => [DOCUMENT_ROOT] => /home/########/public_html/software/shortSum [GATEWAY_INTERFACE] => CGI/1.1 [HTTP_HOST] => short.######.net [PATH] => /bin:/usr/bin [QUERY_STRING] => K=vwVMveooPZOu [REDIRECT_STATUS] => 200 [REMOTE_ADDR] => ##.##.###.190 [REMOTE_PORT] => 5#### [REQUEST_METHOD] => GET [REQUEST_SCHEME] => http [REQUEST_URI] => /?K=vwVMveooPZOu [SCRIPT_FILENAME] => /home/######/public_html/software/shortSum/index.php [SCRIPT_NAME] => /index.php [SERVER_ADDR] => ##.##.###.### [SERVER_ADMIN] => webmaster@short.######.net [SERVER_NAME] => short.#####.net [SERVER_PORT] => 80 [SERVER_PROTOCOL] => HTTP/1.0 [SERVER_SIGNATURE] => [SERVER_SOFTWARE] => Apache [UNIQUE_ID] => VhqCDFURx2MAB4Se6oYAAAAw [PHP_SELF] => /index.php [REQUEST_TIME_FLOAT] => 1444577804.82 [REQUEST_TIME] => 1444577804 [argv] => Array ( [0] => K=vwVMveooPZOu ) [argc] => 1 ) <?question The above vars do show the remote ip adress.. is there anyway i can reform that to a website (together with the remote port to target on shared web-machines) ?>
  7. I also thought of the google way to implement it in the string (insert it into db, the string wont change its just a rdm Id, not something encrypted. but then i cant determine if user fills in growyourownone.org and puts it on hisrealdomain.com. i doubt it will work with google.. they must have some checking. pulling out all SERVER vars however is a great idea, tnx!
  8. do proper indenting on your code function greet ($user) { if (date('H') < 12) { $output = "Good morning $user" } else { $output = "Hello $user"; } return $output; } function greet ($user) { if (date('H') < 12) { $output = "Good morning $user"} else { $output = "Hello $user";} return $output;} function greet ($user) {if (date('H') < 12) {$output = "Good morning $user"} else {$output = "Hello $user";} return $output;} wich of the 3 samples above does make it easy to detect errors?
  9. I myself write most of the content in PHP. therefore i open PHP at the beginning of the page and end it on the very bottom. the method is than like this: <?php $test = "Hello World"; dbconnect(); //a function to make db connection and set $con while ($row = mysqli_fetch_array($con)); { echo "here is a db entry <a href='link'>" . $row['machine1'] . "</a>"; echo "here is a second link <button onClick='window.location.href=\"http://www.google.nl\";'>a button</button>"; echo "This is an inline test message: $test. <br> that can be used in an echo"; } ?> with this method: - you can write PHP everywhere on the page without opening/closing php tags (<?php ?>) - all HTML is echoed with "double quotes" and concatenated to the PHP with dots. - if you need quotes in an echoed html line you use single quotes (it wont interfere with the PHP code) - if you need a third set of quotes like in the 2nd echo you escape the double quotes with the PHP escape char \ - on the third echo you see a variable output without any quotes. not saying this is a MUST method.. but for me it makes things simple and reduce errors. (especcialiy the one you have now).
  10. Hello everyone, i have a simple question.. also hope that the answer is quite simple.. Banged my head over it several times but cannot find a solution in my head, nor on google. on my website users can generate 2 snippets like: <?php echo file_get_contents('http://short.domain.net?K=ezzyWFRUyhxp'); ?> and <iframe frameborder='0' width='950' src='http://short.domain.net?K=SBzuzsdi1btq'></iframe> the 2 snippets generate content on a users website if they place it in either their html or php site. on content generation of index.php (my domain) it will log several things like lastUsed, timesUsed, ip, etc. now what i also want to log is the website where the snippet is placed. i know i can get the ip adress of the remote retriever, but that doesnt help me if the user is on a shared domain. also tried $_SERVER['HTTP_REFERER'] without succes (always empty string). my brain's PHP section is depleted can anyone put the beauty back in my day ? thnx in advance! Tommie
×
×
  • 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.