Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3598074
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:11:50+00:00 2026-05-18T20:11:50+00:00

I have the following line of PHP code which works great: exec( ‘wget http://www.mydomain.com/u1.php

  • 0

I have the following line of PHP code which works great:

exec( ‘wget http://www.mydomain.com/u1.php > /dev/null &’ );

u1.php acts to do various types of maintenance on my server and the above command makes it happen in the background. No problems there.

But I need to pass variable data to u1.php before it’s executed. I’d like to pass POST data preferably, but could accommodate GET or SESSION data if POST isn’t an option. Basically the type of data being passed is user-specific and will vary depending on who is logged in to the site and triggering the above code. I’ve tried adding the GET data to the end of the URL and that didn’t work.

So how else might I be able to send the data to u1.php? POST data preferred, SESSION data would work as well (but I tried this and it didn’t pick up the logged in user’s session data). GET would be a last resort.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:11:50+00:00Added an answer on May 18, 2026 at 8:11 pm

    To do it the way you have you would do this, probably using http_build_query

    exec("wget --post-data 'a=b&c=d' http://www.mydomain.com/u1.php > /dev/null &");
    

    However, I would be curious to know why you are choosing to use wget over cURL or, if the file is on the same server, calling it directly. It seems a bit clumsy to use wget for this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following line of PHP code which works great: exec( 'wget http://www.mydomain.com/u1.php
I have the following PHP code that uses cURL: $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,http://area51.stackexchange.com/users/flair/31.json); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
I have the following test line in my PHP which works fine as a
I have a unit test which contains the following line of code Site.objects.get(name=UnitTest).delete() and
I have following code which works fine in firefox and ie 8, but in
I have the following code which works when i put it in any blank
I have the following code which works perfectly, but I want to allow access
I have the following code, which works fine on live site, but not on
I have the following error: Notice: Undefined index: submit in C:\wamp\www\registration\register.php on line 6
Question: What ruleset do I need to do the following redirects: [1] http://www.xyzblog.com/foo/bar.php =>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.