User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,609 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,621 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 141 | Replies: 3 | Solved
Reply
Join Date: Jun 2007
Posts: 178
Reputation: macneato is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 12
macneato's Avatar
macneato macneato is offline Offline
Junior Poster

Help, Dynamic Subject for mail script

  #1  
Jul 10th, 2008
Hi,

So I'm creating a website for clients that have tons of different courses available, they have opted to not place any course outlines within the site and instead, make the interested party request it via a email.

Now, here is where my problem comes in, I would like to create just one script, that handles all the requests and the subject should just change.

E.g
Excel 2003 Level 1
Excel 2003 Level 2
Excel 2003 Level 3
Excel 2007 Level 1

When the user clicks on Excel 2003 Level 1, i would like a window to popup, with my default form,

<form action="req_out.php" method="post" name="form1" class="course_header style1 style2">
          Request  course outline          
        </form>        </td>
      </tr>
      <tr>
        <td width="12%" bgcolor="#04508E" class="content style1">Email Address :</td>
        <td width="17%" bgcolor="#04508E"><input name="email" type="text" class="content" id="email"></td>
        <td width="10%" bgcolor="#04508E"><span class="content style1">Company :</span></td>
        <td width="17%" bgcolor="#04508E"><input name="company" type="text" class="content" id="company"></td>
        <td width="7%" bgcolor="#04508E"><span class="content style1">Course :</span></td>

 <td width="17%" bgcolor="#04508E"><input name="course" type="text" class="content"></td> -- ?? with the course they just clicked on

I hope any of this made sense if not, please ask and i will try explain better.

I would appreciate any help at all.

Thanks alot.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 238
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: Help, Dynamic Subject for mail script

  #2  
Jul 10th, 2008
Are you storing these courses in a table ?
Excel 2003 Level 1
Excel 2003 Level 2
Excel 2003 Level 3
Excel 2007 Level 1
If yes, then, just pass the id of the clicked course in the query string of the popup, query the table and fetch the relevant course. If the courses are hardcoded, then put the courses in a session array variable. For the hyperlink of courses, use the index of this array and pass it in the query string.
Simple example.
  1. //test.php
  2. <?php
  3. session_start();
  4. $courses = array();
  5. $courses[]="course1";
  6. $courses[]="course2";
  7. $_SESSION['courses'] = $courses;
  8. foreach($courses as $key => $courses_offered) {
  9. echo "<a href='popup.php?courseid=".$key."'>".$courses_offered."</a><br />";
  10. }
  11. ?>
and this is popup.php
  1. <?php
  2. //popup.php
  3. session_start();
  4. $courseid = $_REQUEST['courseid'];
  5. $courses = $_SESSION['courses'];
  6. echo $courses[$courseid];
  7. ?>
This is just a simple example to show how you can do it..
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Jun 2007
Posts: 178
Reputation: macneato is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 12
macneato's Avatar
macneato macneato is offline Offline
Junior Poster

Re: Help, Dynamic Subject for mail script

  #3  
Jul 10th, 2008
Thanks Nav,

I kinda get what you saying, let me give it a bash see how far I can get.
Last edited by macneato : Jul 10th, 2008 at 8:50 am.
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 238
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: Help, Dynamic Subject for mail script

  #4  
Jul 10th, 2008
Cool !
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 12:10 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC