Solved

send (php)url with vars & no browser window (os:windows)

Posted on 2004-10-20
4
220 Views
Last Modified: 2010-04-01
I have a php file on my webspace that uses my computername and Username when I send it.
I have no problem gathering the this information. The problem is sending it without opening a browser window.
I have never done any socket prog. so I would rather not go this route. I have tried the following commented out parts below.
And have tried pinging the site. Non of this seems to activate the php file.

So My question in simple form would be:
How do I access a url, without opening a browser window. Allowing my php file to use the variable in the url.

I have posted my current simplified code below:


#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <Wininet.h>
#include <shellapi.h>

#define MX 500

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{

      char cName[MX] = "NULL";
      char uName[MX] = "NULL";
      unsigned long bufSize = MX;

      // get Computer and User name
      GetComputerName(cName,&bufSize);
      GetUserName(uName,&bufSize);

      char str[1024];

      sprintf(str, "http://MyWebsite.com/phpFile.php?cName=%s&uName=%s",cName , uName);

      //  ShellExecute(NULL, "open", str, NULL, NULL, SW_HIDE); //tried no file written

      //InternetOpenUrl(NULL,str,NULL,0,0, NULL); //tried no file written


               MessageBox(0,str,"Info",0);

      return 0;
}

0
Comment
Question by:cafechris
  • 2
4 Comments
 
LVL 12

Expert Comment

by:OnegaZhang
ID: 12356640
0
 
LVL 19

Accepted Solution

by:
mrwad99 earned 100 total points
ID: 12358401
0
 
LVL 1

Author Comment

by:cafechris
ID: 12361108
mrwad99
Thanks, I forgot to try that one late last night. I just used it last week too......must have been a late one.

Onega Zhang, thanks, but I already understood mrwad99's post. I will try to figure out yours when I get some time.

Thanks guys for the quick responses
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 12361211
>> Thanks guys for the quick responses

Glad we could help :)
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Find boost header files using gnu make (MinGW) on Win 7 11 88
What does std::atomic give me? 7 124
convert char array to number in c 5 85
Best book to learn C++ 4 79
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question