string problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
freiza
Forum Newbie
Posts: 4
Joined: Fri Jul 09, 2010 4:42 am

string problem

Post by freiza »

Code: Select all

//********************my.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
	<meta name="author" content="freiza" />

	<title>Untitled 2</title>
</head>

<body>

<?php 
print "<form action='run.php' method='get' enctype='text/plain'>
<input type=\"text\" name=\"one\" />
<input type=\"submit\" />
</form>
";
?>

</body>
</html>


//********************************run.php
<?php

/**
 * @author freiza
 * @copyright 2010
 */
print $_GET['one']." world";


?>
when i execute i get hello world...
Is there any way that i can get only hello and omit "world" without modifying run.php
Last edited by Benjamin on Fri Jul 09, 2010 5:49 am, edited 1 time in total.
Reason: Added [syntax=php] tags.
Skiddles2010
Forum Newbie
Posts: 19
Joined: Tue Jul 06, 2010 11:05 pm

Re: string problem

Post by Skiddles2010 »

Is there a particular reason behind not modifying run.php?
freiza
Forum Newbie
Posts: 4
Joined: Fri Jul 09, 2010 4:42 am

Re: string problem

Post by freiza »

any solutions?????
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: string problem

Post by requinix »

freiza wrote:any solutions?????
any answers to questions previously asked?????
agriz
Forum Contributor
Posts: 106
Joined: Sun Nov 23, 2008 9:29 pm

Re: string problem

Post by agriz »

Unless you modify the run.php, the answer is NO.

If you can explain why don't you want to modify run.php, we might think for next step.
freiza
Forum Newbie
Posts: 4
Joined: Fri Jul 09, 2010 4:42 am

Re: string problem

Post by freiza »

I have seen people doing it.
and i also want to know. I know it is possible.(using escape string or some other stuff)
internet-solution
Forum Contributor
Posts: 220
Joined: Thu May 27, 2010 6:27 am
Location: UK

Re: string problem

Post by internet-solution »

yes it is possible in many different ways. But all of these will involve changing run.php
Post Reply