Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

PHP, forms, and symfony 1.2


  • Please log in to reply
3 replies to this topic

#1 petocities

petocities

  • Members
  • 102 posts
  • OFFLINE
  •  
  • Location:Santiago Chile
  • Local time:12:48 PM

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

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:09:48 AM

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?

#3 petocities

petocities
  • Topic Starter

  • Members
  • 102 posts
  • OFFLINE
  •  
  • Location:Santiago Chile
  • Local time:12:48 PM

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 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:09:48 AM

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?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users