Mar 9, 2016, 08:04 PM
Mar 9, 2016, 08:40 PM
(Mar 8, 2016, 09:47 AM)WildDorito Wrote: [ -> ]PHP (the worst language in my life)
</3
I do too much php :3 gud with sql and html5 and css
Mar 9, 2016, 08:42 PM
Mar 9, 2016, 08:50 PM
Firstly, whenever making a site try to make it responsive so use % instead of px where you can.
Secondly Sublime Text FTW:
Just a snapshot of a project I'm working on
HTML:
PHP:
Secondly Sublime Text FTW:
Just a snapshot of a project I'm working on
HTML:
PHP:
Mar 9, 2016, 08:52 PM
I've never had any luck using Dreamweaver, I just usually use plain old Notepad (that's how the entire LL homepage was made)
Mar 9, 2016, 09:50 PM
Mar 9, 2016, 11:46 PM
My brilliant PHP skills:
<?php
$name = "Noble";
$software = "Notepad";
$sql = mysql_query("SELECT * FROM developers WHERE name = '$name' and software = '$software'");
$sqlcheck = mysql_num_rows($sql);
if ($sqlcheck == "1") {
echo ("Error: 404 :P ");
$life = "0";
} else {
echo ("OK");
$life = "1";
}
?>
$name = "Noble";
$software = "Notepad";
$sql = mysql_query("SELECT * FROM developers WHERE name = '$name' and software = '$software'");
$sqlcheck = mysql_num_rows($sql);
if ($sqlcheck == "1") {
echo ("Error: 404 :P ");
$life = "0";
} else {
echo ("OK");
$life = "1";
}
?>
Mar 9, 2016, 11:56 PM
(Mar 9, 2016, 11:46 PM)WildDorito Wrote: [ -> ]My brilliant PHP skills:
[spoiler=""]
<?php
$name = "Noble";
$software = "Notepad";
$sql = mysql_query("SELECT * FROM developers WHERE name = '$name' and software = '$software'");
$sqlcheck = mysql_num_rows($sql);
if ($sqlcheck == "1") {
echo ("Error: 404 ");
$life = "0";
} else {
echo ("OK");
$life = "1";
}
?>
[/spoiler]
Wheres the PDO </3
u just keep making me cri even more just stabbit :C
EDIT: On a serious note 1. Dont use stock mysql its so vulnerable and 2. That statement is vulnerable to SQL Injection rip specifically here:
PHP Code:
SELECT * FROM developers WHERE name = '$name' and software = '$software'
if you used pdo you could do:
PHP Code:
$sql = $conn->prepare("SELECT * FROM developers WHERE name=:name and software=:software");
$sql->bindParam(":name", $name);
$sql->bindParam(":software", $software);
$sql->execute();
Eh read up on PDO also $conn needs to be changed to whatever this is:
$conn = new PDO("mysql:host=" . $servername . ";dbname=". $dbname, $username, $password);
This should work, made it now, read up on PDO (Stands for PHP Data Objects if I remember correctly) its really good
NEVER USE MySQL alone, use either MySQLi or PDO!!!!
Mar 10, 2016, 12:07 AM
Also never used dreamweaver, I might take a look if I get time but been super super busy lately trying to push out a beta version of a massive script I been working on in PHP and got too many tests :C fucking school bombarding us with tests.
grrrrrr
grrrrrr
Mar 10, 2016, 12:19 AM
i know someone who writes code in microsoft word
Mar 10, 2016, 12:28 AM
(Mar 10, 2016, 12:19 AM)goigle Wrote: [ -> ]i know someone who writes code in microsoft word
yeye dont we all
Mar 10, 2016, 12:38 AM
Is mixed HTML/PHP still a thing these days?
Come on guys. Get a proper template engine and go for it.
Bind tpl-vars inside your php-file and let the engine render it for ya.
Your code will look more organized and structured. This way Webdesigners don't have to mess with your PHP-Code in a template.
Can even have it cached serverside etc.
I recommend Smarty and Twig for PHP.
Good engine for Node is jade.
Come on guys. Get a proper template engine and go for it.
Bind tpl-vars inside your php-file and let the engine render it for ya.
Your code will look more organized and structured. This way Webdesigners don't have to mess with your PHP-Code in a template.
Can even have it cached serverside etc.
I recommend Smarty and Twig for PHP.
Good engine for Node is jade.
Mar 10, 2016, 01:08 AM
(Mar 9, 2016, 11:56 PM)A Simple Waffle Wrote: [ -> ]Wheres the PDO </3
u just keep making me cri even more just stabbit :C
EDIT: On a serious note 1. Dont use stock mysql its so vulnerable and 2. That statement is vulnerable to SQL Injection rip specifically here:
PHP Code:SELECT * FROM developers WHERE name = '$name' and software = '$software'
if you used pdo you could do:
PHP Code:$sql = $conn->prepare("SELECT * FROM developers WHERE name=:name and software=:software");
$sql->bindParam(":name", $name);
$sql->bindParam(":software", $software);
$sql->execute();
Eh read up on PDO also $conn needs to be changed to whatever this is:
$conn = new PDO("mysql:host=" . $servername . ";dbname=". $dbname, $username, $password);
This should work, made it now, read up on PDO (Stands for PHP Data Objects if I remember correctly) its really good
NEVER USE MySQL alone, use either MySQLi or PDO!!!!
I have tried to use MySQLi with limited success. I'll try PDO when I get home, school has blocked FTP connections
Mar 10, 2016, 01:34 AM
[html]
im a hacker
[/html]
im a hacker
[/html]
Mar 10, 2016, 10:12 AM
I am amazed that you used original notepad to make Limelights page....... My mind = blown