The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Programming Advice

4 posters

Go down

Programming Advice Empty Programming Advice

Post by RikaComet July 23rd 2009, 5:36 pm

hello fellow forumotioners

I'm a pinch right now.. one of my personal projects needs your help

regarding a simple program it is

only one objective:

for certain text it should return another text, thats all
these pre-determined responses should be storable as well

should i use visual basic?

if there is some programmer lurking through this thread please help~ Wink
RikaComet
RikaComet
Active Poster

Male Posts : 1536
Reputation : 18
Language : English , Hindi , Arabic , Urdu, Japenese , Punjabi , German
Location : thing called Earth

Back to top Go down

Programming Advice Empty Re: Programming Advice

Post by Guest July 23rd 2009, 7:14 pm

Personally for something like that,

I would use php and Javascript, the javascript will be needed to make the search, wait time, and results smooth as well as the trigger in order to return a result and the php will be used to store data and calculate the algorithm

Regards







Craig
avatar
Guest
Guest


Back to top Go down

Programming Advice Empty Re: Programming Advice

Post by Splytte July 24th 2009, 1:26 am

Post edit :

Here is an example.

$text = preg_replace('#\[b\](.+)\[/b\]#isU', '<strong>$1</strong>', $texte);

This is for example how the tags

Code:
[b]Text[/b]

is replaced by :

Code:
<strong>Test</strong>

Hope you understand... Wink

Edit : I didn't know this kind of message was accepted?

-=~Splytte~=-
Splytte
Splytte
Forumember

Female Posts : 753
Reputation : 18
Language : French, English, Dutch, Spanish, German, Japanese, Chinese (Beginner).
Location : Belgium

Back to top Go down

Programming Advice Empty Re: Programming Advice

Post by RikaComet July 24th 2009, 8:23 am


I would use php and Javascript, the javascript will be needed to make the search, wait time, and results smooth as well as the trigger in order to return a result and the php will be used to store data and calculate the algorithm

can it be done in visual basic? and stroing the data using sql?



@splytte: well I'm not asking help for forum , just avoiding paying a pro for such simple job lol: atleast its way better that "random facts about forumotion " or "why did you chose forumotion" stuff
RikaComet
RikaComet
Active Poster

Male Posts : 1536
Reputation : 18
Language : English , Hindi , Arabic , Urdu, Japenese , Punjabi , German
Location : thing called Earth

Back to top Go down

Programming Advice Empty Re: Programming Advice

Post by Splytte July 24th 2009, 2:47 pm

I know, and what I give you is not only for forums, you can use it to replace anything you want...

-=~Splytte~=-
Splytte
Splytte
Forumember

Female Posts : 753
Reputation : 18
Language : French, English, Dutch, Spanish, German, Japanese, Chinese (Beginner).
Location : Belgium

Back to top Go down

Programming Advice Empty Re: Programming Advice

Post by RikaComet July 24th 2009, 8:39 pm

what is it actually? mind telling me how it is used?
RikaComet
RikaComet
Active Poster

Male Posts : 1536
Reputation : 18
Language : English , Hindi , Arabic , Urdu, Japenese , Punjabi , German
Location : thing called Earth

Back to top Go down

Programming Advice Empty Re: Programming Advice

Post by Splytte July 24th 2009, 11:43 pm

This is a PHP regex.

The function preg_replace() replaces a certain text by another one.

For example, you have a variable text1, and you want to change a word in it.

Code:
<?php
// The first variable
$text1 = 'Cailhem is a good boss';

// You want to replace the word "good" by "bad"
$text2 = preg_replace('#good#', 'bad', $text1);

// You print the second variable, changed
echo $text2;
?>

# : It is the delimiter for what you want to change.

Wink

-=~Splytte~=-
Splytte
Splytte
Forumember

Female Posts : 753
Reputation : 18
Language : French, English, Dutch, Spanish, German, Japanese, Chinese (Beginner).
Location : Belgium

Back to top Go down

Programming Advice Empty Re: Programming Advice

Post by RikaComet July 25th 2009, 12:05 am

hmm php not my stuff can you give me a example of this

just a reminder

i want the program to behave like this

i enter 'Hi"
it returns "hello" or anything definable

i need it to be capable to store thousands of such combinations Wink
RikaComet
RikaComet
Active Poster

Male Posts : 1536
Reputation : 18
Language : English , Hindi , Arabic , Urdu, Japenese , Punjabi , German
Location : thing called Earth

Back to top Go down

Programming Advice Empty Re: Programming Advice

Post by Guest July 25th 2009, 12:27 am

Your also forgetting Splytte that that code you advised can only be used on a constructed code/website/forum which would also require Javascript in order to function in the first place.

I'll have a snoop around for a code you can actually use.

EDIT: Here is an example of a code that allows you to return predefined text if a certain word is entered, This script is however a SIMPLE version of an example.

Code:
<script type="text/javascript">
var text_only = function() {
  var retrn = document.getElementById("rtrn");
  if (retrn.value == "Hi") {
    alert("Hello ...");
    return true;
  } else {
    alert("Hi.");
    return false;
  }
}
</script>
<form method="GET" action="lookup_rtrnid"
    onsubmit="javascript:return text_only();">
 Say something: <input type="text" size="7" name="rtrn_id" id="rtrn"></input>
</form>

Again i made it simple so as not to confuse things, If the user types in 'Hi' the code then returns 'Hello', If they enter anything else apart from 'Hi' it returns 'Hi'


regards







Craig
avatar
Guest
Guest


Back to top Go down

Programming Advice Empty Re: Programming Advice

Post by Splytte July 25th 2009, 12:58 am

Well if you don't want it in PHP, I can't really help you sorry Wink

-=~Splytte~=-
Splytte
Splytte
Forumember

Female Posts : 753
Reputation : 18
Language : French, English, Dutch, Spanish, German, Japanese, Chinese (Beginner).
Location : Belgium

Back to top Go down

Programming Advice Empty Re: Programming Advice

Post by Cornelia July 25th 2009, 3:27 am

RikaComet wrote:hmm php not my stuff can you give me a example of this

just a reminder

i want the program to behave like this

i enter 'Hi"
it returns "hello" or anything definable

i need it to be capable to store thousands of such combinations Wink

"Not your stuff", because it was shown in a way that it looks complicated.
If you want to learn PHP, I suggest you this tutorial, even if the English might not be 100% perfect. The way it's explained makes PHP look easier to learn : http://www.newbiesparadise.com/tutorial-3-104-a-dynamic-site-using-php.html
Than, you complete with other sites' tutorials.
Cornelia
Cornelia
Hyperactive

Female Posts : 4763
Reputation : 173
Language : I'M NOT A TECHIE OR A MOD, SO QUIT SENDING ME PMS FOR TECHIE STUFF OR LOST PASSWORDS !!!
Location : Absent on weekends until camping season ends

http://ishimaru-design.servhome.org

Back to top Go down

Programming Advice Empty Re: Programming Advice

Post by RikaComet July 25th 2009, 11:39 am

Placehold wrote:Your also forgetting Splytte that that code you advised can only be used on a constructed code/website/forum which would also require Javascript in order to function in the first place.

I'll have a snoop around for a code you can actually use.

EDIT: Here is an example of a code that allows you to return predefined text if a certain word is entered, This script is however a SIMPLE version of an example.

Code:
<script type="text/javascript">
var text_only = function() {
  var retrn = document.getElementById("rtrn");
  if (retrn.value == "Hi") {
    alert("Hello ...");
    return true;
  } else {
    alert("Hi.");
    return false;
  }
}
</script>
<form method="GET" action="lookup_rtrnid"
    onsubmit="javascript:return text_only();">
 Say something: <input type="text" size="7" name="rtrn_id" id="rtrn"></input>
</form>

Again i made it simple so as not to confuse things, If the user types in 'Hi' the code then returns 'Hello', If they enter anything else apart from 'Hi' it returns 'Hi'


regards



so how do use it.. some file can you put it in one?

@cornelia: thanks i knew that site from before when i started learning html
its so cool and easy that mateo guy is awesome

question" i remember that his site was more broad and was a it different looking ..did he renovated it perhaps? Wink
RikaComet
RikaComet
Active Poster

Male Posts : 1536
Reputation : 18
Language : English , Hindi , Arabic , Urdu, Japenese , Punjabi , German
Location : thing called Earth

Back to top Go down

Programming Advice Empty Re: Programming Advice

Post by Xiso July 25th 2009, 2:50 pm

Cornelia wrote:
RikaComet wrote:hmm php not my stuff can you give me a example of this

just a reminder

i want the program to behave like this

i enter 'Hi"
it returns "hello" or anything definable

i need it to be capable to store thousands of such combinations Wink

"Not your stuff", because it was shown in a way that it looks complicated.
If you want to learn PHP, I suggest you this tutorial, even if the English might not be 100% perfect. The way it's explained makes PHP look easier to learn : http://www.newbiesparadise.com/tutorial-3-104-a-dynamic-site-using-php.html
Than, you complete with other sites' tutorials.

Making her surprise appearance is Cornelia. Very Happy
Xiso
Xiso
Forumember

Male Posts : 463
Reputation : 1
Language : English

Back to top Go down

Programming Advice Empty Re: Programming Advice

Post by Splytte July 25th 2009, 10:03 pm

Yep newbies paradize has become v3.0 a few times ago, before it was v2. For French, its siteduzero.com, much more complete.

-=~Splytte~=-
Splytte
Splytte
Forumember

Female Posts : 753
Reputation : 18
Language : French, English, Dutch, Spanish, German, Japanese, Chinese (Beginner).
Location : Belgium

Back to top Go down

Programming Advice Empty Re: Programming Advice

Post by RikaComet July 26th 2009, 12:03 pm

ok thanks
for now can some G.Mod temporarily lock this thread
i will have it open when i'm done with php
RikaComet
RikaComet
Active Poster

Male Posts : 1536
Reputation : 18
Language : English , Hindi , Arabic , Urdu, Japenese , Punjabi , German
Location : thing called Earth

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum