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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:38:02+00:00 2026-06-15T17:38:02+00:00

I want to create my own plugin, but I have no idea how to

  • 0

I want to create my own plugin, but I have no idea how to handle a form.

For example I have this code from the twitter-stream plugin’s settings page:

<form action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>" method="post">
    <label for="consumerkey" style="font-weight:bold;display:block;width:150px;">Consumer Key:</label> <input type="text" value="" id="consumerkey" name="consumerkey" />
    <label for="consumersecret" style="font-weight:bold;display:block;width:150px;margin-top:5px;">Consumer Secret:</label> <input type="text" value="" id="consumersecret" name="consumersecret" />
    <input type="submit" value="Save" style="display:block;margin-top:10px;" />
</form>

I can’t understand this:

action="php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI'])"

I’ve read many books on PHP and only saw this:

action="somescript.php" for the URL.

I just don’t know where to put the code that handles my form.

Can I just put my code in the plugin’s php file (called scheduler.php, located in wordpress/wp-content/plugins/scheduler/scheduler.php)?

Also, show me some examples of how to handle the form in wordpress please.

By the way, I just need two fields on my settings page: username and password, and I’d want the field’s content to be stored in the database when the admin presses submit button.

And I still can’t understand how

action="php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI'])"

is converted to

action="/sheduled/wp-admin/options-general.php?page=twitterstreamauth" 

Sorry my English is not very good. Thank you very much for your attention.

  • 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-06-15T17:38:03+00:00Added an answer on June 15, 2026 at 5:38 pm

    By googling %7E, I found that it’s a reserved code in Unix, representing a tilde (~). Because lots of servers run Unix Operating Systems, you can’t use the symbol %7E. You can however use the symbol ~ which may be used in a web address or somewhere on the page.

    php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']) takes the string stored in $_SERVER (which is a special array) from the key named REQUEST_URI. It then replaces every occurence of %7E with ~. In maybe 99% of the cases, no symbols are replaced but there still might be a chance of a tilde in the url. It’s quite trivial but echo echoes the edited string.

    In this case, the string /sheduled/wp-admin/options-general.php?page=twitterstreamauth is returned by $_SERVER['REQUEST_URI'], the symbol %7E is not found so the string is just echoed into the html code.

    The action="..." is the action the browser needs to execute when the form is submitted, in this case open the file options-general.php?page=twitterstreamauth

    Also, if you don’t know how to store the contents of a form into the database, you haven’t read enough PHP books. You’d need to learn PHP + MySQL to store something in a database.

    I hope this helps you understand the code a bit better.

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

Sidebar

Related Questions

I want to create my own class named Point, but am running into issues
I am writing a plugin for wordpress and I want to create my own
i'm trying to create my own jquery plugin but am having problems bubbling the
I want to create a marker with own annotations within a PlugIn using the
I want to create own filetype to save objects in my app. Basically, I
I want to create my own SeekBar because I can't find anything like with
I want to create my own IM and I'm searching an open-source IM APIs.
I want to create my own event - OnPositionChange . Event implementation of course
I want to create my own component which consists two other panels. One of
I want to create my own PHP web app where people can signin with

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.