The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
New to php, problems moving my code to a new site as layout is different.
Discuss New to php, problems moving my code to a new site as layout is different. in the PHP Development forum on Dev Shed. New to php, problems moving my code to a new site as layout is different. PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

February 20th, 2013, 07:44 AM
|
|
Contributing User
|
|
Join Date: Feb 2013
Posts: 52
Time spent in forums: 2 Days 14 h 19 m 25 sec
Reputation Power: 1
|
|
|
New to php, problems moving my code to a new site as layout is different.
hey guys,
im new to php, i have a code in my old site that uses the mysql db on my server, but seeing as the new site is a different layout im flummuxed on how to change it.
the code was written by a friend of mine and atm he is quite busy so no chance of getting hold of him.
any help would be greatly appreciated
|

February 20th, 2013, 08:41 AM
|
|
|
|
Based on what you posted, what exactly are you expecting someone to tell you?
__________________
There are 10 kinds of people in the world. Those that understand binary and those that don't.
|

February 20th, 2013, 08:50 AM
|
|
Contributing User
|
|
Join Date: Feb 2013
Posts: 52
Time spent in forums: 2 Days 14 h 19 m 25 sec
Reputation Power: 1
|
|
|
i can post the current php code here, but what i was wanting was to post my website link here, so they could see what i was on about, but new people cant post links.
i am a newbie at php so im kind of confused at what i need to do to get it working.
|

February 20th, 2013, 09:03 AM
|
 |
Likely to be eaten by a grue.
|
|
Join Date: Oct 2006
Location: Pennsylvania, USA
|
|
|
What do you mean by "layout"? Why is the layout (traditionally referring to the CSS styling of the site) affecting your MySQL connection?
What, exactly, is the problem? You're trying to move a whole set of code from one server to another? You're trying to make a second website using code from the first? You're trying to change the underlying database structure of a site?
You can post URLs with (dot) and (slash) and we'll reassemble them if you really need to, but I'm not sure what a link is going to do for us since the question isn't really clear.
__________________
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
|

February 20th, 2013, 09:03 AM
|
|
|
|
Post your code here (that is what this forum is for). Be sure to use [ PHP ] tags (see the sticky at the top of this forum). After posting, explain what is going wrong and where, along with any errors you are getting (especially in the httpd log).
P.S. You might run phpinfo on both servers and compare the result.
|

February 20th, 2013, 09:20 AM
|
|
Contributing User
|
|
Join Date: Feb 2013
Posts: 52
Time spent in forums: 2 Days 14 h 19 m 25 sec
Reputation Power: 1
|
|
|
<?php
// You only need a single query to draw all the news section
// Remember that Limit number -currently 2- is just the news items you want to show in the main index
$data = mysql_query("SELECT id, day, month, year, headline, text, signature, img1, img2, img3 FROM news ORDER by ID DESC LIMIT 2", $CONNECT);
while($row = mysql_fetch_row($data))
{
echo "
<div class='article'>
<h2>$row[4]...</h2>
<p class='infopost'>Posted <span class='date'>on $row[1]/$row[2]/$row[3]</span> by <a href='#'>$row[6]</a> | </p>
<div class='clr'></div>
<div class='img'><img src='$row[7]' width='200' height='150' alt='' class='fl' /><Br /><BR /><BR />
<img src='$row[8]' width='200' height='150' alt='' class='fl' /><Br /><BR /><BR />
<img src='$row[9]' width='200' height='150' alt='' class='fl' /></div>
<div class='post_content'>
$row[5]
<p> </p>
<p> </p>
</div>
<div class='clr'></div>
</div>";
}
?>
thats the php code im using at the moment...
but i cannot get it changed to fit this page...
www(dot)draigracing(dot)co.uk(slash)news(dot)html
the layout of the page designs are completely different.
|

February 20th, 2013, 09:29 AM
|
|
Contributing User
|
|
Join Date: Jun 2009
Posts: 297
  
Time spent in forums: 3 Days 8 h 45 m 39 sec
Reputation Power: 5
|
|
|
When you say to fit, what to you mean? Dimensions are probably in your css file within the .article or .infopost area.
EDIT: Or even .post_content
|

February 20th, 2013, 10:26 AM
|
|
Contributing User
|
|
Join Date: Feb 2013
Posts: 52
Time spent in forums: 2 Days 14 h 19 m 25 sec
Reputation Power: 1
|
|
|
ok let me try and clarify what i mean...
that code is for this...
www(dot)draigracing(dot)co(dot)uk
and i want to change it to work on this page some how
http://draigracing(dot)co(dot)uk(slash)Draigracingnewsite(slash)news(dot)html
|

February 20th, 2013, 11:58 AM
|
 |
pollyanna
|
|
Join Date: Jul 2012
Location: Germany
|
|
Is this your problem? Do you see an error message on your screen?
That would explain why your "layout" is somehow messed up ...
|

February 20th, 2013, 12:01 PM
|
|
Contributing User
|
|
Join Date: Feb 2013
Posts: 52
Time spent in forums: 2 Days 14 h 19 m 25 sec
Reputation Power: 1
|
|
Quote: | Originally Posted by Jacques1 Is this your problem? Do you see an error message on your screen?
That would explain why your "layout" is somehow messed up ... |
that was my error i thought it was a mysql error as it said couldnt get it, but sorted that out it was a comma that needed to be deleted
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|