MSFN Forum: PHP Help - MSFN Forum

Jump to content



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

PHP Help Rate Topic: -----

#1 User is offline   Batch User 

  • Newbie
  • Group: Members
  • Posts: 28
  • Joined: 23-November 06

Posted 05 December 2006 - 03:26 PM

There will be no code because I haven't the slightest idea of how I will do this. But what I am working on is a Control Panel for my customer. What she needs done is a page where she can see all the artists she has in the database which she can checkmark which to edit (DONE). When all selected artists are checked, their names are sent in POST data to another page which displays the VALUES in input text boxes. This will be so she can change the name of the artist if she misspelled them when she added them. Problem is when I do the php/mysql update, i dont know how to specify the WHERE parameter. I would do WHERE name = '$last_name' but the last name gets lost and only the edited name gets passed along. How would I go about sending along the original name along with the edited one (or an ID as each artist has an ID field)?


#2 User is offline   LLXX 

  • MSFN Junkie
  • PipPipPipPipPipPipPipPipPip
  • Group: Banned
  • Posts: 3,399
  • Joined: 04-December 05

Posted 05 December 2006 - 06:59 PM

View PostBatch User, on Dec 5 2006, 04:26 PM, said:

but the last name gets lost and only the edited name gets passed along.
Ever heard of "hidden submit fields"?

#3 User is offline   WBHoenig 

  • Member
  • PipPip
  • Group: Members
  • Posts: 186
  • Joined: 20-March 05

Posted 07 December 2006 - 07:50 PM

...or session variables.

To do this with session vars, just put the following at the top of each page:

<?php session_start(); ?>
.

Then, set what you want to keep as a session variable, just like a post variable.

<?php $_SESSION['var_name'] = 'whatever'; ?>


You can then reference it from any page, as it is passed along on the server.

<?php echo $_SESSION['var_name']; ?>


Of course, this isn't exactly the most safe method in the world; nor is it perfect feature wise. But it works for starters.

This post has been edited by WBHoenig: 07 December 2006 - 07:53 PM


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



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy