Re: [PHP] Socket problem plz read.

2007-02-01 Thread Scripter47

Richard Lynch skrev:

On Wed, January 31, 2007 9:39 am, Németh Zoltán wrote:

On sze, 2007-01-31 at 16:26 +0100, Scripter47 wrote:

I'm making a simple socket server that just receive some data, and
then
send some data back again to the client.

EDIT:
I forgot to tell that i need help!

I have search around for hours now, and the examples are always not
what
I needed :(

the program is written in Python, if that helps, and is something
like this

this is PHP list. go to Python list with that, I suggest


I believe the OP is asking how to write the PHP to RECEIVE that data
from the Python script.


That's what I want!

plz help me, with some sample code :)

Or, possibly, how to implement that same code in PHP.

http://php.net/sockets
is still my best answer...



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Socket problem plz read.

2007-01-31 Thread Scripter47

Stut skrev:

Németh Zoltán wrote:

On sze, 2007-01-31 at 16:26 +0100, Scripter47 wrote:

I'm making a simple socket server that just receive some data, and then
send some data back again to the client.

EDIT:
I forgot to tell that i need help!

I have search around for hours now, and the examples are always not what
I needed :(

the program is written in Python, if that helps, and is something 
like this


this is PHP list. go to Python list with that, I suggest

greets
Zoltán Németh


The script the OP is connecting to is a PHP script, so assuming it's 
that script that the OP is having problems with it's kinda relevant.


To the OP: Your Python script is wrong. The host should just be 
localhost. You are trying to mix HTTP and UDP, and it's never going to 
work.


For the PHP side, read the manual (http://php.net/socket_create), have a 
go and come back if/when you have problems.


But before you do that, make sure the Python side is right, for which 
you'll need a Python mailing list.


-Stut



# Set the socket parameters
host = "http://localhost/in/sql.php";
port = 1
buf = 1
addr = (host,port)

# Create socket
UDPSock = socket(AF_INET, SOCK_DGRAM)

# Send messages:

# Loop
while (1):
# userinput
data = raw_input('>> ')
if not data:
break
else:
# Send to the PHP page
if(UDPSock.sendto(data,addr)):
print "Sending message '",data,"'."

# Close socket
UDPSock.close()


it is a program that send data by sockets, (not port 80)

It has to a simple solution :)

plz ask for more information.




--
   _.____  __
  /   _/ ___|__|__/  |_  ___  /  |  \__  \
  \_  \_/ ___\_  __ \  \ \   __\/ __ \_  __ \/   |  |_  //
  /\  \___|  | \/  |  |_> >  | \  ___/|  | \/^   / //
/___  /\___  >__|  |__|   __/|__|  \___  >__|  \   | //
 \/ \/ |__| \/   |__|






OKay. thanks I didn't knew that you couldn't mix http and UDP :D

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Socket problem plz read.

2007-01-31 Thread Scripter47

I'm making a simple socket server that just receive some data, and then
send some data back again to the client.

EDIT:
I forgot to tell that i need help!

I have search around for hours now, and the examples are always not what
I needed :(

the program is written in Python, if that helps, and is something like this

# Set the socket parameters
host = "http://localhost/in/sql.php";
port = 1
buf = 1
addr = (host,port)

# Create socket
UDPSock = socket(AF_INET, SOCK_DGRAM)

# Send messages:

# Loop
while (1):
# userinput
data = raw_input('>> ')
if not data:
break
else:
# Send to the PHP page
if(UDPSock.sendto(data,addr)):
print "Sending message '",data,"'."

# Close socket
UDPSock.close()


it is a program that send data by sockets, (not port 80)

It has to a simple solution :)

plz ask for more information.




--
  _.____  __
 /   _/ ___|__|__/  |_  ___  /  |  \__  \
 \_  \_/ ___\_  __ \  \ \   __\/ __ \_  __ \/   |  |_  //
 /\  \___|  | \/  |  |_> >  | \  ___/|  | \/^   / //
/___  /\___  >__|  |__|   __/|__|  \___  >__|  \   | //
\/ \/ |__| \/   |__|

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Socket problem

2007-01-30 Thread Scripter47
I'm making a simple socket server that just receive some data, and then 
send some data back again to the client.


it is a program that send data by sockets, (not port 80)

It has to a simple solution :)

plz ask for more infomation.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php & javascript interaction

2007-01-26 Thread Scripter47

Myron Turner skrev:

William Stokes wrote:

Hello,

I need some advice on how to learn Javascript and PHP interaction. Any 
good tutorials on the web would be most welcome. I particulary need to 
learn how to pass JS user input/choices to PHP.


My current problem is how to ask user confirmation over his actions on 
a web form after POST. "Are you sure" type questions and how to pass 
the user choice back to program make choices with PHP.


Thanks
-Will

  
For the second question try google with something like "javascript form 
submit".


For the first question, see:
http://ca.php.net/manual/en/language.variables.predefined.php
Form data is captured in PHP in a number of different predefined 
variables accessible from your scripts.  This page defines these 
varibables.



Use AJAX

Link: http://javascript.internet.com/ajax/ajax-navigation.html

is migth be what you are looking for:
http://javascript.internet.com/ajax/check-username-signup.html


The cool thing with AJAX is that it can load pages while viewing the 
webpage. Without updating it!


check out this chat i made with it:
http://wsd.riddergarn.dk/index.php?p=chat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] dynamic lists

2007-01-18 Thread Scripter47

Hey!

I got the same problem with a php chat.. look at 
http://wsd.riddergarn.dk?p=chat


Here is a link to a AJAX site:
http://javascript.internet.com/ajax/

Here is the tutorial that helped my...:
http://javascript.internet.com/ajax/ajax-navigation2.html


[FONT=23]Scripter47[/FONT]


Don skrev:

I'm a noob.

 


My question is whether PHP can produce dynamic drop lists and if so what the
tags are so that I can look them up.

 


By dynamic drop list I mean the type where the options contained in the
subsequent list depend on what was picked in the previous list without
clicking submit. 

 


For instance: say the first list is of the states, then the second list
updates to contain cities within that state as options.

 


Thanks,

Don

 





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php