Jump to content

Search the Community

Showing results for tags 'PHP'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General Section
    • Announcements & News
    • Introduce Yourself
    • General Discussion
    • Recreational Activities
    • Entertainment
    • Private VIP Lounge
    • Art / Screenshot / PhotoGallery / Signature
    • Suggestion
  • Gaming - Discussion
    • Enemy Territory
    • Call of Duty Series
    • Insurgency Series
    • Day Of Infamy
    • Team Fortress
    • Battlefield Series
    • Counter Strike Series
    • Other Games
    • Console & Mobile Gaming
    • Complaints
  • Help & Discussion Center
    • Tutorials
    • Q&A / Reports / Issues
    • Downloads
    • Software & PC Support
    • Hardware Hangout
    • Reviews by Members for Members
    • Language Learning & Translation
  • Join =F|A= Community
    • Applications / Join Us
  • ETPRO's Topics
  • ET Trick Jump's Topics
  • Clash of Royal's Topics
  • Clash of Clans's Topics
  • Rocket League's Topics
  • Cards Against Humanity's Topics
  • Trading's Topics
  • ET Mapping's Topics
  • Rust's Topics
  • Runescape's Topics
  • GTA's Topics
  • Among Us's Topics
  • SCUM's Topics

Calendars

  • Community Calendar
  • Gaming Events
  • ETPRO's Events
  • ET Trick Jump's Events
  • Trading's Events

Product Groups

  • Donation Packages
  • VIP Membership
  • Private Slot
  • ETPRO Events
  • Advertising

Blogs

  • Death's blog
  • Excerpts from a Diary
  • A lil piece of my life
  • Dissertation writing
  • Loki's Blog
  • ThuMpeRKA's Blog
  • RoadKILL's Blog
  • CaldasGSM's Blog
  • Sponkala's Blog
  • $kullcollector's Blog
  • Ganja.'s Blog
  • $kullcollector's Blog
  • Chameleon's Blog
  • The ramblings of an internet addict
  • Narug0's Blog
  • Pantha´s life
  • BambooBlog
  • PHANTASM RANTS
  • LeftWingVixen's Blog
  • LeKs!!'s Blog
  • Ol' Smoke's Blog
  • Crips+'s Blog
  • Pvt. Parts' Blog
  • LEKS...HUNTER OF KILLERS Blog
  • StgsL's Blog
  • WET map tutorials
  • My journey in gaming world
  • Tech Blogs
  • FireWienie's Blog
  • leks... se la rifa's Blog
  • Skylark159's Blog
  • Gaming Simplified
  • Be Act!vity's Blog
  • *
  • Be Act!vity's Blog
  • willo's Blog
  • Be Act!vity's Blog
  • Picior's Blog
  • The Scribbles of a Madman
  • crazy mafia fox's Blog
  • Chameleon's Blog
  • crazy mafia fox's Blog
  • Freedom by Exact.
  • 1984's Blog
  • ESPCatalina's Blog
  • Radoria's Blog
  • leks... se la rifa's Blog
  • Deepak Jain's Blog
  • Aphrodite01's Blog
  • Going to California for 3 week training
  • GraveDigger's Blog
  • LordTerror's Blog
  • asassin's Blog
  • 3 Week California Army Reserve training
  • Braveheart's Blog
  • Matt123Mann's Blog
  • Braveheart's Blog
  • blackknight8653's Blog
  • N!tmod Official Blog!
  • Flashing Lights' Blog
  • Nitrox*'s Blog
  • Skillz's Blog
  • BigRich's Blog
  • Skillz's Blog
  • Madgemade's Blog
  • Bowly's Foods
  • Ricardo Puente's Blog
  • kimbohunter007's Blog
  • hisoka's Blog
  • Duckie's Blog
  • FlA Sneaky Guy's Blog
  • FlA Sneaky Guy's Blog
  • severjack's Blog
  • FlA Sneaky Guy's Blog
  • Yep
  • Leichensammler's Blog
  • clxph4l4nxX3ta's Blog
  • I Can Do This Crap Too!
  • The thoughts of an insane white boy
  • Bowly's Thoughts
  • JohnWitman's Blog
  • Medic's Blog
  • AcidParadox's Blog
  • AcidParadox's Blog
  • Devil's Blog
  • Thoughts of an Assassin
  • ladosisletal's Blog
  • ladosisletal's Blog
  • Chameleon's Blog
  • Jonne Mikkola's Blog
  • Hecken's Corner
  • Blog
  • =pb=theblackkill's Blog
  • J35T3R's Blog
  • Recktilectrik's Blog
  • Soup's Blog
  • rolan001 blog
  • Stavros' Blog
  • Marine's Blog
  • The Smoke's Blog
  • The Dramatic Life of a Typical Asian
  • A day in the life of DeCareaux
  • ZIGZAG's Blog
  • Pabbatt Blue's Blog
  • ZIGZAG's Blog
  • Neuro's Blog
  • turkoxp's Blog
  • Verillaxus' Blog
  • Novice's Blog
  • lucianalorrane's Blog
  • BF2 Sandbox
  • Platform
  • zippye87's Blog
  • Success & Failure
  • zippye87's Blog
  • KonSiX-!7's Blog
  • EdbMails for exchange Recovery
  • TheProOne's Blog
  • TheProOne's Blog
  • Interview: CheepHeep
  • cereal killer's Blog
  • Diary of a Radioman
  • JohnnyColorado
  • Jasons Days
  • The Life of a Sound&Lighttechnician
  • kimbohunter007's Blog
  • Memoir of eurotrip
  • OMGITSSHMANESBLOG
  • /dev/random
  • sawwasLT's Blog
  • Mapping Sandbox
  • Shagger's Blog
  • Joining a Clan
  • Shagger's Blog
  • The world's a mean mistress at times
  • Karine's Blog
  • War2022
  • weAsels diary
  • Ways to Secure Your Finances During High Inflation
  • The !Chuck4Abuck's small world Blog
  • Clash of Clans Bases
  • Christoffer's Blog
  • Upgrade Your Rest: Keetsa Discount Codes Revealed
  • eagle7wolfensteiner77's Blog
  • 時尚鞋服
  • eagle7wolfensteiner77's Blog
  • SendBig
  • eagle7wolfensteiner77's Blog
  • ZeroGPT
  • eagle7wolfensteiner77's Blog
  • ZeroGPT
  • Fb!N!nJa's Blog
  • ZeroGPT
  • Fb!N!nJa's Blog
  • ZeroGPT
  • 1984's Blog
  • Lyon 2023 Festival of Lights
  • viper1's Blog
  • viper1's Blog
  • caca_de_puercp's Blog
  • czarek_pl's Blog
  • MoAZeR's Blog
  • Seppe*'s Blog
  • chips1chips1's Blog
  • St0nedGh0st's Blog
  • Jaaa!&'s Blog
  • test
  • admin's Blog
  • Life The Universe And Everything
  • CSL's Blog
  • Papa recoil's blogy
  • Strato!'s Blog
  • o
  • ET: from zero to hero
  • JayC's Blog
  • Dupstep's Blog
  • GodLui's Blog
  • M4A1+CQB's Blog
  • Chuckun's F|A Experience
  • M4A1+CQB's Blog
  • Diary Of A Wicked
  • ETNam.OrG
  • Computers are Strange
  • angel96's Blog
  • ToXiiCxKKiNg's Blog
  • Zuthus' Blog
  • janno's Blog
  • DJ´s free Software Blog
  • Excellent !!!!
  • Scream's thoughts
  • wesker's Blog
  • Bla Bla Bla
  • mattle's Blog
  • Panzerknacker's Blog
  • OMFG_A_BUNNY's Blog
  • Leaving
  • Fargwire's Blog
  • Fargwire's Blog
  • *SwissArmy*'s Blog
  • monkeysmack's Blog
  • MiNiOn's Blog
  • MiNiOn's Blog
  • Wizbang's Blog
  • Blawg
  • yoyotach's Blog
  • Vendela's Blog
  • King Hexaan's Blog
  • Gotcha
  • DJ´s Hardware Corner
  • azn_wan92's Blog
  • =Death Hunter='s It's those little things...
  • Panzerknacker's Blog
  • Big-E!:)'s Blog
  • SanToS' Blog
  • Pinoy Blog
  • Qlimax's Blog
  • DJ's Rumor Mill
  • tyler's Blog
  • WaaSab:>
  • Colin's Movie Blog
  • Weld21dejo's Blog
  • GI-JOE's Blog
  • Crasher's Blog
  • Ramblings
  • Blade
  • Blade's Blog of Mishaps and Misfortune
  • Panzer-WT?'s Blog
  • Fierce's Toolshop
  • Caulktails and Video Games
  • Caulktails and Video Games
  • YoYoO SonnY's Blog
  • YoYoO SonnY's Blog
  • wuolfe
  • Warning.'s Blog
  • Reviews
  • The Archangel Chronicles
  • Me sports and gaming
  • Yellow Flash's Epic journey
  • H3LLB0Y's Blog
  • How to be a good player at shooting games
  • member for a few days
  • bubading_CZE's Blog
  • Ooops' Blog
  • sssssss
  • Common Sense
  • hUnI's Blog
  • Adroits LAN - Enemy Territory Overview
  • ybmad's Blog
  • mR.d0t's Blog
  • Dennis' Mapping Project and More
  • Boring Monday
  • Battle of the Wits
  • NoCell's Noob explanation blog.
  • Perceivisms
  • Jormehara
  • Alien 01
  • =Death Hunter='s Constitutional Rants
  • Ph0eniX's Blog
  • Phr33 St00f Pl0x
  • Heretic121's Blog
  • B1gM1k3's Blog
  • Rap & HipHop Place
  • Small true story being Australia
  • jaie's Blog
  • redirect tf2 test
  • =FA=GuN's Blog
  • Meh
  • INDIAN**'s Blog
  • jungleo_0's Blog
  • dontkill me's Blog
  • Patrick's Blog
  • Jake P's Blog
  • Junior Tejera's Blog
  • Brain Chow
  • jwills112's Blog
  • halaluia
  • kamikaze's Blog
  • Why not?
  • Dare2BeFair / Captain.'s Blog
  • ronaldounit0's Blog 2/25
  • Journey of a troll to a man
  • Taborham Lincoln's Blog
  • The Adventures of Taborham Lincoln
  • -Shut Down2-
  • Xernicus' Coffee Blog
  • F3@R's Blog
  • Wolfenstein classic vs wolfenstein The New Order
  • Mr.Karizmatic's Blog
  • TrackBase
  • david812's Blog
  • Detorkville's Blog
  • -Shut Down-
  • Chameleon's Blog
  • Prime's Log Entries : The Return of Apha Trion
  • Ktom's Blog

Categories

  • Fearless Assassins Software
  • Enemy Territory
    • Software
    • Maps
    • Map Scripts
    • Mods
    • Soundpacks
    • Skinpacks
    • LUA
    • Player Configs
    • Waypoints
    • Punkbuster
  • Call of Duty 4
    • Software
    • Mods
    • Maps
    • Player Configs
  • Other Games
    • Insurgency
    • Minecraft
    • Team Fortress 2
    • Counter Strike Series
  • Windows Software
  • Sounds

Categories

There are no results to display.

There are no results to display.

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Youtube


Steam


Xbox Live


PSN ID


Discord


Battlelog


Website URL


Skype


Occupation


Battle.net


Alias


Admin


Interests


SL


TB


Location


Steam ID


steamID64


T-M


S1


HC


B2

Found 6 results

  1. A new PHP package has been released by TrackBase. Anyone who wants to fetch data from TrackBase but did have problems with cURL requests, we got you. With the new library you can now make API calls with just two lines of code. All necessary information is placed inside the README file and you can easily integrate it in your project with composer or a manual autoloader. Check it out at: https://github.com/trackbasenet/dev-api Disclaimer: A developer account is required for making API calls. It is free and can be registered at https://developers.trackbase.net/
  2. Hello everyone, mySQL is driving me mad for several days yet. I thought twice, trice, googled, googled and googled as hell and would not ask if I wouldn't be f*kd up like now... The starting situation is that I wanted to write a little blog system with PHP and SQL. Software-Info: * Windows 8.1 Professional Edition * Apache/2.4.23 (Win32); OpenSSL/1.0.2h; PHP Version 7.0.9; PHP-Extension: mysqli * phpMyAdmin 4.5.1; 10.1.16-MariaDB; DB-Client Version: libmysql - mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $ To create an entry and connecting with the file system with a smooth handling I need two columns (id and order) that are "unique". In this system it's not possible to make two columns unique. So there must a way to make both columns unique "virtually". -------------------------------------------------------------------------------------- | id* | headline | word | unlocked | order* | timestamp | -------------------------------------------------------------------------------------- | 20180826235958 | Hello | How are you? | 0 | 1 | 2018-08-26 23:59:58 | | 20180826235959 | Hi | I'm fine | 0 | 2 | 2018-08-26 23:59:59 | id: int(255); datetime as only number - *must be unique as id headline: text word: text unlocked: tinyint(1); boolean to make in-/visible order: int(255); *must be unique, too; to reorder the entries without touching the id The main problem is to make the INSERT command proof for no double entries. In fact the id is not auto_increment but unique - it takes the datetime to be unique. This is important to the id-validation being 14 chars long. Anyway so you can do something like this: INSERT INTO `_myTable` (`id` ,`headline`,`word`, `unlocked`, `order`, `timestamp`) VALUES ('20180826235958' ,'','', 0, 1, '2018-08-26 23:59:58') But what is, when you *click*, *click*, *click* in one second? You can wait for returning false, when duplicate key(id) is fired and then re-ask again to: INSERT INTO `_myTable` (`id` ,`headline`,`word`, `unlocked`, `order`, `timestamp`) VALUES (LAST_INSERT_ID(id)+1 ,'','', 0, 1, '2018-08-26 23:59:58') This solution is a little ugly (because you can get an id like 20180826235960) but this seems be working. -------------------------------------------------------------------------------------------------------------------------------- The minor problem is to count up the `order` field. I tried sth: INSERT INTO `_myTable` (`id` ,`headline`,`word`, `unlocked`, `order`, `timestamp`) VALUES ('20180826' ,'','', 0, myorder, '2018-08-26 16:37:02') SELECT `id` AS tmpID, IFNULL(MAX(`order`), 0) + 1 AS myorder FROM `_myTable`; SELECT LAST_INSERT_ID(); Result: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT `id` AS tmpID, IFNULL(MAX(`order`), 0) + 1 AS myorder FROM `_myTable' at line 5 By researching I found some interesting things but nothing of this worked EVEN they have rated up posts: https://stackoverflow.com/questions/5360117/insert-and-set-value-with-max1-problems 1. -------------------------------------------------------------------------------------------------------------------------------- The best way is to use a transaction but if your not using innodb tables then next best is locking the tables and then performing your queries. So: Lock tables customers write; $max = SELECT MAX( customer_id ) FROM customers; Grab the max id and then perform the insert INSERT INTO customers( customer_id, firstname, surname ) VALUES ($max+1 , 'jim', 'sock') unlock tables; -------------------------------------------------------------------------------------------------------------------------------- This is this one most interesting but I don't know if i cant trust locking tables: 1. if I lock tables then writing PHP-Code to calculate some out then continuing but the request crashes - what's up with the locked table when it's not unlocked? 2. if the table is locked with "write" what will be if another request on the table appears being blocked? Would the other request wait until the lock is released OR will it cancel the request? 2. -------------------------------------------------------------------------------------------------------------------------------- INSERT INTO customers( customer_id, firstname, surname ) SELECT MAX( customer_id ) + 1, 'jim', 'sock' FROM customers; -------------------------------------------------------------------------------------------------------------------------------- This is the way i tryed out above and does not work. 3. -------------------------------------------------------------------------------------------------------------------------------- INSERT INTO customers ( customer_id, firstname, surname ) VALUES ((SELECT MAX( customer_id )+1 FROM customers cust), 'sharath', 'rock') -------------------------------------------------------------------------------------------------------------------------------- This one does not work anyway - see screenshot. Cannot imagine that post getting 9 points up without working on syntax. Either I do sth. wrong here or nobody tests the code before rating up. What do yu think is the best practice to write transaction proof table entries like this? my test-source: $multiSQL = " INSERT INTO `".secure_sql($tbl)."` (".$field_str.") VALUES (".$value_str.") SELECT MAX(`order`)+1 AS iORDER FROM `".secure_sql($tbl)."`; SELECT LAST_INSERT_ID(); "; $insert = mysqli_multi_query($token['connection'],$multiSQL); if($insert){ echo 1 . '<br />'; print_r(mysqli_fetch_assoc($insert)); }else{ echo $multiSQL; $multiSQL = " INSERT INTO `".secure_sql($tbl)."` (".$field_str.") VALUES (LAST_INSERT_ID(id)+1 , ".$value_strD.") SELECT MAX(`order`)+1 AS iORDER FROM `".secure_sql($tbl)."`; SELECT LAST_INSERT_ID(); "; $insert = mysqli_multi_query($token['connection'],$multiSQL); if($insert){ echo 2 . '<br />'; print_r(mysqli_fetch_assoc($insert)); }else{ echo $multiSQL; } }
  3. Working on adding another website to my Direct Image code.
  4. Firstly, a little introduction to these tutorials. I am currently working on a clients website, and when I want to take a break, I've decided I will be posting about techniques I've used to cater for different needs, which people may find interesting. Today, I'll be showing you how you can easily protect your downloadable media. Why would you want to do this? Well, often we want to hide the location of the downloads, to stop people leeching your content. And most measures can be easily swerved. Here is a method I quite like. I have annotated everything for your convenience. Filename: download.php <?php $filename = "downloaded.zip"; // this is the fake name you want the downloaded file to be called. $source = "/downloads/thefile.zip"; // this is the real name and location of the file. if(file_exists($source)) { // check that the real file exists, if so do the following.. header('Content-type: application/zip'); // set the content type of the current page to the type of file being downloaded header('Content-Disposition: attachment; filename="'.$filename.'"'); // Forge the download name by setting filename= readfile($source); // grab the real file to prompt download. } else { // if the file doesn't exist echo "Error: File not found!"; // display error message } ?> So how do we use this? going to the destination: mysite.com/download.php would grab the file 'thefile.zip' from the /downloads/ folder, and prompt you to download it, but with a new name of 'downloaded.zip' This is the simplest version of this method. Obviously with use of $_GET requests you can have download.php choose varying files from the /downloads/ folder. Example below: Filename: download.php <?php $id = $_GET['file']; $filename = "downloaded-".$id.".zip"; // will forge the name downloaded-5.zip (if download.php?file=5 is requested) $source = "/downloads/thefile-".$id.".zip"; // will pick the real file titled thefile-5.zip (if download.php?file=5 is requested) if(file_exists($source)) { // check that the real file exists, if so do the following.. header('Content-type: application/zip'); // set the content type of the current page to the type of file being downloaded header('Content-Disposition: attachment; filename="'.$filename.'"'); // Forge the download name by setting filename= readfile($source); // grab the real file to prompt download. } else { // if the file doesn't exist echo "Error: File not found!"; // display error message } ?> It gets even more advanced once you start playing with more and more security. When dealing with premium ($$$) content, it's good to use a database and give all your files a masked name, by MD5 encoding the names, storing them in a database with an assigned ID, and having download.php retreive the filename from the database to know which file to retreive. But that'd look a little messy for this tutorial I hope you learned something by reading this.. Thanks for reading! Chuckun
  5. Structure of PHP We have learned how we can parse some text to browser so far, the easiest thing in PHP. But wait, everything is easy, you only have to know how! PHP uses a if … else structure, similar like flash and Java. <?php if(1+2==3) { echo ‘Correct!’; } else { echo ‘Incorrect’; } ?>The example above shows a little math sum. I will explain every line.Line 1: We give the server the message that he is dealing with PHP code Line 2: We ask the question, if 1 + 2 = 3 execute the code surrounded by the first { }. Line 3: The code executed when the sum is correct. Line 4: End of the first block of code and then start a new one, a one which will be executed if the sum would be false. Line 5: The code executed when the sum is incorrect. Line 6: End of the second block of code. Line 7: End of the PHP code. In this example the browser always shows the text ”Correct!”, however, when we change the 3 into a 4, the browser will always give “Incorrect”.  Variables In PHP you also have variables, thiny pieces of memory where you can store information or execute functions. These variables are indicated with the prefix $ (dollar sign). For example: <?php $name = ‘mattle’; ?>Bear in mind that text always need to stand between quotes. This script won’t do anything. So variables won’t be echoed by standard. But I can: <?php $name = ‘mattle’; echo $name; ?>Because we want to echo a variable we don’t need to place it between quotes. The variable itself is not a string. But what if I want to add some more text, like “Welcome, Mattias, enjoy your stay!”We could do it like this: <?php $name = ‘mattle’; echo ‘Welcome ’; echo $name; echo ‘, enjoy your stay!’; ?>That’s long. PHP knows some tricks to make from these 3 echo’s one echo. <?php $name = ‘mattle’; Echo ‘Welcome ’. $name . ‘, enjoy your stay!’; ?>What did we do? We've put two strings around the variable with on both sides 2 dots. In other words, we putted the variable out of the text. But you don’t have to close the echo with quotes. We simply can do this: <?php $name = ‘mattle’; echo ‘Welcome ’. $name; ?>Or this: <?php $name = ‘mattle’; echo $name . ‘, hi!’; ?>Thanks again for reading the second part of the multipart tutorial “First steps into PHP”.If you have comments, suggestions, don’t be shy and send me those. Happy trying
  6. First steps into PHP What is PHP? PHP stands for Hypertext Preprocessor and is executed by a webserver instead of the browser, the program where are watching this page in. This means that the server executes all the pages who are containing actions, server-side and then passes the results to your browser. You think, well whats the advantage of that? Well by this way you can make the page dynamic. With a normal file the whole file is send to the browser and the browser executes it. The result will be always the same because the file on the server won’t be edited at all without changes from the webmaster. When you use PHP you can execute the scripts on the server and get information from databases which you add to the pages when you run. By keeping this in your mind, you can imagine that you could create complex dynamic webpages like this forum which is also build on PHP. What do I need? In this tutorial I assume you have some basic skills like using FTP and creating HTML pages. If you don’t understand these things I would recommend stop reading this tutorial and first get some more experience in those other subjects. Ofcourse you need a webhost who supports PHP. In these days almost all hosts offer this to their clients. If you are not sure, just ask them. You also need a program to create and edit PHP files. There are a bunch of programs for this, we are using however notepad as it is our beginning to PHP. You know now the requirements and what PHP is, let’s get to the exciting part. Creating a PHP file To let the server know that he has to deal with a PHP file, all files are usually ending with the extension .php, for example index.php. In this file again we have to let the server know that a part is PHP code we simple use the following: <?php ?>These tags will contain our PHP code. It’s similar to the <body> tag in PHP. The easiest way to really show some text is to use the echo, like following: <?php Echo ‘Hello world!’; ?>When you run this PHP code in your browser, you will only see the text Hello world and won’t see any PHP code. So, when you want to parse HTML code to the browser, you simply use the echo ‘’;Use always the hooks around your text. Also use after every echo line a ; (dot comma). The server then knows a piece of code is finished. Thanks for reading the first part of the multipart tutorial “First steps into PHP”. If you have comments, suggestions, don’t be shy and send me those. Thanks for reading
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.