1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kotykmax [81]
3 years ago
6

create 2 text field web form where 1 field allows the user to specify the text spring to search for and the other field allows t

he user to specify the replacement string. the page should also show a sentence of your choosing that the search and replace will be performed on.
Computers and Technology
1 answer:
mixas84 [53]3 years ago
6 0

Answer:

<?php

$error = '';

$string = "This is a sample string. Hello World";

if(isset($_POST["modify_str"])){

$show_form = false;

extract($_POST);

// check that user entered some value

if(empty($string_search)){

$error += 'Please fill out the string to be searched for <br>';

$show_form = true;

}

// check that user entered some value

if(empty($string_replace)){

$error += "Please fill out the string/word to be replaced for <br>";

$show_form = true;

}

// if user has entered some value, then replace it in the string using the str_replace function and print the string after modification

if (!$show_form){

$string = str_replace($string_search, $string_replace, $string);

echo "String after modification: <br>";

echo $string;

}

}

else

{

$show_form = true;

}

if($show_form)

{

?>

Please select any word to search for and replace for in the following string <br>

<?php echo $string; ?>

<br> <br>

<form action="" method="post">

<label for="string_search"> String to search for: </label>

<input type="text" name="string_search" id="string_search" required="required" /> <br> <br>

<label for="string_replace"> Replace with: </label>

<input type="text" name="string_replace" id="string_replace" required="required" /> <br> <br>

<input type="submit" id="modify_str" name="modify_str" value="Modify String"/>

</form>

<?php

}

?>

Explanation:

The program was written with php.

It is designed such that it can create 2 text field web form where 1 field allows the user to specify the text spring to search for and the other field allows the user to specify the replacement string.

See answer for the program code.

You might be interested in
(50 points) Jeff wants to create a responsive web page where elements change size according to the size of the window. How would
iris [78.8K]

Answer:

make the element sizes a percentage

Explanation:

Without using a framework specified for this type of thing such as Bootstrap, the best way to do this would be to make the element sizes a percentage. By making the size of everything a percentage it will automatically resize itself to take up the same percentage of the screen at all times. Even when the browser window is resized to any size that the user wants. This also applies to monitors of different sizes and mobile devices.

5 0
3 years ago
You have just installed the microsoft windows 7 operating system on your pc. which web browser is bundled with windows 7 and is
kirill [66]
The web browser that is automatically installed with windows 7 is Internet Explorer.

Hope this helps.
6 0
4 years ago
A(n) ____ is a secure, private path across a public network that is set up to allow authorized users private, secure access to t
yKpoI14uk [10]
It's VPN(Virtual Private Network). It allows company to have private network at the same time secure. While others are not that secure.
4 0
3 years ago
The web today is an amazing visual and interactive stew, teeming with images, photos, videos, and whizzy web apps. Some of the w
mariarad [96]

Answer:

The correct answer to the following question is "true".

Explanation:

The answer is true because if we open any web site or web app on our mobile phone there is are a lot of information about that site. In these sites, there is a login option that option is used for providing further details. If we login on site. It stores our detail and sends the notifications in our device.

So the correct answer is "true".

3 0
4 years ago
Piers wants to take a course on XML. He is a certified web designer, but he has not used XML before. How can he use XML to impro
Andrej [43]

Answer:

Check Explanation (last paragraph, please).

Explanation:

The acronym "XML" simply stand for Extensible Markup Language and it is a programming language that is for coding infomation or data.

Extensible Markup Language(XML) is very acceptable and whenever one read or search a website that uses XML, it gives viewers good experience.

Piers can use XML to improve his website creations through the declaration of a namespace which has an integral part to a script element. The tags in XML does not have limitation like other languages. Also, Extensible Markup Language(XML) does not need to be updated all the time in as much as the website itself is being updated.

7 0
4 years ago
Other questions:
  • What are the coordinates of point B in the diagram? A. (3.25, -2.5) B. (4, -5) C. (1, 3) D. (2.5, 0)
    11·2 answers
  • True or false? malware problems and other compromises of your computer information are rare.
    15·1 answer
  • ____ port is a connection in which eight data lines transmit an entire byte of data at one moment in time.
    12·1 answer
  • Fill in the correct formula called a contains numbers from Rhodes 1 to 20 you can use the formula blank to find the volume of th
    14·1 answer
  • Research online the variety of web services (see pages 197-198) currently available to software developers. List three different
    15·1 answer
  • To use   ( 2 complement ) answer it (101101)2 – (1100)2 =   (                    )2
    12·1 answer
  • What is a cloud in the world of computing
    7·1 answer
  • Learning is Fun
    5·1 answer
  • What are 5 good movies like The Breakfast Club or 8 Mile?
    14·2 answers
  • Blank are what make up the World Wide Web.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!