Hi all,
Does anyone have a good rss class? i am looking to use one where i have a list of feeds in a database and you can select which feed to display via CMS
Hi all,
Does anyone have a good rss class? i am looking to use one where i have a list of feeds in a database and you can select which feed to display via CMS
errr, 42?! (meaning to life :) )
errors? code you are using?
help us to help you
i am not great with javascript, but i dont think it passes variables via $_GET as you are not sending this information to the URL
You could use the naming style you want as the key indetifier instead of a numerical one. So for example you URL would be somesitename.blah/ulr_rewrite.php?indentifier=online-fair-platform
You will still be required to use .htaccess to rewrite it to somesitename.blah/online-fair-platform
with a rewrite rule something like
RewriteRule ^\$/([^/]*)$ /ulr_rewrite.php?indentifier=$
Please note this is not tested, and may not function, or may even require tweaking :)
Hope that helps
zoreli if i may, why are you using the DB for this?
i think you maybe over complicating things
I've found this site absolutely brilliant for mod rewrites: http://www.generateit.net/mod-rewrite/
Nice tool :)
RewriteEngine on
RewriteBase /
RewriteRule ^page/([0-9]+)\.php$ index.php?key=$1
Here is start of one that i use, it rewrites any URL that has index.php?key=$
and re assigns to /page/[keyid]
I have not seen url rewrite done via a DB before, but hey i am sure it will go just as well.
(remove comments)ReWriteEngine on
//Start your rewrite moduleRewriteBase /
//Sets the base, so all files read/written from [site]/
RewriteRule ^online-fair-platform/([0-9]+)$ articles.php?artid=$1
This would rewrite the linksite.something/articles.php?artid=1554
intosite.something/online-fair-platform/1554
Hope that helps
There are loads of MOD_REWRITE tutorials about:
http://www.addedbytes.com/for-beginners/url-rewriting-for-beginners/
It can be a pain, but read through some
You would build the table elements as you run through the results of your query.
As JorgeM has pointed out, you would build your TD/TR etc as you step through your loop.
Start and end your table outside of the loop:
<table>
<?php
WHILE LOOP/IF LOOPDO WHILE LOOP
?>
</table>
I am not getting the error.
Created 2 pages functions.php, and index.php. I just get what i would expect, as it cannot execute the SQL
Did you have white space in your orig code?
why not use XAMPP for a test bed?
have you tried:<?php echo "<p>Hello World!</p>"; ?>
This is assuming you are identifying the images by lastid
, if you are you will still need to address the folder location of where the images are saved (guessing this is partly done in the get.php
$folderLoc = "PATH/TO/IMAGE/FOLDER";
<img src='$folderLoc/$row[lastid]/>
If not please show the code in the get.php file you dont wish to use
This is a gallery i did for the site owner:
http://www.helenshappyhome.co.uk/gallery.php
The content is dynamic depending on the gallery subject selected
sorry long day today :)<img src='get.php?image_id=$row[lastid]'>
will only show one image.
<img src='$row[lastid]'>
this is taking the assumption you have saved the image as the ID
hwoarang69
<img src='get.php?image_id=$row[lastid]'>
i would suggest resizing the image during the upload process, as resizing in the browser will slow it down
is it$myrow['article_tittle']
or $row['article_tittle']
?
You have changed line 9. remove the "mysql_query" and ()
`$sql = "SELECT * FROM image WHERE user_id = $user_id ORDER BY image_id DESC";'
You would need to address <img src=\"get.php?image_id=$lastid\"></img>
as it would be $row['lastid']
it $lastid is from DB
furqankhyraj, you are going from HTML straight to PHP, you have no PHP tags to identify:
<a href="<?php $_SERVER['PHP_SELF'] . 'id?=' . $myrow['article_tittle'];?> "><?php $row['article_tittle']; ?></a>
Have a look here: http://php.net/manual/en/function.mysql-fetch-assoc.php
$image seem's to be very popular variable, the below is not tested
session_start();
include("connect.php");
$user = $_SESSION['username'];
if($user)
{
$user_id = $_SESSION['user_id']; //get user_id who ever is loged in
$sql = "SELECT * FROM image WHERE user_id = $user_id ORDER BY image_id DESC";
}
echo "your gallery<br/><br/><br/>";
echo "<a href='upload.php'>upload image</a>";
echo "<a href='index.php'>home</a><br/><br/><br/>";
echo '<table>'; // Your table
echo '<tr>'; // first table row
$result = mysql_query($sql);
if (!$result) {
echo "Could not successfully run query ($sql) from DB: " . mysql_error();
exit;
}
$n = 0;
while ($row = mysql_fetch_assoc($result))
{
echo"<td> //how to do it with using get.php
<img src=\"get.php?image_id=$lastid\"></img>//print image
</td>";
$n++;
if($n == 4)
{
echo '</tr><tr>'; // Start a new row at 4 cells
$n = 0;
}
}
echo '</tr>';
echo '</table>';
just dump the code into a test page. It's your iFrame height that is pushing everything south
<iframe name="I1" src="index3.htm" height="700px" width="500px" border="0" frameborder="0">
Looks like the additional "clearfloat" try removing the class from line 236
Although reading the comment it should be inserted to line 230
I use Notepad++ for coding, but inline editing TinyMCE (easy to setup, open source, large support community if needed)
Your Array is empty also your if statement is opened correctly you had missed the first set {} from the IF
if ($v_name==""){
$query="DELETE FROM key_show WHERE code='$v_name'";
}else{
$query="insert into key_show(code) values('$v_name')";
mysql_query($query) or die(mysql_error());
}
Thank you. I will give it a go
Hello evryone. I am new to PHP and MySQL.
I have created an admin area for where selected people can add, delete, and edit data from a database.
I have managed to get the add, and delete to work, but I am stuck with the editing.
Can you help?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Admin | RTB</title>
<link href="../stylesheets/styleadmin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
save_onsavecallback : "Editor_Save",
theme : "advanced",
plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/example.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "js/template_list.js",
external_link_list_url : "js/link_list.js",
external_image_list_url : "js/image_list.js",
media_external_list_url : "js/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<script type="text/javascript">
function Editor_Save() {
document.updateform.action = "testimonials2.php?action=save";
document.updateform.submit();
};
</script>
</head>
<body class="Declarations">
<div id="content">
<div id="intro">
<h1>Administration System</h1>
<p>RTB Admin System.</p>
</div>
<div id="antiintro"><div id="ai2">
<h2 id="c1">
<?
if (isset($_GET['addtest'])): // If the user wants to add a joke
?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<p>Type your Testimonial here:<br />
<textarea name="testtext" rows="10" cols="40" wrap>
</textarea><br />
<input type="submit" name="submittest" value="SUBMIT" />
</p>
</form>
<?
else: // Default page display
include("dbinfo.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( …