Solved

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

Posted on 2004-10-20
4
225 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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 how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

691 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