wingnut Posted June 1, 2010 Share Posted June 1, 2010 G'day, I am just trying to teach myself some basic php and website building skills, so any help would be great I have had a website made for me, with a basic CMS which seems to be good for what I am using. I am curious, for just a personal use but there is an Add and Edit page in the CMS back end where it adds to the main menu, and also adds to the content of the page. This is great. I am just wonder how I would edit the Menu and Content of that page without the CMS, via FTP download edit and upload. If this is possible. I am just having trouble finding where it is putting the new content. the URL for the page is www.theteetrip.com when i add the page " About Us " the new URL is http://www.theteetrip.com/cms.php?id=1 I have looked through cms.php and cannot seem to find any trace of it :S Thanks in advanced Peter Downie Quote Link to comment Share on other sites More sharing options...
Andy-H Posted June 1, 2010 Share Posted June 1, 2010 The CMS is using GET data to manipulate the data that gets displayed, if you showed the code it would be easier to explain whats going on. Basically, the data is taken from the URL and, in this case; stored in a GET array automatically by PHP $id = isset($_GET['id']) ? (int)$_GET['id'] : 1; Then the data will be used in some way to control what is outputted to browser in the form of HTML code if ($id == 1) { //display this } elseif ($id == 2) { //display this instead } else { //display this instead } It will probably be more complicated than that, ie. connecting to a database, pulling data depending on the GET data, and displaying the data to the client. A good place to start is http://www.w3schools.com/php/default.asp Or http://www.php.net Quote Link to comment Share on other sites More sharing options...
wingnut Posted June 1, 2010 Author Share Posted June 1, 2010 Ok, now to be the painful type of person im gona have to ask more questions haha. so once again I have searched the cms.php and not found the GET command <?php require_once('admin/conn.php'); ?> <?php require_once('admin/pathinc.php'); ?> <?php $sqcm="select * from cms_tb where cid='".$_REQUEST['id']."'"; $rescm=mysql_query($sqcm); if(!$rescm) { die('Error in data'); } $rwcm=mysql_fetch_array($rescm); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>The Tee Trip</title> <style type="text/css"> <!-- .style9 { font-size: 14mm; color: #000099; font-family: "Comic Sans MS"; } .style10 { color: #000099; font-size: 9mm; } .style11 {font-family: "Comic Sans MS"} --> </style> <link href="admin/style_Admin.css" rel="stylesheet" type="text/css" /> <link href="style.css" rel="stylesheet" type="text/css" /> </head><body> <div align="center" class="title01"><br> <?php require_once('header-menu.php'); ?> <br> <br> <br> <img src="images/logo2.jpg" width="400" height="482"><br /> <br /> <div id="wrap"> <div id="content-wrap" class="two-col"> <div id="main"> <table width="750" border="0" align="center"> <tr> <td align="left" class="title01"><?php echo $rwcm['cms_title'];?> </td> </tr> <tr> <td align="left" class="title_page"><?php echo $rwcm['cms_desc'];?></td> </tr> </table> </div> </div> <div id="footer-wrap"><div id="footer"> <p> Copywrite © 2010 The Tee Trip <a href="cms.php?id=4">Help</a> | <a href="cms.php?id=5">Privacy</a> | <a href="cms.php?id=6">Terms</a> </div></div> <!-- footer ends--> </div> </div> </body></html> p.s. the last linked lines of code are by myself, and this is the reason I want to add a page but not through the CMS adding a page through the CMS adds it to the top menu, and I want it to be a link from the bottom. I believe I have created the link correctly, I am just having trouble as to where to find "id" and so forth so I can add text to them. If that makes any sense :S Thanks Quote Link to comment Share on other sites More sharing options...
ignace Posted June 1, 2010 Share Posted June 1, 2010 I have had a website made for me You paid for this? -> $sqcm="select * from cms_tb where cid='".$_REQUEST['id']."'"; leaves you completely open to SQL injection attacks. Quote Link to comment Share on other sites More sharing options...
wingnut Posted June 1, 2010 Author Share Posted June 1, 2010 well yes actually, I have paid a programmer of a freelancing website to build me a gallery in which public can upload from the front end. I am unaware of what you mean by SQL attack?? what can this do to harm? Quote Link to comment Share on other sites More sharing options...
ignace Posted June 1, 2010 Share Posted June 1, 2010 I am unaware of what you mean by SQL attack?? what can this do to harm? http://ferruh.mavituna.com/sql-injection-cheatsheet-oku/ -- Here's a full list of things that can do harm. to build me a gallery in which public can upload from the front end I can already imagine how that code looks like. Quote Link to comment Share on other sites More sharing options...
trq Posted June 1, 2010 Share Posted June 1, 2010 well yes actually, I have paid a programmer of a freelancing website to build me a gallery in which public can upload from the front end. I am unaware of what you mean by SQL attack?? what can this do to harm? An sql attack can completely destroy your database. There are however plenty of people around that write terrible code and palm themselves off as programmers. Allot of them would actually hang out on those freelance sites. Quote Link to comment Share on other sites More sharing options...
wingnut Posted June 1, 2010 Author Share Posted June 1, 2010 Ok, Thank you for bringing this to my attention. I do not want to advertise for other sites on the forum, but can you recommend where I can hire someone that is able to help / fix these problems. Also back to the original question, Any idea of what I was trying to explain and how I am able to do this?? Thanks for your time all Peter Quote Link to comment Share on other sites More sharing options...
trq Posted June 1, 2010 Share Posted June 1, 2010 Ok, Thank you for bringing this to my attention. I do not want to advertise for other sites on the forum, but can you recommend where I can hire someone that is able to help / fix these problems. Its probably not that straight forward looking at what has been posted so far. Generally though, your probably better going to a reputable web development company if you want quality. Even then, theres no guarantees. Also back to the original question, Any idea of what I was trying to explain and how I am able to do this?? This highly depends on the design of the application. I can see from your post a file called header-menu.php, you might start there. Quote Link to comment Share on other sites More sharing options...
wingnut Posted June 1, 2010 Author Share Posted June 1, 2010 Ok, Thank you for your time explaining this to me, and for bringing the SQL to my attention. I will be looking into it ASAP. Peter Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.