srwright
-
Posts
5 -
Joined
-
Last visited
Posts posted by srwright
-
-
Hi all,
So im trying to improve on my PHP as my knowledge isn't that great.
lets say for argument sake my ip is:
192.168.0.1
im trying to set a external variable to set this as the url.
so on each page i use, for each link instead of typing out the ip address i can simply type:
<a href="{url}/index.php">Home</a>
and then if it is possible, to do something like this:
<link rel="stylesheet" href="{url}/main.css" type="text/css">
all in one file so in my php pages i can simple include 1 php file and it will have all of the relevant stylesheets ect linked to it.
-
Then, stop learning tutorials and start learning the core programming logic by reading the docs
Im not interested in learning to program though. i simply needed the database for something else. as soon as thats setup i wont be using it again. couldn't you just help i im guessing you know how to do this stuff.
-
I'd start running a mysql command line client executing sql statements from a text file using the source command. Here, it's an example of installation sakila database, use same logic.
Ok the only problem is. i dont really know much about databases. Im simply following a tutorial. and this hasn't happened in the tutorial :/
sorry i know it must be frustrating getting people who dont truly know what theyre doing
-
ok i have loaded a .sql file into PHPmyadmin.
it is giving me this error :/
what can i do?
im using this version: Server version: 5.6.16 - MySQL Community Server (GPL
--------------------------------------------------------------------------------
SQL query:
/*!40000 ALTER TABLE `group_members` ENABLE KEYS */;
-- Dumping structure for table bc.help_subjects
CREATE TABLE IF NOT EXISTS `help_subjects` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`caption` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TABLE IF NOT EXISTS `help_subjects` (
`id` int(11) unsigned NOT NULL A' at line 6
external variable for url
in PHP Coding Help
Posted
yes i know that it would be a domain normally. which is why i said for arguments sake...
and i also know just /main.css would work... but im trying to do what skunkbad said and simply learn how to do it.
that actull setup i have is completely different to this, i just made a quick example on here.
i want to have 1 global variable page called global.php with something like this to be used on each php page.
$url = $_SERVER['HTTP_HOST'];
would i have to use include to include the global file on each page. or is there a way to just make the variables accessible from all pages
sorry if this isnt making much sense.