sporks Posted April 30, 2008 Share Posted April 30, 2008 I've set a session variable that spits out the ID of the previous page. There is a hidden field on my insert form which I've set to equal the session variable. I have the variable echoing so I know it works but if you insert the form, the field shows up as null. What is wrong with my field? <input type="hidden" name="pastID" value="<?php $_SESSION['fromID'] ?>" /> <input type="hidden" name="MM_insert" value="form1" /> Also I have a repeating region spitting out text and I wanted to place the word 'or' between each one. Is there a way I can put something in between a repeating region without it that something also on the end. ie NOT: 'field one' or 'field two' or Quote Link to comment Share on other sites More sharing options...
Rowno Posted April 30, 2008 Share Posted April 30, 2008 Well the problem with the value in your input being null is happening because you're not echoing the session variable. Try this: <input type="hidden" name="pastID" value="<?php echo $_SESSION['fromID']; ?>" /> Quote Link to comment Share on other sites More sharing options...
jaymc Posted April 30, 2008 Share Posted April 30, 2008 <?=$_SESSION['fromID']?> Shorthand version Quote Link to comment Share on other sites More sharing options...
sporks Posted April 30, 2008 Author Share Posted April 30, 2008 Great got that all sorted. Thanks guys! How do I go about inserting 'or' between titles without having it spit at the end of a list..as in only between repeating records? Quote Link to comment Share on other sites More sharing options...
revraz Posted April 30, 2008 Share Posted April 30, 2008 Which you shouldn't recommend since the majority of issues are because short tags are off. <?=$_SESSION['fromID']?> Shorthand version Quote Link to comment Share on other sites More sharing options...
Rowno Posted May 1, 2008 Share Posted May 1, 2008 If you are using a while loop you could do something like this: <?php $x = 0 while (what ever your condition is) { if ($x != "0") { echo "or"; } //your repeating title code here $x++; } ?> This will place 'or' before every title except when $x is equal to 0 which is only on the first loop so no 'or' will appear before the first title. Note: You can do this with any loop, I just used while as an example. I hope that solved all your problems Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.