PHP - Moved: How To View Php Output?
This topic has been moved to PHP Applications.
http://www.phpfreaks.com/forums/index.php?topic=329855.0 Similar TutorialsThis topic has been moved to PHPFreaks.com Questions, Comments, & Suggestions. http://www.phpfreaks.com/forums/index.php?topic=353984.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=357187.0 This topic has been moved to Application Frameworks. http://www.phpfreaks.com/forums/index.php?topic=353397.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=314265.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=357163.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=345631.0 Well I have a script that executes a scan on a system set to run infinitely, and I need it to echo out a message each time it loops through, but I don't want it to echo out the message with the next loop message below it, and the next one below that etc... I've tried using the flush(); function and been messing around with that with no luck. For security reasons I don't want to release any of the processing code, but here is the basic construction of the script: <?PHP ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** $RepeatIt = -1; for($g=1; $g!=$RepeatIt+1; $g++) { ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** $ScanMessage = ":.:.: SCANNING THE HITLIST FOR MOBSTER: ".$MobName." (SCAN #$g) :.:.:"."<br/><br/>"; echo $ScanMessage; ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** ***PROCESSING AND SCAN CODE*** } ?> At the moment it's returning: :.:.: SCANNING THE HITLIST FOR MOBSTER: DEUS EX DESTROYER (SCAN #1) :.:.: :.:.: SCANNING THE HITLIST FOR MOBSTER: DEUS EX DESTROYER (SCAN #2) :.:.: :.:.: SCANNING THE HITLIST FOR MOBSTER: DEUS EX DESTROYER (SCAN #3) :.:.: :.:.: SCANNING THE HITLIST FOR MOBSTER: DEUS EX DESTROYER (SCAN #4) :.:.: So what I want it to do is just delete the scanning message and replace it with the next scan message so while running this script you would see just the number increment on the same line. Any suggestions? Thanks. Hi. idea: View image from /skins/ folder. The id for the image is taken from mysql DB field called PlayerDefaultSkin So, lets say a user has 240 in the field in database and in /skins/ folder I have image called 240.png What I want is to php read from PlayerDefaultSkin field and view the image from /skins/ Right now I have this: query to update: Code: [Select] `PlayerDefaultSkin` = $data[PlayerDefaultSkin]' and the output code Code: [Select] <img src="skins/<?php echo '$PlayerDefaultSkin' ?>.png"> which simply doesnt work and is probably very wrong. So can anyone help me with this? Hello, I need some help modifying some code. I would like to change the layout to show more then currently offered. As of now I have a layout that shows either 3 or 10 images. I tried to change the numbers, but no luck and I can not seem to be able to change to view more. Any help would be great! Code: [Select] // image list $mysqlDataImage = mysql_query( "SELECT * FROM $DB_IMAGE where collectionID=$cat $where ORDER BY $order_by" ); $dataLength = mysql_num_rows( $mysqlDataImage ); $totalImages = $dataLength; //$cat_scrollview = 3; //FORCE SCROLLER if($scrollview == "smaller"){ $cat_scrollview = 0; } //User Override //SWITCH SCROLL LAYOUT BASED ON VIEW : HANDLES COLUMNS, ROWS, PAGES AND SHOW ALL if (($cat_scrollview == 3)||($scrollview == "bigger")){ $PAGE_SIZE = 3; //how many pics per page, all set in html $rowDefault = 1; //row default-changes the most $colDefault = $totalImages/ 1; //columns default use to breakup columns //echo "cols=".$colDefault; //echo "totalimage=".$totalImages; //See getNumberOfRows() $totalPages = $totalImages/$PAGE_SIZE; $cat_scrollview = 3; $scrollview = "bigger"; }else{ $PAGE_SIZE = 10; //how many pics per page, all set in html $rowDefault = 2; //row default-changes the most $colDefault = $totalImages/ 2; //columns default use to breakup columns //echo "cols=".$colDefault; //echo "totalimage=".$totalImages; //See getNumberOfRows() $totalPages = $totalImages/$PAGE_SIZE; $cat_scrollview = 0; $scrollview = "smaller"; } I am new to PHP so please be kind (and explain slowly) Thank you! Hi, I have tried a "Hello.php" to open in my web browser. It throws 404 file not found error. I am using Intranet. How to determine the web server I am using? Thanks. Please help! how can i query data from different tables? I've tried so many codes already but it won't work.
Attached Files
Untitled1.png 39.93KB
0 downloads I'm very new to MVC and I'm trying to figure out how to transition my code and I'm not sure where to place things. It easy to want to just put everything in the view, but I know that doesn't make sense. Can you please guide me on how I should transition the rest of my code for my header? I'm currently using codeigniter. Current View Code: [Select] <?php $page = substr(end(explode(DIRECTORY_SEPARATOR, $_SERVER['PHP_SELF'])), 0, -4); $title = (array_key_exists($page, $page_names) !== false) ? $page_names[$page]: ''; if (array_key_exists($page, $page_names) !== false) { $title .= " | Jason Biondo"; } $banner_imgs = array('contact.jpg', 'about.jpg', 'tools.jpg', 'portfolio.jpg', 'articles.jpg'); $nav_names = array('Contact', 'About', 'Tools', 'Portfolio', 'Articles'); $gutter_values = array('307', '230', '161', '84', '0'); $alt_page = 'Articles'; foreach($nav_names as $k => $name) { if($page === strtolower($name)) { $g_value = $gutter_values[$k]; } } if(!isset($g_value)) { $g_value = 0; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" dir="ltr"> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta http-equiv="content-script-type" content="text/javascript" /> <meta http-equiv="content-style-type" content="text/css" /> <meta http-equiv="content-language" content="en" /> <meta name="description" content="Jason is a serial entrepreneur that builds web applications using advanced programming technologies and unique interface design." /> <meta name="keywords" content="jason , entrepreneur, investors, venture capitalist, angel investor, vc, ventures, private equity, startups, startup community, startup investments, investment network, raise capital, where to find capital, fund raising, venture financing, contact investors, angel fund, angel group, investment strategy, business plan" /> <title><?=$title?></title> <link rel="shortcut icon" type="image/x-icon" href="/assets/img/favicon.ico" /> <link rel="stylesheet" type="text/css" media="screen" href="/css/style.css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> <script src="./js/jquery.validate.min.js"></script> <script src="./js/jquery.corner.js"></script> <script src="./js/init.js"></script> <?php if (file_exists("./assets/js/pages/${page}.js")) { echo "<script type=\"text/javascript\" src=\"./js/pages/${page}.js\"></script>"; } ?> </head> <body> <div class="header"> <div class="header_container"> <a href="/"> <img class="logo" src="/assets/img/logo.png" alt="Jason" title="Jason" /> </a> <div class="navigation f_right"> <div class="gutter"> <span id="nav_highlight" class="nav_highlight" style="left: <?php echo $g_value; ?>px;"></span> </div> <ul> <?php foreach($nav_names as $k => $name) { if(is_odd($k)) { ?> <li class="pike"></li> <?php } ?> <li> <a id="<?php echo strtolower($name); ?>" <?php echo (($page === strtolower($name)) || ($alt_page === $name)) ? 'class="selected"' : ''; ?> href="/<?php echo ($name === $alt_page) ? '' : strtolower($name); ?>"><?php echo $name; ?></a> </li> <?php if(is_odd($k)) { ?> <li class="pike"></li> <?php } } ?> </ul> </div> </div> </div> <div class="stripe"></div> <div id="content_container" class="content_container"> <div id="banner" class="banner"> <?php foreach($nav_names as $k => $name) { if(($page === strtolower($name)) || ($alt_page === $name)) { ?> <img src="/assets/img/banners/<?php echo $banner_imgs[$k]; ?>" /> <h1><?php echo $name; ?></h1> <?php break; } if($alt_page === $name) { ?> <img src="/assets/img/banners/<?php echo $banner_imgs[$k]; ?>" /> <h1><?php echo $name; ?></h1> <?php } } ?> </div> <div class="banner_stripe"></div> <div class="content"> Current Controller Code: [Select] <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Writing extends CI_Controller { public function index() { $this->load->library('common'); $data['page_names'] = $this->common->page_names(); $data['is_odd'] = $this->common->is_odd(); $this->load->view('includes/header', $data); $this->load->view('writing_view'); $this->load->view('includes/footer'); $this->output->enable_profiler(TRUE); } } Dera All, SAMPLE TABLE FIELDS AND DATAS: USER PASSWORD ACCNO AMOUNT INTEREST JOE JOE@123 1234 4500.00 250.00 SAM SAM123 5678 12050.00 350.00 RAM RAM987 8521 15698.00 568.00 MARY MARY786 7542 14879.00 567.00 RAJ RAJ876 8531 45622.00 1500.00 FIRST PAGE: USER NAME : RAM PASSWORD : ******** SUBMIT SECOND PAGE: ACCOUNT NO 8521 THIRD PAGE: HI WELCOME RAM UR BALACE AND INTEREST IS BALANCE : 15698.00 INTEREST : 568.00 HI AM NEW TO PHP. I need the code for above page. If the user only authenticate to view his accounts. Others not possible to view the other accounts hello, is there a simple way to have a full size calendar that shows current month and on each day, it will look into my mysql table and if i have an entry on that day, show the sales field. i have spent days googling, and trying my own and i just cant get anything. if i had a calendar script, i could do the rest, but i cant seem to find it, or make it. by any means is there a way to view a email.php form source? not just the html part but the entire script including the php? Im trying to make this news blog for my assignment. When user selects a certain blog the blog id is stored in the veriable $blogid. I am using the SELECT FROM WHERE but something is going wrong cos it keeps telling me :Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in F:\xampp\htdocs\Blog\viewBlog.php on line 12. What is the problem and what do i have to change?? This problem is in the second page the View blog page. this is my code: View all page: <html> <body> <?php $dbc = mysqli_connect('localhost','root','','blogdb') or die ('Error: Could not connect to database. Please try again'); $query = "SELECT title, postdatetime, username FROM blog"; //echo "$query"; $result = mysqli_query($dbc, $query); /*echo"<table border=1>"; echo "<tr> <th> Title</th> <th> Postdatetime</th> <th> Posted by :</th> </tr>"; */ while($row = mysqli_fetch_array($result)) { $Title = $row ['title']; $PostDateTime = $row ['postdatetime']; $Username=$row['username']; $url= "viewBlog.php?blogid=".$blogid; echo "<a href = $url> $Title $PostDateTime</a></br>"; } mysqli_close($dbc); ?> </body> </html> View Blog page : <?php $blogid= $_GET ['blogid']; $dbc = mysqli_connect('localhost','root','','blogdb') or die ('Error: Could not connect to database. Please try again'); $query = ("SELECT * FROM blogs WHERE blodid = '$blogid'"); $result = mysqli_query($dbc, $query); while($row = mysql_fetch_array($result)) { $Title = $row ['title']; $Content = $roe ['content']; echo "$Title $Content"; } mysqli_close($dbc); ?> Hi,
i have two methods with different function, each is calling to view a record from database. now i want store this two methods into one view.
ex.
model
function 1() { table_0ne } function 2() { table_two }controller function 1() { view 1,2 }it is possible, please help.. and i have code below, and it is not work when i apply $datax public function generate_po() { $po_id = $this->input->post('selector'); $data['result'] = $this->public_base_model->generate_po($po_id); $datax['result'] = $this->public_base_model->get_max_num(); if($this->session->userdata('logged_in')) { $session_data = $this->session->userdata('logged_in'); $data['username'] = $session_data['username']; $data['fname'] = $session_data['fname']; $data['userid'] = $session_data['userid']; $this->load->view('generate_po', $data, $datax); } else { $this->load->view('login'); } } Hi coders,
code below are running good, but my problem is i did not get the line echo $row->pof_num + 1; into view "generate_po.php".
since i want that line to get the value and put into input text like below. how and kindly assist.
<input type = "text" name = "num" value = "<?php echo $row->pof_num + 1; ?>"> public function generate_po() { $po_id = $this->input->post('selector'); $data['result'] = $this->public_base_model->generate_po($po_id); if($this->session->userdata('logged_in')) { $session_data = $this->session->userdata('logged_in'); $data['username'] = $session_data['username']; $data['fname'] = $session_data['fname']; $data['userid'] = $session_data['userid']; $this->load->view('generate_po', $data,$this->get_max()); } else { $this->load->view('login'); } } public function get_max() { $query2 = $this->db->query("SELECT pof_num FROM pull_out where pof_num = '8800000582'"); $row = $query2->row(); echo $row->pof_num + 1; // i want this line to put into view. $query2->free_result(); } Hello, I have php application, it is hosted on a shared server. How can I view the errors in my application with the details of the error for my website users? Thanks, looking for a way to view the PHP source code of any PHP page on the web. Looking for a way to obtain PHP source code in order to help me with a certain issue. Advise. |