View previous topic :: View next topic |
Author |
Message |
nwim Smarty Rookie
Joined: 16 Apr 2008 Posts: 20
|
Posted: Wed Apr 16, 2008 7:58 pm Post subject: Guesbook Application setup help |
|
|
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 |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
|
Back to top |
|
nwim Smarty Rookie
Joined: 16 Apr 2008 Posts: 20
|
Posted: Wed Apr 16, 2008 9:08 pm Post subject: |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Apr 16, 2008 9:32 pm Post subject: |
|
|
It looks like that your definition of SMARTY_DIR does not point to the folder where SMARTY is installed. |
|
Back to top |
|
nwim Smarty Rookie
Joined: 16 Apr 2008 Posts: 20
|
Posted: Thu Apr 17, 2008 8:14 pm Post subject: |
|
|
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 |
|
Celeb Administrator
Joined: 17 Apr 2007 Posts: 1025 Location: Vienna
|
Posted: Thu Apr 17, 2008 8:31 pm Post subject: |
|
|
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 |
|
nwim Smarty Rookie
Joined: 16 Apr 2008 Posts: 20
|
Posted: Thu Apr 17, 2008 8:49 pm Post subject: |
|
|
Hey Celeb,
It's up! Thanks a bunches..
Thanks to all who replied |
|
Back to top |
|
rashidul Smarty n00b
Joined: 18 Apr 2008 Posts: 2
|
Posted: Fri Apr 18, 2008 4:53 am Post subject: |
|
|
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
regards
rashidul |
|
Back to top |
|
shannera Administrator
Joined: 13 Feb 2006 Posts: 802 Location: Edertal, Germany
|
Posted: Fri Apr 18, 2008 8:09 am Post subject: |
|
|
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 |
|
nwim Smarty Rookie
Joined: 16 Apr 2008 Posts: 20
|
Posted: Fri Apr 18, 2008 12:44 pm Post subject: |
|
|
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 |
|
pmathia Smarty n00b
Joined: 21 Apr 2008 Posts: 3
|
Posted: Mon Apr 21, 2008 4:31 pm Post subject: guestbook sample application help |
|
|
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 |
|
nwim Smarty Rookie
Joined: 16 Apr 2008 Posts: 20
|
Posted: Mon Apr 21, 2008 4:51 pm Post subject: |
|
|
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 |
|
pmathia Smarty n00b
Joined: 21 Apr 2008 Posts: 3
|
Posted: Mon Apr 21, 2008 5:34 pm Post subject: I have manually added rows to my guestbook table |
|
|
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 |
|
nwim Smarty Rookie
Joined: 16 Apr 2008 Posts: 20
|
Posted: Mon Apr 21, 2008 6:17 pm Post subject: |
|
|
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 |
|
pmathia Smarty n00b
Joined: 21 Apr 2008 Posts: 3
|
Posted: Mon Apr 21, 2008 9:26 pm Post subject: |
|
|
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 |
|
|