Chrisj Posted June 22, 2009 Share Posted June 22, 2009 In this if/else function (below), how can I put some space between "Success! Payment Complete!" and "Go To Display". When it shows up on the web page those two lines are stacked right on top of each other. How do I put some space between them? Thanks if ($query1 && $query) { $result = "Success! Payment Complete!"; $rlink = "search.php"; //$rlink = "search.php?".$slink; $rtitle = "Go To Display"; }else{ $result = "There was a problem processing your request. Try again later or"; $rlink = "page.php?page=2"; $rtitle = "Contact Support"; } } Quote Link to comment https://forums.phpfreaks.com/topic/163301-help-with-putting-some-space-between-lines/ Share on other sites More sharing options...
PugJr Posted June 22, 2009 Share Posted June 22, 2009 I'm not sure exactly what you mean, but would using <br> work as to space them from each other? Quote Link to comment https://forums.phpfreaks.com/topic/163301-help-with-putting-some-space-between-lines/#findComment-861579 Share on other sites More sharing options...
Chrisj Posted June 23, 2009 Author Share Posted June 23, 2009 Thanks for that reply. I tried this: $result = "Success! Payment Complete!"<br><br>; and I tried this: $result = "Success! Payment Complete!"; <br><br> $rlink = "search.php"; //$rlink = "search.php?".$slink; $rtitle = "Go To Display"; Both were unsuccessful. Quote Link to comment https://forums.phpfreaks.com/topic/163301-help-with-putting-some-space-between-lines/#findComment-861591 Share on other sites More sharing options...
PugJr Posted June 23, 2009 Share Posted June 23, 2009 No, no. You did this: $result = "Success! Payment Complete!"<br><br>; Thats wrong. Do this: $result = "Success! Payment Complete!<br><br>"; Why that is, is because all the content must stay within the "". Quote Link to comment https://forums.phpfreaks.com/topic/163301-help-with-putting-some-space-between-lines/#findComment-861593 Share on other sites More sharing options...
Chrisj Posted June 23, 2009 Author Share Posted June 23, 2009 Thank you for your reply, but your suggestion appears on the web page like this: Success! Payment Complete! <br><br> Any other suggestions, would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/163301-help-with-putting-some-space-between-lines/#findComment-861643 Share on other sites More sharing options...
PugJr Posted June 23, 2009 Share Posted June 23, 2009 Enable HTML? Quote Link to comment https://forums.phpfreaks.com/topic/163301-help-with-putting-some-space-between-lines/#findComment-861683 Share on other sites More sharing options...
Chrisj Posted June 23, 2009 Author Share Posted June 23, 2009 Enable html is probably good advice, but I don't know what in particular to do with that in regard to my request for help. Quote Link to comment https://forums.phpfreaks.com/topic/163301-help-with-putting-some-space-between-lines/#findComment-861915 Share on other sites More sharing options...
gizmola Posted June 23, 2009 Share Posted June 23, 2009 Paste your current code please. Quote Link to comment https://forums.phpfreaks.com/topic/163301-help-with-putting-some-space-between-lines/#findComment-862264 Share on other sites More sharing options...
Chrisj Posted June 23, 2009 Author Share Posted June 23, 2009 Thanks for your reply. Here is the page of code: <?php session_start(); //CHECK IF FORM SUBMITTED if ($_POST['submitted'] == 'yes') { $pages = $_POST['id']; if (!isset($_POST['id'])) { echo "<script>document.location.href='index.php'</script>"; die(); } $skey = $_SESSION['searched']; if ($_POST['user_id'] != "") { $member_id = $_POST['user_id']; } if ($_POST['ttl'] != "") { $total = $_POST['ttl']; } } foreach ($pages as $vid) { $my_db_info[] = $vid; } include_once ('classes/config.php'); include_once ('classes/functions.inc.php'); $member_credits = get_member_credits($member_id); $balance = $member_credits - $total; if ($member_credits >= $total && $balance >= 0) { for( $x = 0; $x < sizeof( $my_db_info ); ++$x) { $sql = "INSERT INTO credits_temp ( mem_id, vid_id ) VALUES ( $member_id, $my_db_info[$x] )"; $query = @mysql_query($sql); } $sql1 = "UPDATE credits SET total_credits=$balance where user_id=$member_id"; //subtract credits $query1 = mysql_query($sql1); if ($query1 && $query) { $result = "Success! Payment Complete!<br><br>"; $rlink = "search.php"; //$rlink = "search.php?".$slink; $rtitle = "Go To Display"; }else{ $result = "There was a problem processing your request. Try again later or"; $rlink = "page.php?page=2"; $rtitle = "Contact Support"; } } else{ $error = "You do not have enough credits. To purchase credits, "; $rlink = "credits.php"; $rtitle = "Click Here"; } $template = "themes/$user_theme/templates/main_1.htm"; $inner_template1 = "themes/$user_theme/templates/inner_buy.htm"; //middle of page $TBS = new clsTinyButStrong; $TBS->NoErr = true; // no more error message displayed. $TBS->LoadTemplate("$template"); $TBS->MergeBlock('mp', $members_full); $TBS->Render = TBS_OUTPUT; $TBS->Show(); @mysql_close(); die(); /* // show "nothing to show" empty arrays if (empty($result_featured)) { $show_v = 1; } else { $show_v = 2; } // display results $template = "themes/$user_theme/templates/main_1.htm"; $inner_template1 = "themes/$user_theme/templates/inner_buy.htm"; //middle of page $TBS = new clsTinyButStrong; $TBS->NoErr = true; // no more error message displayed. $TBS->LoadTemplate("$template"); $TBS->MergeBlock('blkfeatured', $result_featured); $TBS->Render = TBS_OUTPUT; $TBS->Show(); @mysql_close(); die(); */ ?> Quote Link to comment https://forums.phpfreaks.com/topic/163301-help-with-putting-some-space-between-lines/#findComment-862317 Share on other sites More sharing options...
gizmola Posted June 24, 2009 Share Posted June 24, 2009 Ahh, so it now all becomes clear. You are using some form of templating system, so this is why, when you stick in a into a string, it appears translated to the html entities rather than getting the effect of having the embedded tag. For templating systems, the markups is suppossed to be in the templates. We would need to know more about your template engine to help at this juncture, but it seems that spacing should be handled in the template itself, or in your .css, not by trying to inject blank line markup into the result string. Quote Link to comment https://forums.phpfreaks.com/topic/163301-help-with-putting-some-space-between-lines/#findComment-862946 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.