SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question $store = $_REQUEST[$variable]; Possible?

    I plead you people that know so much more than me - fix it

    Code:
    $stacking = 1;
    while ($stacking < 6) {
    	$description1 = "description".$stacking;
    	$description = $_REQUEST[$description1]; 
    
    	$stacking++;
    }

  2. #2
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Heres another example...I know both of these should work server side!!!

    Code:
    //trying not to list for $var1, $var2, $var3....
    
    $stacking = 1;
    while ($stacking < 6) {
    if (preg_match("/[a-zA-Z\-]/", $variable$stacking)) {
    //BAD
    }
    $stacking++;
    }

  3. #3
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,423
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    That should work assuming you have additional code using $description before you reassign its value in each loop. If you are having issues it is possible the problem lies elsewhere in the code.

  4. #4
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have the code alone on a php page with the variables in the url....neither examples will respond (the second one they get pulled first)

  5. #5
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,423
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Try echoing out the variables to make sure you are getting what you expect. Somewhere along the line you'll get a bad value.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •