Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

question in php

show page

This topic has been archived. This means that you cannot reply to this topic.
11 replies to this topic

#1 Asom

Asom

    CC Newcomer

  • Member
  • PipPip
  • 13 posts

Posted 24 May 2014 - 12:46 AM

Hello ..

 

i have 2 files for php ( start1, start2 )

 

in start 1 there is a buttons , one of them , i want when i press on it showing me start2.php file

 

i trying search about that but no result for what i need

 

please , some help :) :confused:


Edited by Roger, 25 May 2014 - 08:37 PM.


#2 Sundance

Sundance

    CC Devotee

  • Validating
  • PipPipPipPipPipPip
  • 572 posts

Posted 24 May 2014 - 01:12 AM

Can you share your code for both files please? WIthout knowing what you've done we can't tell you what to do next.


Please read the

FaQ & Guidelines


#3 Asom

Asom

    CC Newcomer

  • Member
  • PipPip
  • 13 posts

Posted 24 May 2014 - 01:16 AM

<?php
?>
<html>
<head>
<title>
صفحة البداية 
<meta http-equiv="content-type"content ="text/html;charest=utf-8"/>
</title>
<head>
</head>
<body>
<form method ="post" action ="temp.php">
<input type ="submit" value ="تسجيل قضية" name="1" ></br>
<input type ="submit" value ="تسليم قضية" name="2" ></br>
<input type ="submit" value =" ارسال تقرير" name="3" ></br>

</form>
</body>
	</html>


<form method ="post" action ="script.php" >
رقم العقد <input type ="text" name ="رقم العقد"/> </br>
اسم المستشار<input type="text" name="اسم المستشار"/></br>
اسم المحامي<input type="text" name="اسم المحامي"/> </br>
اسم العميل <input type="text" name="اسم العميل"/> </br>
تاريخ بدءالدعوة <input type="text" name="تاريخ بدء الدعوة"/> </br>
 <input type ="submit" value="إضافة" />
 <input type ="submit" value="تفريغ الحقول" />
 <input type ="submit" value="رجوع" />

</form>
<?php
	
if ($_post['1'])
	{show_start2.php
	}	
	
	
	
?>

the first box is for start1.php , the scend for start2.php



#4 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts

Posted 24 May 2014 - 02:28 AM

You just need to set the action in the form like this:

 

action ="start2.php"

 

Else, you need to do it by javascript with the onClick property of the button.



#5 Asom

Asom

    CC Newcomer

  • Member
  • PipPip
  • 13 posts

Posted 24 May 2014 - 02:40 AM

You just need to set the action in the form like this:

action ="start2.php"

Else, you need to do it by javascript with the onClick property of the button.

 i need start2.php show when i click on button name 1 only



#6 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts

Posted 24 May 2014 - 03:09 AM


	<input type=button onClick="parent.location='http://www.yourhost.com/start2.php'" >


#7 Asom

Asom

    CC Newcomer

  • Member
  • PipPip
  • 13 posts

Posted 24 May 2014 - 03:18 AM


	<input type=button onClick="parent.location='http://www.yourhost.com/start2.php'" >

where should but this code ? in start1 or start2 ? and which line ?



#8 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts

Posted 25 May 2014 - 02:19 AM

In start1.php

 

 
<form method ="post" action ="temp.php">
 
<input type=button onClick="parent.location='http://www.yourhost.com/start2.php'" value ="تسجيل قضية" name="1" ></br>
<input type ="submit" value ="تسليم قضية" name="2" ></br>
<input type ="submit" value =" ارسال تقرير" name="3" ></br> 
 
</form>
 


#9 Asom

Asom

    CC Newcomer

  • Member
  • PipPip
  • 13 posts

Posted 26 May 2014 - 05:51 AM

 

In start1.php

 
<form method ="post" action ="temp.php">
 
<input type=button onClick="parent.location='http://www.yourhost.com/start2.php'" value ="تسجيل قضية" name="1" ></br>
<input type ="submit" value ="تسليم قضية" name="2" ></br>
<input type ="submit" value =" ارسال تقرير" name="3" ></br> 
 
</form>
 

itsn't work , i try it but showing me ," the page not found"


Edited by Asom, 26 May 2014 - 05:53 AM.


#10 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts

Posted 28 May 2014 - 04:04 PM

Did you actually change for  your url, or for localhost?

 

you need to write in there the exact url you use to go to the desired page just as you input it in the browser



#11 Asom

Asom

    CC Newcomer

  • Member
  • PipPip
  • 13 posts

Posted 31 May 2014 - 08:29 AM

Did you actually change for  your url, or for localhost?

 

you need to write in there the exact url you use to go to the desired page just as you input it in the browser

when i change the url to localhost its nothing change , when i put the same url whis is u write it above , show me ther is not found page



#12 Incinerated

Incinerated

    CC Lurker

  • New Member
  • Pip
  • 6 posts

Posted 07 June 2014 - 04:32 PM

Asom, pay attention to the url where you are doing your testing/coding.

 

If you are working in a local environment such as XAMPP or WAMP, you will need to make sure both the files you are using are stored within the "root" directory. Next, you need to ensure that you change the link as follows:

http://localhost/start2.php

Otherwise, if you have your own website and are hosting those pages online, then you need to use your website's address in place of "localhost" in the above link. For example if you were testing those pages on codecall.net, you would use the link as http://www.codecall.net/start2.php






Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download