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 7525633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:36:17+00:00 2026-05-30T03:36:17+00:00

) i want the smallest possible script to send current URL via email without

  • 0

)
i want the smallest possible script to send current URL via email without a send button
but as a result of an if { } else {} condition..

ideas anyone?

ok.. i have gotten so far.. got a script on one end reciving and mailing
the desired data to the desired email.. then i need a way to send the current
page URL without a send button but as a result of an if (!notsomething) {} else{ send!!}

so i have this so far AND it works!! but i am getting partial URL
instead of “http://www.example.com/subfile.php” i am getting just “/subfile.php”

$websiteurl = $_SERVER['REQUEST_URI'];
$curl_connection =  curl_init('http://www.sagive.co.il/downloads/wordpress/linkRemovedNotification.php');

//set options
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);

//set data to be posted
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $websiteurl);

//perform our request
$result = curl_exec($curl_connection);

//show information regarding the request
print_r(curl_getinfo($curl_connection));
echo curl_errno($curl_connection) . '-' . curl_error($curl_connection);
//close the connection
curl_close($curl_connection);

For some weird reason it wont send when i use:

$websiteurl = $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];

.
SO.. thats the last problem.. ideas anyone?

  • 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-30T03:36:19+00:00Added an answer on May 30, 2026 at 3:36 am

    Ok! solved it 🙂 – thanks for your help and your time.
    here is the code i used and it works (Collected from sites across the web)

    //extract data from the post
    $currentw = $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
    $currentth = SpaceJunkie;
    
    //set POST variables
    $url = 'http://www.example.com';
    $fields = array(
                            'siteurl'=>urlencode($currentwebsite),
                            'themename'=>urlencode($currentheme),
                    );
    
    //url-ify the data for the POST
    foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
    rtrim($fields_string,'&');
    
    
    //open connection
    $ch = curl_init();
    
    //set the url, number of POST vars, POST data
    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_POST,count($fields));
    curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
    
    //execute post
    $result = curl_exec($ch);
    
    //close connection
    curl_close($ch);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to write a program to find the n-th smallest element without using
To minimize latency (I don't care about packet loss) I want the smallest possible
I want to write a method which converts a decimal to the smallest possible
want to have a Hyperlink-Button in a gridView in which I can display a
Want the function to sort the table by HP but if duplicate HPs then
want to ask user to input something but not want to wait forever. There
I want to find the n-th smallest element for each row in a matrix.
Possible Duplicate: Smallest IDE for PHP with code-completion? Can anyone give me link to
I have a table of lastNames and userNames. I want the 'smallest' (lexically speaking)
Basically i want to search for the smallest (positive) value from a bunch of

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.