trying something new since not much help from the forum

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
revocause
Forum Commoner
Posts: 94
Joined: Tue May 29, 2007 9:37 am

trying something new since not much help from the forum

Post by revocause »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I'm trying something new, because my last question stood for two weeks with some 'add confusion to existing confusion' scenario . 

here's my new idea, 
I will have a select menu / drop down menu. 

The values will be :
<option value="1">500</option>
<option value="2">1000</option>
etc 

I want to make a seperate php page to act as a handler . 

if i use this

Code: Select all

<?php 
// set variables
$x = $_POST['item1_quantity'];   // name of the select menu

if ($x == 1) {
    
    echo 
    $name = "Item 1 "; 
    $weight = 50; 
    $baseprice = 600;
    $quantity = 500;
?>


this doesnt work, can you check my code.
what i'd like it to do , is IF $x == 1
then it will set those attributes.
do i have to echo those, or can i just set the variables and they will become valid to use ?

I didnt get much help at all for the last two weeks on the other question. So im tyring to find a new way to completely code it .
Do you know of any other forums that actually help beginner php developers with real answers?
I think this forum is more for php experts and there doesnt seem much realistic logic to the beginner side of things
no offense, but two weeks is a long hair pulling scenario to be involved in a forum to help beginners with no real answers.

I understand that you want people to learn on their own, but the problem is the mods always have that knee-jerk assumption
that nobody has tried to learn things on their own first. I would much rather find the answer than have to watch the posts on this thing and
listen to the anal bleeding of the holier than thou mods.


and thanks everah for saying you'd get back to me two weeks ago and never doing so . :)


if you wish to be nazis against critique. then i shall expect to find my membership cancelled . L O L


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

[quote="[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1"][b]2.[/b] Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.[/quote]
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Don't antagonize the forum members. No one has a reason to subscribe to your post but you, so if we don't see it, we don't answer it. If you continue to do so, you're bound to stop getting any answers at all. As a "newbie," your best resource is the manual. Download it. It helps.

The best way to determine if something is wrong in your code is to look at any variable that you do not manually set. print_r($_POST) and see what you get.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: trying something new since not much help from the forum

Post by volka »

You might find

Code: Select all

<html>
  <head><title>---</title></head>
  <body>
<?php
if ( isset($_POST['item1_quantity']) ) {
  switch($_POST['item1_quantity']) {
  case '1':
    echo 'option #1 selected';
    break;
  case '2':
    echo 'option #2 selected';
    break;
  default:
    echo 'unknown option selected';
    break;
  }
}
?>    
    <form action="?" method="post">
      <div>
        <select name="item1_quantity">
          <option value="1">500</option>
          <option value="2">1000</option> 
        </select>
        <input type="submit" />
      </div>
    </form>
  </body>
</html>
interesting.
revocause wrote:if you wish to be nazis against critique. then i shall expect to find my membership cancelled . L O L
Yawn, Godwin's Law short-circuited
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: trying something new since not much help from the forum

Post by superdezign »

volka wrote:
revocause wrote:if you wish to be nazis against critique. then i shall expect to find my membership cancelled . L O L
Yawn, Godwin's Law short-circuited
:lol:
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Post by califdon »

revocause, I think you may have just hit on the solution: just discontinue reading this forum. Why would you think that just because there's a forum, its mission is to drop everything and help you? Those who state their questions clearly and don't spew abuse on the contributors usually get their questions answered.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

if you wish to be nazis against critique. then i shall expect to find my membership cancelled . L O L
If the next post out of you isn't much more mannered than this, then yes your account will be terminated. L O L :?
Post Reply