Jump to content

Not seeing all the code


Recommended Posts

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?
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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 / >";

// category


and 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?
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

[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.
Link to comment
Share on other sites

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?
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.php

I have confirmed the website has a contorl panel [url=http://psdesignsjewelry.com/admin/]here[/url]. You should be able to do it through there.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

[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.
Link to comment
Share on other sites

  • 3 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.