Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Guesbook Application setup help
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
nwim
Smarty Rookie


Joined: 16 Apr 2008
Posts: 20

PostPosted: Wed Apr 16, 2008 7:58 pm    Post subject: Guesbook Application setup help Reply with quote

Hi,
I am working on XAMPP. I followed the installation process form the manual and its working fine.
Now, I want to implement the sample Guestbook Application given in the site. Can anyone tell me where to put the whole "Guestbook" folder once it is downloaded? I did not find this info in the manual. I am finding it confusing on application setup process. Can anybody please help me with this?

Thanks,
Nwim
Back to top
View user's profile Send private message Send e-mail
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Wed Apr 16, 2008 8:54 pm    Post subject: Reply with quote

The instructions are on the smarty site.

http://www.smarty.net/sampleapp/sampleapp_p1.php
Back to top
View user's profile Send private message Visit poster's website
nwim
Smarty Rookie


Joined: 16 Apr 2008
Posts: 20

PostPosted: Wed Apr 16, 2008 9:08 pm    Post subject: Reply with quote

Monte,
I followed instructions from the same site but and still getting the following errors:

Warning: require(c:/smarty/Smarty.class.php) [function.require]: failed to open stream: No such file or directory in C:\xampp\htdocs\smarty\guestbook\libs\guestbook_setup.php on line 13

Fatal error: require() [function.require]: Failed opening required 'c:/smarty/Smarty.class.php' (include_path='.;C:\smarty\libs\') in C:\xampp\htdocs\smarty\guestbook\libs\guestbook_setup.php on line 13

Please help.

~Nwim
Back to top
View user's profile Send private message Send e-mail
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Wed Apr 16, 2008 9:32 pm    Post subject: Reply with quote

It looks like that your definition of SMARTY_DIR does not point to the folder where SMARTY is installed.
Back to top
View user's profile Send private message
nwim
Smarty Rookie


Joined: 16 Apr 2008
Posts: 20

PostPosted: Thu Apr 17, 2008 8:14 pm    Post subject: Reply with quote

Thanks Monte and U.Tews for the info and hint.

I made changes to my php.ini and index.php to point to the the correct location. The previous error do not exist. But now, I am getting the following error:

Warning: require(DB.php) [function.require]: failed to open stream: No such file or directory in C:\xampp\htdocs\smarty\guestbook\libs\guestbook_setup.php on line 14

Fatal error: require() [function.require]: Failed opening required 'DB.php' (include_path='.;c:\xampp\htdocs\smarty\') in C:\xampp\htdocs\smarty\guestbook\libs\guestbook_setup.php on line 14

I already installed PEAR and the location is C:\xampp\php\PEAR

Now my php.ini file has the following include path:
include_path = ".;c:\xampp\htdocs\smarty\"

Could you please help me in setting up the location for PEAR to get rid of the error. Where should I install PEAR?

~Nwim
Back to top
View user's profile Send private message Send e-mail
Celeb
Administrator


Joined: 17 Apr 2007
Posts: 1025
Location: Vienna

PostPosted: Thu Apr 17, 2008 8:31 pm    Post subject: Reply with quote

Try setting your include_path in your php.ini to
Code:
".;c:\xampp\htdocs\smarty\;c:\xampp\php\PEAR\"

_________________
Darn computers always do what I tell them to instead of what I want them to do.
Back to top
View user's profile Send private message
nwim
Smarty Rookie


Joined: 16 Apr 2008
Posts: 20

PostPosted: Thu Apr 17, 2008 8:49 pm    Post subject: Reply with quote

Hey Celeb,

It's up! Thanks a bunches..

Thanks to all who replied Smile
Back to top
View user's profile Send private message Send e-mail
rashidul
Smarty n00b


Joined: 18 Apr 2008
Posts: 2

PostPosted: Fri Apr 18, 2008 4:53 am    Post subject: Reply with quote

Hi nwim,
I am a newbie.
I see the installation procedure from h t t p : / /news dot php dot net/php dot smarty dot dev/2703 but I am confused about installation. Since there is an instruction "In (wwwroot) create index.php "
in xampp in www root already has an index.php
can u provide me the full installation procedure.
i will be Very Happy
regards
rashidul
Back to top
View user's profile Send private message
shannera
Administrator


Joined: 13 Feb 2006
Posts: 802
Location: Edertal, Germany

PostPosted: Fri Apr 18, 2008 8:09 am    Post subject: Reply with quote

You don't have to place the smarty-calling script in wwwroot, you don't have to name it index.php, you can name it everthing you like, that was just an example. The important thing with smarty installation is that you define the corrects paths for Smarty.
Back to top
View user's profile Send private message
nwim
Smarty Rookie


Joined: 16 Apr 2008
Posts: 20

PostPosted: Fri Apr 18, 2008 12:44 pm    Post subject: Reply with quote

Hi rashidul,
As per my setup, I created a new 'smarty' folder in inside wwwroot(In my case the root is c:/xampp/htdocs). Then inside smarty, I created the index.php file. So, the location is like: c:/xampp/htdocs/smarty/index.php.

Accordingly, your include path in the php.ini should also be the same. In my case it is include_path = ".;c:\xampp\htdocs\smarty\"

Hope this helps.

~Nwim
Back to top
View user's profile Send private message Send e-mail
pmathia
Smarty n00b


Joined: 21 Apr 2008
Posts: 3

PostPosted: Mon Apr 21, 2008 4:31 pm    Post subject: guestbook sample application help Reply with quote

I have installed the guestbook and run it.
I see the table but with empty grey rows when I add to mysql guestbook table. ... so my database entries are not being displayed in my template table. any suggestions?
Back to top
View user's profile Send private message Send e-mail
nwim
Smarty Rookie


Joined: 16 Apr 2008
Posts: 20

PostPosted: Mon Apr 21, 2008 4:51 pm    Post subject: Reply with quote

Hi pmathia,

Not quite sure about it if this is the reason, but just wanted to ask if you had run the following

GRANT ALL ON GUESTBOOK.* to guestbook@localhost identified by 'foobar';

with appropriate database name, table name, username and password after creating the database?

You could also try adding some data directly to the database and see if it gets displayed in the template.

~Nwim
Back to top
View user's profile Send private message Send e-mail
pmathia
Smarty n00b


Joined: 21 Apr 2008
Posts: 3

PostPosted: Mon Apr 21, 2008 5:34 pm    Post subject: I have manually added rows to my guestbook table Reply with quote

I have manually added rows to my guestbook table but its still not displaying in the template .tpl.

I am not sure where to add the GRANTALL command in my code. I am accessing mysql database through the following initials.

user: root
password: (no password)
host: localhost port: 3306
database: guestbook

I am working on WAMP Server with MySQL Admin and MySQL Query browser.

Thanks for your help and I hope it'll work out soon.
Back to top
View user's profile Send private message Send e-mail
nwim
Smarty Rookie


Joined: 16 Apr 2008
Posts: 20

PostPosted: Mon Apr 21, 2008 6:17 pm    Post subject: Reply with quote

pmathia,

To execute the GRANT ALL command do the following:

1. Go to MYSQL Admin panel

2. Go to Tools -> MySQL Command Line Client

3. Type in the appropriate path for your mysql installed directory. Something like C:\xampp\bin>(This is for XAMPP)

4. Type the following:
mysql -<username> -p<password>.

In your case this would be:
mysql -root -p

When asked for Enter Password, just hit 'Enter'.

5. Write the GRANT ALL command. In your case it would be:
GRANT ALL ON guestbook.* to root@localhost identified by '';

This should do it.

~Nwim
Back to top
View user's profile Send private message Send e-mail
pmathia
Smarty n00b


Joined: 21 Apr 2008
Posts: 3

PostPosted: Mon Apr 21, 2008 9:26 pm    Post subject: Reply with quote

following the exact instructions the data in the database won't display in my browswer i still see empty table rows. I suspect its the guestbook.tpl file ... I don't know should it be like this:

{* Smarty *}
<html>
<head>
<title>Smarty GuestBook</title>
</head>
<body>
<table border="0" bgcolor="#eeeeee" width="300">
<tr>
<th colspan="2" bgcolor="#d1d1d1">Guestbook Entries (<a href="{$SCRIPT_NAME}?action=add">add</a>)</th>
</tr>
{foreach from=$data item="entry"}
<tr>
<td>{$entry.Name|escape}</td>
<td align="right">{$entry.EntryDate|date_format:"%e %b, %Y %H:%M:%S"}</td>
</tr>
<tr>
<td colspan="2" bgcolor="#dedede">{$entry.Comment|escape}</td>
</tr>
{foreachelse}
<tr>
<td colspan="2">No records</td>
</tr>
{/foreach}
</table>
</body>
</html>
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP