calimon Posted January 1, 2007 Share Posted January 1, 2007 Hello everyone and Happy New Year!I'm new to the forum and I hope someone will be able to help me out. I have been hired to make some changes to a clients website which has been done in php. When I look at the site through my browser and view source I see the code that needs to be chnaged. But when I download the file from the server and open it in Dreamweaver 8, the code is not there. I am a beginner when it comes to php so I'm not sure what is happening. I work in a mac environment. I need to know what I have to do to see all the code just like I do when I view source on the browser. Can anyone help me? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted January 1, 2007 Share Posted January 1, 2007 YOu cannot download PHP Code from the browser. You will have to download via FTP or from the websites control panel. PHP is pre-processed. So when you view a php file in the browser what you see is the output generated from that file when PHP processed the script. PHP scripts do not show the the actual source code (PHP code) just the generated HTML. Quote Link to comment Share on other sites More sharing options...
calimon Posted January 1, 2007 Author Share Posted January 1, 2007 I'm sorry I guess I didn't clarify how I downloaded the file. I used Fetch (ftp program) to download the file. This is what I see when I open the file in Dreamweaver (this is only a piece of the entire file):<?/* LEFT PANEL */ echo "<div style=\"padding:4px;\"> <br / >Categories<br / ><br / >"; // categoryand this is what I see when I view source (same part):<td style="border-right:2pz solid #666666; width:160px; padding:0px;" valign="top"><div style="padding:4px;"> <br / >Categories<br / ><br / ><a href="products.php?enlist=category&category_id=1" style="padding-left:16px; font-size:12px;">Bracelets</a><br /><a href="products.php?enlist=category&category_id=2" style="padding-left:16px; font-size:12px;">Necklaces</a><br /><a href="products.php?enlist=category&category_id=3" style="padding-left:16px; font-size:12px;">Earrings</a><br /><a href="products.php?enlist=category&category_id=4" style="padding-left:16px; font-size:12px;">Lariats</a><br /><a href="products.php?enlist=category&category_id=5" style="padding-left:16px; font-size:12px;">More Designs</a><br /><span style="padding-left:16px; font-size:12px;">---<br /></span><a href="products.php?enlist=new" style="padding-left:16px; font-size:12px;">New Products</a><br /><a href="products.php?enlist=featured" style="padding-left:16px; font-size:12px;">Featured Products</a><br /><br /></div><div style="border-top:2px solid #666666; border-bottom:2px solid #666666; background:#ff3399; padding:1px;" id="nav">Why don't I see this code when I open the file in Dreamweaver? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted January 1, 2007 Share Posted January 1, 2007 Whats it like in other text editor? Is it the same? If it is perhaps it didn't download properly. Try redownloading the file. Or set-up a project (Site > New Site) in Dreamweaver and use the FTP builtin to Dreamweaver to edit the files from the server. Quote Link to comment Share on other sites More sharing options...
calimon Posted January 2, 2007 Author Share Posted January 2, 2007 Thanks for the info. I tried downloaded it again and I'm getting the same issue. I even tried downloading from a different computer. I tried doing it from Dreamweavers ftp and I'm getting the same thing. Am I missing a file or something. Does the echo refer to another page that I need to open? I need help. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted January 2, 2007 Share Posted January 2, 2007 You should not need anything to open PHP files. Only a PHP/basic text editor, Dreamweaver is more than fine for this. Is there other PHP files on the server? If there are download a different PHP file instead? Is it the same? Quote Link to comment Share on other sites More sharing options...
calimon Posted January 2, 2007 Author Share Posted January 2, 2007 There are plemty of other files on the server and the same thing is happening with the other files as well/ I see different code when I view source on the browser. I have attached the php file that I'm talking about. This is the link to the web page. http://psdesignsjewelry.com/products.php I need to change the text above the pink box. Then I also need to go in to each catagory and chnage text there which I can't even find the file that the link points to. I hope you can help.[attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted January 2, 2007 Share Posted January 2, 2007 Interesting I can see all the code, however I'm on a PC (WinXP). I get 230+ lines of code when I view the file in my PHP IDE (RapidPHP 2006). DW8 also displays fine too. I am not experienced with Mac's so I'm not sure what to suggest sorry. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 2, 2007 Share Posted January 2, 2007 I reviewed the posts, and I believe that calimon does see all the lines of PHP code [quote]I open the file in Dreamweaver (this is only a piece of the entire file):[/quote] and what is missing here is a little PHP 101 -PHP is a programming language that outputs content (hopefully valid HTML content) to a browser. When a PHP page is fetched by a browser, the PHP code is parsed and any output from echo/print/print_r... statements and any content that is not enclosed within <?php ... ?> tags is sent to the browser. It is this resultant output that the browser renders and that you see when you view the source of the page in the browser. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted January 2, 2007 Share Posted January 2, 2007 [quote author=PFMaBiSmAd link=topic=120596.msg495336#msg495336 date=1167752502]I reviewed the posts, and I believe that calimon does see all the lines of PHP code [quote]I open the file in Dreamweaver (this is only a piece of the entire file):[/quote] and what is missing here is a little PHP 101 -PHP is a programming language that outputs content (hopefully valid HTML content) to a browser. When a PHP page is fetched by a browser, the PHP code is parsed and any output from echo/print/print_r... statements and any content that is not enclosed within <?php ... ?> tags is sent to the browser. It is this resultant output that the browser renders and that you see when you view the source of the page in the browser.[/quote]But he/she (pardon me) is getting the file via FTP, not via HTTP (browser). I already asked/explained this this a few posts back. Quote Link to comment Share on other sites More sharing options...
calimon Posted January 2, 2007 Author Share Posted January 2, 2007 Thanks for your help. I didn't think the platform would make a difference. Maybe I should use a different program or something. Does anyone suggest anything for a mac? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 2, 2007 Share Posted January 2, 2007 Repeatedly in calimon's posts, he/she has stated an expectation that the contents of the downloaded php file contains the same source that is viewed in the browser -From the first post - [quote]I need to know what I have to do to see all the code just like I do when I view source on the browser.[/quote]And from the post with "a piece of the entire" php file and the source from the browser -[quote]and this is what I see when I view source (same part):...Why don't I see this code when I open the file in Dreamweaver?[/quote]So, calimon, when you open and view the downloaded .php file in Dreamweaver does it contain many lines of code or just a few? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted January 2, 2007 Share Posted January 2, 2007 There is both PHP and HTML code. Look at the attached file he/she attached a few posts above ([url=http://www.phpfreaks.com/forums/index.php?action=dlattach;topic=120596.0;attach=882]product.php[/url]). He/She said got it from FTP when they open it in Dreamweaver can only see the following in the entire file:[code=php:0]<?/* LEFT PANEL */ echo "<div style=\"padding:4px;\"> <br / >Categories<br / ><br / >";[/code] Quote Link to comment Share on other sites More sharing options...
calimon Posted January 2, 2007 Author Share Posted January 2, 2007 Let me clarify my problem because it seems that I may not have been as clear as I thought. When Open the file (products.php) I see 235 lines of code. I need to make corrections to this part of the code:<td style="border-right:2pz solid #666666; width:160px; padding:0px;" valign="top"><div style="padding:4px;"> [color=red]<br / >Categories<br / ><br / ><a href="products.php?enlist=category&category_id=1" style="padding-left:16px; font-size:12px;">Bracelets[/url]<a href="products.php?enlist=category&category_id=2" style="padding-left:16px; font-size:12px;">Necklaces[/url]<a href="products.php?enlist=category&category_id=3" style="padding-left:16px; font-size:12px;">Earrings[/url]<a href="products.php?enlist=category&category_id=4" style="padding-left:16px; font-size:12px;">Lariats[/url]<a href="products.php?enlist=category&category_id=5" style="padding-left:16px; font-size:12px;">More Designs[/url]<span style="padding-left:16px; font-size:12px;">---</span><a href="products.php?enlist=new" style="padding-left:16px; font-size:12px;">New Products[/url]<a href="products.php?enlist=featured" style="padding-left:16px; font-size:12px;">Featured Products[/url][/color]</div><div style="border-top:2px solid #666666; border-bottom:2px solid #666666; background:#ff3399; padding:1px;" id="nav">But in the php file I only see this code:<?/* LEFT PANEL */ echo "<div style=\"padding:4px;\"> <br / >Categories<br / ><br / >";My question is why don't I see the code that I need to change. I hope this clears up some confusion. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 2, 2007 Share Posted January 2, 2007 Edit: Nevermind.Edit2: I still don't think we have a understanding on what and where you are seeing it... Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted January 2, 2007 Share Posted January 2, 2007 Oh bugger! Looks like I miss understood you. I though you could only see <?/* LEFT PANEL */ echo "<div style=\"padding:4px;\"> <br / >Categories<br / ><br / >";and thats it and nothing else judging by your post. I didnt think you mean the HTML code.Ok. Now to explain. PHP is creating that code. PHP is a server-side programming languages it allows you to create dynamic websites. So you can't go in and edit like you can with HTML. Now what needs to be changed. You have to modify the PHP code in order to change the output. If you tell us what needs changing we'll be able to help. Quote Link to comment Share on other sites More sharing options...
calimon Posted January 2, 2007 Author Share Posted January 2, 2007 Ok thanks a lot! I need to add the word "Beaded" in front of the words Bracelets, Necklaces, Earrings, Lariats.Thanks so much for everyones input. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted January 2, 2007 Share Posted January 2, 2007 Ok those are coming from a database (mysql). You are best of editing the database itself rather than the script. You can do this using phpMyAdmin or via the the websites control panel if it has one. You can edit these in the table called [b]febpsd_products_category[/b] which is in the database being used for the site. You can check which database is being used in connections/conn.phpI have confirmed the website has a contorl panel [url=http://psdesignsjewelry.com/admin/]here[/url]. You should be able to do it through there. Quote Link to comment Share on other sites More sharing options...
calimon Posted January 2, 2007 Author Share Posted January 2, 2007 ok Thanks.Let me try this and see what happens. Quote Link to comment Share on other sites More sharing options...
calimon Posted January 2, 2007 Author Share Posted January 2, 2007 Reading the install directions for phpMyAdmin its says that I have to unzip the on the server. How am I supposed to do that if I only have ftp access to the server? If I double click on it wouldn't it just downoad the file? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted January 2, 2007 Share Posted January 2, 2007 Cancel the though of phpMyAdminDid you try going through the websites control panel to make the changes? Ask the person you are doing this for, for the username and password for the admin control panel to do this. Quote Link to comment Share on other sites More sharing options...
calimon Posted January 2, 2007 Author Share Posted January 2, 2007 Where would the control panel be? I believe I have the admin info. Sorry I'm completely new to database driven websites. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted January 2, 2007 Share Posted January 2, 2007 You can access it [url=http://psdesignsjewelry.com/admin/]here[/url]. I dont know what the control will be like but navigate through until you find what you are looking for. There should be a heading called categories or something. If you are unsure PM me screenshots of the admin control panel and I'll have a look. Quote Link to comment Share on other sites More sharing options...
calimon Posted January 2, 2007 Author Share Posted January 2, 2007 [quote author=wildteen88 link=topic=120596.msg495459#msg495459 date=1167760863]You can access it [url=http://psdesignsjewelry.com/admin/]here[/url]. I dont know what the control will be like but navigate through until you find what you are looking for. There should be a heading called categories or something. If you are unsure PM me screenshots of the admin control panel and I'll have a look.[/quote]Thanks. I sent you a PM. Quote Link to comment Share on other sites More sharing options...
calimon Posted January 19, 2007 Author Share Posted January 19, 2007 I can't seem to acess the datbase I need through the admin control panel. I have Mysql and PHP installed on my computer. How do I acess a databse from a remote server? 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.