By: pokemonjojo
Date: 2004-07-13
Time: 15:55
|
Need help to run another Php scriptHello i'm french, so my english is bad, lol, i'm sorry, but i need help.
First see the exemple page : http://www.tinybutstrong.com/apps/examples/tbs_us_examples.htm and see the "Execute another script". I have made nearly the same script, but i need to run php with variable. I have write :
but i have an error : Warning: tbs_locator_replace(search.php?): failed to open stream: No such file or directory in /home/www/users/1/p/o/k/pokemonjojo/www/007-musik.com2/tbs_class.php on line 1127 Warning: tbs_locator_replace(): Failed opening 'search.php?' for inclusion (include_path='.') in /home/www/users/1/p/o/k/pokemonjojo/www/007-musik.com2/tbs_class.php on line 1127 and i have read all post for php inclution, but i have note found a solution. If you have a solution. Thank |
|
By: Skrol29
Date: 2004-07-13
Time: 16:48
|
Re: Need help to run another Php scriptHi,
TBS uses the PHP function fopen() to read the file. If the file path begins with 'protocole://' then PHP suposes that it is an URL and try to open it as an URL. Otherwise PHP try to open it as a local file. So in your case, if the file is a PHP script that returns the content of the file, then it must be opened as an URL. So you have to provide and path like 'http://'.....'examples.php?ref=jojo' You can build the path string using PHP internal variables like $_SERVER['SERVER_NAME'] and $_SERVER['SCRIPT_NAME'] |
|
By: pokemonjojo
Date: 2004-07-13
Time: 16:55
|
Re: Need help to run another Php scriptok, i know that, but if i write
i have no error. I think the problème is if i write 'examples.php?ref=jojo' << When there is variable. Heu... do you speek french ? |
|
By: Skrol29
Date: 2004-07-13
Time: 17:23
|
[fr] Re: Need help to run another Php scriptOui je parle français :)
C'est quoi le message d'erreur que tu as avec $test = 'examples.php' ? |
|
By: Skrol29
Date: 2004-07-13
Time: 17:25
|
Re: Need help to run another Php scriptPardon, oublie mon message juste avant.
Oui c'est normale que tu n'as pas d'erreur car 'examples.php' est le nom d'un fichier local valide. Mais 'examples.php?ref=jojo' n'est pas le nom d'un fichier local valide. C'est une URL relative. |
|
By: pokemonjojo
Date: 2004-07-13
Time: 17:37
|
Re: Need help to run another Php scriptok mais tous marche bien quand je met $test = 'examples.php',
ca execute le fichier exemple.php sans problème, les echo 'Bla Bal Bla'; sont afficher correctement. Le hic, c'est quand je veux passer une variable, genre $test = 'examples.php?ref=jojo' il me met un message d'erreur, et ne m'affiche plus ce qu'il y a dans le fichier exemple.php (Normal car il ne le trouve pas) Alors que dois-je faire ? je suis bloqué! Merci de tes réponses super rapide. |
|
By: Skrol29
Date: 2004-07-13
Time: 17:51
|
Re: Need help to run another Php script'examples.php' est bien le nom dun fichier PHP, mais 'examples.php?ref=jojo' n'est pas le nom d'un fichier PHP.
Ce que tu peux faire, c'est :
|
|
By: pokemonjojo
Date: 2004-07-13
Time: 18:47
|
Re: Need help to run another Php scriptévidement !!! pourquoi dès fois, suis-je aussi bête !!!!
lol En tout cas, merci beaucoup pour ton aide et ta rapidité, vraiment génial (Je vais faire de la pub pour http://www.tinybutstrong.com lol) Et je te tiendrais au curant quand mon site sera finis. Merci pour tout |
|
By: eLiNK
Date: 2004-08-22
Time: 13:09
|
Re: Need help to run another Php scriptHi,
I hope there's nothing wrong if I expand the thread with my question. It is somehow related. Sorry to have to ask you a very basic question. I'm trying to get the value of a variable ($test) from an included script (langsel.php). The main part of my code (simplified for generalisation):
MyTemplate.htm containing [var.langsel;script=[val];getob]. The variable $test gets determined within langsel.php. I tried making it global, returning it with 'return' command but no go. |
|
By: Skrol29
Date: 2004-08-23
Time: 12:03
|
Re: Need help to run another Php scriptHi eLiNK,
[var] tags are usually merged during the Show() method. Thus, in your script, your trying to echo the $test variable before the 'langsel.php' script is called. You can use MergeSpecial() to merge [var] field before Show. You can also use the Render property to make Show() not exiting the application. Or you can use a [var.test] tag in you template after [var.lang] to see if it well definied. |
|
By: eLiNK
Date: 2004-08-23
Time: 12:53
|
Re: Need help to run another Php scriptHi Skrol29,
thank you for your quick answer. Actually I tried echoing $test (with
I'll give a try to your suggestion with MergeSpecial(), as it seems to be relevant in my case. What I'm trying to do is getting the value of the language chosen (within langsel.php), which obviously determines which language files are used for the page. |
|
By: Skrol29
Date: 2004-08-25
Time: 09:46
|
Re: Need help to run another Php scriptThe Show() method makes an exit() at the end. So nothing is executed after it. You can Use the Render property to not exit at the end. Its usge is explained in the manual.
|
|
By: botity
Date: 2004-08-26
Time: 08:38
|
Re: Need help to run another Php scriptmay be it is not linked with the topic but i just want to know if
it is possible to insert the result of a function instead of using an entire script . in my table , on field indicates a percentage (here task_perc)
then instead of showing the filed task_perc i want to show the result of the function , is it possible? thanks in advance |
|
By: Skrol29
Date: 2004-08-26
Time: 09:26
|
Re: Need help to run another Php scriptYou can do it using parameter onformat, or parameter onsection.
And maybe you can use the percentage format supported by TBS. |