Hi, everybaker,
I am loving Cake. Now I learn a lot from here and the irc channel. BUT,
I have several silly question. Here it is.
------------------------1--------
<?php
$s =simplexml_load_file($feed['Feed']['url']);
$this->set('s',$s);
?>
<form method="post" action="">
<SELECT NAME="item" SIZE=1>
<OPTION VALUE="1">1</OPTION>
<OPTION VALUE="2">2</OPTION>
<OPTION VALUE="3">3</OPTION>
<OPTION VALUE="4">4</OPTION>
</SELECT>
<input type="submit" value="Items">
</form>
<?php foreach ($s->channel as $item)
for ( $counter = 1;
$counter <= $_POST['item'];
$counter += 1) {
echo "<p>
<a href='" .$item->item[$counter]->link . "'>"
.$item->item[$counter]->title . "</a>
</p>";
echo "<p>" .$item->item[$counter]->description. "</p>"
;}
?>
How can I set certain default value before I submit by POST? Now the
default is 0, which means it displays nothing. And also, there is an
error message like " Undefined index: item ". When I choose some
value, it gone and works fine.
-------------------------2------------
function edit($id = null)
{
$this->Post->id = $id;
$this->data = $this->Post->read();
$user = $this->Session->read('User');
$this->set('user',$user);
if($user['username'] == $this->data['User']['username'])
{
$this->Post->save($this->data['Post']);
}
else
{
$this->redirect('/posts/');
}
}
This is part of my posts_controller. What I want to do is just the
author can modify the post. So, I read the session and compared with
post author. It works!. When I edit a post NOT belongsTo the login
users, it redirect to /posts/. BUT, When the author login, and want to
modify, I can't save it! There is no error. BUT, there is no change at
all.
---------------------------------3------------
1.--- I following the bakery tutorial about TinyMCE. It works. BUT, why
my editor's toolbar ALL sit the BOTTOM, not like normal one sit in the
HEAD. I havent change the css or layout about Tiny or Cake. Is it a bug
or what ?
2.---Why my FeedCreator doesn't work? I follow the way from the wiki
tutorial_2. My FF can detect the rss when I brower
http://localhost/cake/posts/rss, and I can save it. BUT, it contains
nothing.
That's it. Some silly question. BUT, I really can't find solution.
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---