Sigx

We are the future in the past.
It is currently Mon Mar 18, 2024 7:02 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Thu May 12, 2005 11:26 am 
Offline

Joined: Thu May 12, 2005 12:44 am
Posts: 28
Location: Netherland
ok, sending the message:
Code:
POST /update.php HTTP/1.1
Host: sigx.yuriy.net
User-Agent: User-Agent: SigX
Content-Type: application/x-www-form-urlencoded
Content-Length: (bodylenght)

username=Usename&password=UsePass&data=Music:%20nothing%20is%20playing&version=SigXMacOS

to sigx.yuriy.net Port 80, get's me an error (it won't even send?)
( HTTPSckt.connect
HTTPSckt.post m_strMessage )

and sending the data as one long URL:
Code:
sixg.yuriy.net/update.php/username=Usename&password=UsePass&data=Music:%20nothing%20is%20playing&version=SigXMacOS

(which goes on my theory that even just cutting and pasting this into a browser would update SigX <!--Correct me if i'm wrong with this--! )

gave me an [--- error to update --], even though the username and password are filled in and correct

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 12:04 pm 
Offline

Joined: Mon Mar 15, 2004 1:48 pm
Posts: 1397
Location: Los Angeles
passing it as a url will not work, because thats using the GET mothod. it requiers the POST method.

_________________
Image

Image

Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 12:09 pm 
Offline

Joined: Thu May 12, 2005 12:44 am
Posts: 28
Location: Netherland
i'm using httpsckt.post URL to send the data though

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 12:11 pm 
Offline

Joined: Mon Mar 15, 2004 1:48 pm
Posts: 1397
Location: Los Angeles
make sure the data is not empty aswell as the username and password.

_________________
Image

Image

Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 12:18 pm 
Offline

Joined: Thu May 12, 2005 12:44 am
Posts: 28
Location: Netherland
Code:
  URL = "http://sigx.yuriy.net/update.php?username=" + "****" + "&password=" + "****" + "&data=" + "Music: not listening" + "&version=SigOSX1"
  HTTPSckt.post URL

gives me an error 400, bad request
same if i don't use http://, use a / instead of ? after update.php and/or replace my data with urlencode("Music: not listening")

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 10:21 pm 
Offline

Joined: Thu Dec 09, 2004 5:24 am
Posts: 140
Location: Hiding inside my laptop
i dont know if this helps, but anyway, this is the code I use in TclSigX to update signatures:

(in config.tcl):
Code:
set ::settings::other::updateUrl "sigx.yuriy.net:80/update.php"


(in tclsigx.tcl):
Code:
::http::geturl $::settings::other::updateUrl -query "username=[urlEncode $::settings::account::username]&password=[pwdc $::settings::account::password]&data=[urlEncode $::data::sig]&version=TclSigX-$::data::version"


that last command returns a token which I store in $httpToken. i then do:
Code:
::http::wait $httpToken


which stops TclSigX doing anything until it receives a response from the server, then I check the response with:
Code:
if {[::http::data $httpToken]!={[--- Update Successful ---]}} {
    puts ""
    puts stderr "Error: The server (${::settings::other::updateUrl}) did not seem to accept the update. :-/ Returned output was:"
    puts stderr " \"[::http::data $httpToken]\" "
    exit
  }


# and we are now finished! ^^
puts "Finished! ^_^"
exit


as you can see, high level languages such as Tcl take care of many of the little details that can get in the way at times. :-)

_________________
Image


Top
 Profile  
 
 Post subject: Thanks for all the help
PostPosted: Thu May 12, 2005 10:28 pm 
Offline

Joined: Thu May 12, 2005 12:44 am
Posts: 28
Location: Netherland
Thanks for all the help, especialy Buddy1007 who pointed me on what to do in the end

In the end all that had to be done was:
Code:
  Dim form as Dictionary
 
  // create and populate the form object
  form = New Dictionary
  form.value("username") = username
  form.value("password") = password
  form.value("data") = data
  form.value("version") = version
 
  // setup the socket to POST the form
  HTTPSckt.setFormData form
  httpSckt.post "sigx.yuriy.net/update.php"
  'httpSckt.post "http://sigx.yuriy.net/test/postget.php" //Testing Server

and it works :)

_________________
Image


Top
 Profile  
 
 Post subject: Re: Thanks for all the help
PostPosted: Fri May 13, 2005 8:31 pm 
Offline

Joined: Thu Dec 09, 2004 5:24 am
Posts: 140
Location: Hiding inside my laptop
Marius_Th wrote:
Code:
  'httpSckt.post "http://sigx.yuriy.net/test/postget.php" //Testing Server


testing server? no one ever meantioned this to me. was there something in this thread about it? i read though most of the thread and didnt see anything about it. could someone please explain whats going on here? :? :roll:

(btw, im glad you got your problem solved ;-))

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 13, 2005 8:54 pm 
Offline

Joined: Thu Jul 03, 2003 3:06 pm
Posts: 652
its just a test page that returns a post and get statements. Because he was having it get instead of post

http://sigx.yuriy.net/test/postget.php?x='test'

_________________
Image
~~~SigX C++ Edition~~~


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 13, 2005 9:26 pm 
Offline

Joined: Mon Mar 15, 2004 1:48 pm
Posts: 1397
Location: Los Angeles
breadcrust, look at my post on first page

_________________
Image

Image

Image


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 14, 2005 12:25 am 
Offline

Joined: Thu May 12, 2005 12:44 am
Posts: 28
Location: Netherland
yuriy wrote:
breadcrust, look at my post on first page

you edited that post after i saw already, so i missed it..
sorry :(

good news still is it's working, now i only have to make it's preferences savable, and give it some nice features ^^;

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group