Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
eleytheria
Beginner


Joined: 05 Feb 2013
Posts: 15
Location: Canada

PostPosted: Fri Mar 15, 2013 10:01 pm   

#URL
 
Hey All,

I have a question concerning the usage of #URL.

There is a database that I am submitting stats to from the mud that I play. One of the variables has a space in it. In ZMUD, it manages to submit the URL successfully to the database with the space in it.

However, if I try to submit the data in CMUD, it chops the URL into 2 at the variable. (it loads two pages, one with the first half of the URL, one with the second half)

I tried putting a %20 in my variable where the space would be, and though this works for submitting the URL, it cuts the space out. Am I missing something simple here? Is there a way for me to prevent it from splitting the URL?

Thanks for any and all suggestions!

Edit:
I would also not like it to open this webpage at all if that's possible, I just want it to submit the stats. However, I can live with it opening the URL so long as it does it with the space in the var.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Tue Mar 19, 2013 12:27 am   
 
Can you post the code you're using please? #url "url%20with%20spaces" worked fine for me. And for not opening the webpage, you'd need to use %url for that instead.
Reply with quote
eleytheria
Beginner


Joined: 05 Feb 2013
Posts: 15
Location: Canada

PostPosted: Wed Mar 20, 2013 4:11 am   
 
#URL %concat("http://site.com/stats/submit/?ashtml=true&var1=", @VAR1, "&var2=", @VAR2, "&str=", %1, "&int=", %2, "&wil=", %3, "&dex=", %4, "&con=", %5)

The issue is that if @VAR2 has a space in it then CMUD calls #URL twice and it opens up two webpages and splits the URL in half. What I was saying, is if I put the %20 into my variable, it will in fact load as a single page, but then var2 goes into the database as a single work, instead of two words.

How would I send the data without opening the page using %url?

Thanks for all your help btw.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Wed Mar 20, 2013 5:04 pm   
 
Try %replace(@VAR1, " ", "%20"). And using %url (untested):
Code:
$url = %url("http://site.com/stats/submit/")
$url.ParamStr = %concat("ashtml=true&var1=", %replace(@VAR1, " ", "%20"), "&var2=", %replace(@VAR2, " ", "%20"), "&str=", %1, "&int=", %2, "&wil=", %3, "&dex=", %4, "&con=", %5)
$url.Get()
Reply with quote
eleytheria
Beginner


Joined: 05 Feb 2013
Posts: 15
Location: Canada

PostPosted: Wed Mar 20, 2013 6:57 pm   
 
Thanks Daern!

So, first off, the %replace worked like a charm and it's working without any issues!

However, I tried using %url and it doesn't compile properly. Tried a few different variations but I couldn't get it to work at all.

EDIT: I just realized %url only works with CMUDPro...is there a way to do this with %com?
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Thu Mar 21, 2013 3:42 pm   
 
If your browser has a COM interface, presumably it would be, but that's not something I've ever tried before.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
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

© 2009 Zugg Software. Hosted by Wolfpaw.net