BleepingComputer.com: PHP, forms, and symfony 1.2

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

PHP, forms, and symfony 1.2 How to use multiple forms??

#1 User is offline   petocities 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 102
  • Joined: 03-June 06
  • Location:Santiago Chile

Posted 25 April 2009 - 11:24 AM

Hello everyone.
First off, I'm working in Gnome, with netBeans and the Symfony framework (v 1.2.4)
I guess what i'm trying to do is quite simple, but as for I am quite new to php, and also to symfony, I'm having a hard time to do it.
Basically, what I want to do is to show some options (just plain html text), but have a form for each option. The first option is to input a date to make a SQL query in a DB, and the second option is to upload a file. I have both of 'em working, but not in the same template. The following code should be enough, for it is quite simple code:
indexSuccess.php
<div>
	<h1>Administratork</h1>

	<h3>Option 1</h3>
	<?php include_partial('formGenerate', array('formGenerate' => $formGenerate)) ?>
	
	<h3><a href="<?php echo url_for('home/upload') ?> ">upload file</a></h3>
</div>


uploadSuccess.php
<form action="<?php echo url_for('home/previewUpload') ?>" method="POST" enctype ="multipart/form-data" >
  <table>
	<?php echo $fileUpload ?>
	<tr>
	  <td colspan="2">
		<input type="submit" />
	  </td>
	</tr>
  </table>
</form>


So, the indexSuccess gives the 2 options, but I haven't found a way to show both forms in the same page, so I can get rid of the link to the second page, thus eliminating an unnecesary step for the user. I tried using another include_partial, but it didn't let me (couldn't find the reason behind this). Any/All help is deeply appreciated guys, all coments regarding how to improve my crappy php skills ;)

PD: If more info is needed, please say so.
Posted Image

#2 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,605
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 25 April 2009 - 11:29 AM

A good place to start is by maybe telling us why you can't put the two snippets of code together?
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#3 User is offline   petocities 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 102
  • Joined: 03-June 06
  • Location:Santiago Chile

Posted 25 April 2009 - 12:03 PM

haha, I guess it just didn't occur to me, as they are commonly shown in different files through the tutorials I've seen.
Sorry to bother for such a silly matter, but I'm still really new to html and php.
Posted Image

#4 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,605
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 25 April 2009 - 02:22 PM

lol.. I didn't mean it that way. I thought that maybe they were throwing an error or something. So you have not just tried putting them into the same .html page?
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users