TRUSTpunk help....PHP & WAP CODE

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
chewzzqq
-


Joined: 28 Sep 2005
Posts: 198

PostPosted: Sat Apr 08, 2006 12:48 pm    Post subject: TRUSTpunk help....PHP & WAP CODE Reply with quote

i build a wap site using wapbuddy..
and i want a counter..
so ,i go 2 download and install ezBOO...
in ezBoo setting, all is ok..

BUT i dunno how 2 add code inside my wap page.
always error with 2 include.
how 2 add the code if have 2 include?

wap index
---------------------
Code:
<?
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""." \"http://www.wapforum.org/DTD/wml_1.1.xml\">";

include("wapbuddy_settings.php"); ?>


<wml>
<card id="card1" title="<? echo $conf["site_name"] ?>">
   
   <p mode="nowrap">
      <b><? echo $conf["site_name"] ?></b><br/>
      <? echo $conf["welcome_message"] ?><br/>
   </p>
   <p mode="nowrap">
      <b>Downloads</b><br/>
      <? for ($i=0;$i<sizeof($conf["dirs"]);$i++) { ?>
         <a href="<?echo $conf["dirs"][$i]."/index.php";?>"><?echo $conf["dirs"][$i];?></a><br/>
                <? } ?>      
      <br/><a href="http://jonroig.com/phoneinfo.php">PHONE INFORMATION</a><br>
                <a href="http://gimchortrading.myvnc.com/news.wml">NEWS</a><br/>

   </p>

</card>
</wml>


counter code
-----------------
Code:
<?php
 include "config_sql.php";
 $c = mysql_connect("$server","$user","$password") or die($msgSqlConnectImpossible);
 $db = mysql_select_db("$base") or die($msgBaseConnectImpossible);
?>


Code:
<?php
  $table_log ="ez_logezboo";
  echo "Log: ".$table_log."<br/>";
  $reqdate=time();

  $result = mysql_query ("SELECT count(*) FROM $table_log WHERE DAYOFYEAR(date)=DAYOFYEAR(FROM_UNIXTIME($reqdate))");
  $row = mysql_fetch_array ($result);
  echo "Today: ";
  echo $row[0];
  echo "<br/>";

  $result = mysql_query ("SELECT count(*) FROM $table_log WHERE WEEK(date)=WEEK(FROM_UNIXTIME($reqdate))");
  $row = mysql_fetch_array ($result);
  echo "Week: ";
  echo $row[0];
  echo "<br/>";

  $result = mysql_query ("SELECT count(*) FROM $table_log WHERE MONTH(date)=MONTH(FROM_UNIXTIME($reqdate))");
  $row = mysql_fetch_array ($result);
  echo "Month: ";
  echo $row[0];
  echo "<br/>";
?>


help....how to add counter code into wap page?
thanks
Back to top View user's profile Send private message Visit poster's website
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Sat Apr 08, 2006 12:52 pm    Post subject: Reply with quote

Not sure if it makes a difference but you are missing "php" off when you open the tag, you are just putting "<?" instead of "<?php".
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
chewzzqq
-


Joined: 28 Sep 2005
Posts: 198

PostPosted: Sat Apr 08, 2006 1:19 pm    Post subject: Reply with quote

i try with this
Code:
<?php header("content-type:text/vnd.wap.wml"); ?>
<?php print '<?xml version="1.0"?>'; ?>
<?php print '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" '; ?>
<?php print '"http://www.wapforum.org/DTD/wml_1.1.xml">'; ?>

<?php
 include "config_sql.php";
 $c = mysql_connect("$server","$user","$password") or die($msgSqlConnectImpossible);
 $db = mysql_select_db("$base") or die($msgBaseConnectImpossible);
?>
<?php
  $table_log ="ez_logezboo";
  echo "Log: ".$table_log."<br/>";
  $reqdate=time();

  $result = mysql_query ("SELECT count(*) FROM $table_log WHERE DAYOFYEAR(date)=DAYOFYEAR(FROM_UNIXTIME($reqdate))");
  $row = mysql_fetch_array ($result);
  echo "Today: ";
  echo $row[0];
  echo "<br/>";

  $result = mysql_query ("SELECT count(*) FROM $table_log WHERE WEEK(date)=WEEK(FROM_UNIXTIME($reqdate))");
  $row = mysql_fetch_array ($result);
  echo "Week: ";
  echo $row[0];
  echo "<br/>";

  $result = mysql_query ("SELECT count(*) FROM $table_log WHERE MONTH(date)=MONTH(FROM_UNIXTIME($reqdate))");
  $row = mysql_fetch_array ($result);
  echo "Month: ";
  echo $row[0];
  echo "<br/>";
?>


<wml>
<card id="p1" title="FREE SUPPORT">
<do type="prev" label="Back"><prev/></do>
<p align="center">Free Support By<b>GIMCHORTRADING 2005-2006</b></p>
<p align="center"><br/><a href="http://gimchortrading.myvnc.com/index1.php">MAIN PAGE</a><br>


</p>
</card>
</wml>


i can open my wap page without problem,
but counter no come out,y?
Back to top View user's profile Send private message Visit poster's website
Yami King
-


Joined: 08 Sep 2005
Posts: 120

PostPosted: Sat Apr 08, 2006 1:35 pm    Post subject: Reply with quote

I see you only select the code from the database. Don't you have to add some hits to your DB :S..
Back to top View user's profile Send private message Send e-mail
chewzzqq
-


Joined: 28 Sep 2005
Posts: 198

PostPosted: Sat Apr 08, 2006 1:48 pm    Post subject: Reply with quote

i just follow the intruction only
Back to top View user's profile Send private message Visit poster's website
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Sat Apr 08, 2006 7:56 pm    Post subject: Reply with quote

I'm not the only one that know's PHP in this forum, so please don't just
request help by me. Alot of forum members try to be as helpful as they
can before relying on another person to help them.

As Yami King suggested, I don't see anywhere to update the counter
and so that could be the problem you're having. I will download it and
see what I can do with the code you already have.

Edit: You need to include the tag link in the pages you wish to log.

Make sure the path to "write_logs.php" is correct.
Code:

<? $table="ez_logezboo"; include ("eZWebStats/write_logs.php"); ?>


Note: I noticed that when you add PHP in the same pages as XHTML, it
will conflict with PHP code. I don't know how to fix this. :/

The same could be with WAP.
Back to top View user's profile Send private message Visit poster's website
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Sat Apr 08, 2006 10:06 pm    Post subject: Reply with quote

For the XML tags, you could either just do like "?".">", or use heredoc to print it.
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
chewzzqq
-


Joined: 28 Sep 2005
Posts: 198

PostPosted: Sun Apr 09, 2006 12:32 am    Post subject: Reply with quote

thank to all who help me ...

i done with this code ,use in (index.php)

Code:
<?php header("content-type:text/vnd.wap.wml"); ?>
<?php print '<?xml version="1.0"?>'; ?>
<?php print '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" '; ?>
<?php print '"http://www.wapforum.org/DTD/wml_1.1.xml">'; ?>

<?php $table="ez_logezboo"; include ("eZWebStats/write_logs.php"); ?>

<wml>
<card id="p1" title="FREE SUPPORT">
<do type="prev" label="Back"><prev/></do>
<p align="center">Free Support By<b>GIMCHORTRADING 2005-2006</b></p>
<p align="center"><br/><a href="http://gimchortrading.myvnc.com/index1.php">MAIN PAGE</a>
</p>
</card>
</wml>


and thank to TRUSTpunk remind me missing (eZWebStats)

sorry for my poor english
Back to top View user's profile Send private message Visit poster's website
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Sun Apr 09, 2006 2:09 am    Post subject: Reply with quote

We're glad it works. :-)
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
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 phpBB Group