TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 348
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 259
  • Total: 259

TP & creaing apps

Started by CND Bacon, October 11, 2007, 09:17:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CND Bacon

Hi

is there a DOC on how to create an app using TP and SMF?

basically i would like to be able to:

create a form that can save data to a mysql database
query the data

i have tried using the article manager - PHP area - but i am limited to the size of the article.

thank you.

G6Cad

I think you will get better answers through a google search on this, not many members on this site knows how to work with SQL.

What exactly are you trying to make with this ?  Perhaps there is a block code and snippet that will give you some ideas on how to work something out ?

CND Bacon

i'm mostly trying to learn

but as a test i'm making a clan search database

http://clans.onbiz.ca/smf

CND Bacon

the sql bit - not an issue for me - its trying to get the PHP code integrated.

CND Bacon

so i thought to myself that if i put my code in a PHP file then include that file in my PHP article
that would do away with the limitation of the article field size.

my problem now is that i've lost all of my integration with SMF

i called the SSI.php file to get the user name, etc... but nothing is displayed.

when i view the file directly it works.

grrrrrr

not working
http://clans.onbiz.ca/smf/index.php?page=14

working
http://clans.onbiz.ca/smf/apps/test1.php

btw - u have to register on the site to see it.

JPDeni

You really need to post your code if you want help with it.

You can increase the available size of an article by changing the settings within the database.

CND Bacon

#6
sorry - should have thought about that before.  ::)

moving along

here is the code in my article



if(!$context['user']['name'])
{
    header("Location:index.php?page=11");
}

$varUsername2 = $context['user']['name'];

include('http://clans.onbiz.ca/smf/apps/test1.php');


Code in the test1.php file

<?
echo $context['user']['name'];

require("/home/onbizcaa/public_html/clans/smf/SSI.php");

/////////////////////////////////////////////
//Global VARs
global $board, $topic, $txt, $db_prefix, $modSettings, $sourcedir, $context;
global $ID_MEMBER, $user_info, $board_info;

$varUsername = $user_info['username'];
$varEmail = $user_info['email'];

echo '
<form name="frmProcess" id="frmProcess" method="get">
<table>
<tr>
<td align="right">
<strong>Entered By:</strong>
</td>
<td>
'.$varUsername.' - '.$varUsername2.'
</td>
</tr>
<tr>
<td align="right">
<strong>Full Clan Name:</strong>
</td>
<td>
<input type="Text" name="txtClanName" id="txtClanName" value="">
</td>
</tr>
<tr>
<td align="right">
<strong>Clan Tag:</strong>
</td>
<td>
<input type="Text" name="txtClanTag" id="txtClanTag" value="">
</td>
</tr>
<tr>
<td align="right">
<strong>Date Est.:</strong>
</td>
<td>
<input type="Text" name="txtDateEst" id="txtDateEst" value="">
</td>
</tr>
<tr>
<td align="right">
<strong>WWW:</strong>
</td>
<td>
<input type="Text" name="txtSite" id="txtSite" value="">
</td>
</tr>
<tr>
<td align="right">
<strong>Clan Email:</strong>
</td>
<td>
<input type="Text" name="txtEmail" id="txtEmail" value="'.$varEmail.'" readonly>
</td>
</tr>
        <tr>
                <td colspan=2>
                     <input type="submit"> <input type="Reset">
                </td>
        </tr>
</table>
</form>
';
?>



The test1.php when viewed directly works wonderfully - showing the SMF user and user's email.

but when viewed as an include via the PHP article - it does not show the SMF user and user's email.

This website is proudly hosted on Crocweb Cloud Website Hosting.