Jump to content

Recommended Posts

In the cms i'm going to create, users will submit articles. my problems will be here. thanks in advance for your answers

somewhere I asked:

3.since i'm on the first step in PHP, i think the url of the page containing the submitted article is :

http://mydomain.com/formprocessor.ph...hewholearticle

that results in the following error:

Request-URI Too Large, if the article is too large. what is the solution?

and got:

3. If you're looking to retrieve the stored article for viewing, I would pass the id of the article (in the url, perhaps). Then query the database to pull the title, subject, text, etc. based on that id.

 

That's a good idea.

I have created a table, named it articles and made a few fields in it. ( you see below)

b10ba63a5f.jpg

Now how can I retrieve the article?

For example the first article. I used the code below:

<html><body>
<?php

mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("articles") or die(mysql_error());

$query="SELECT * FROM articles WHERE id='1'";
$result=mysql_query($query);

$article = mysql_fetch_array( $result );

include("main.php");
mysql_close();
?>

and main.php is :

<html>

<body>
<table border=0>
<tr>
<td> <? include("includetop.php") ?> </td>
</tr> </table>

<table class=MsoTableGrid border=0 cellspacing=0 cellpadding=0 width="100%"
style='width:100.0%;border-collapse:collapse;mso-yfti-tbllook:480;mso-padding-alt:
0in 5.4pt 0in 5.4pt'>
<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes'>
  <td width=132 valign=top style='width:99.0pt;padding:0in 5.4pt 0in 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center'><span lang=AR-SA
  dir=RTL>چ <? include("includeleft.php") ?></span></p>

  </td>
  <td width=468 valign=top style='width:351.0pt;padding:0in 5.4pt 0in 5.4pt'>
  <p class=MsoNormal align=center style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
  auto;text-align:center'><o:p>  [color=red]<?include("includecenter.php")?>[/color] </o:p></p>
  </td>
  <td width=159 valign=top style='width:119.25pt;padding:0in 5.4pt 0in 5.4pt'>
  <p class=MsoNormal align=center style='text-align:center'><span lang=AR-SA
  dir=RTL><u1:p>ر <? include("includeright.php") ?></span></p>
  </td>
</tr>
</table>



<? include("includedown.php") ?> 

 

where includecenter.php is :

 

<?

echo ($article);

?>

Link to comment
https://forums.phpfreaks.com/topic/52286-problems-in-creating-a-cms/
Share on other sites

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.