Echoing Codes
I have a simple script for an IFrame for my forum page...
<?php if(!isset($_GET['post'])){ echo '<iframe src="/forum/" name="fleet" width="800" height="auto" scrolling="no" frameborder="no" id="fleet"> Your browser does not support inline frames or is currently configured not to display inline frames. </iframe>'; }else{
echo '<iframe src="/forum/viewtopic.php?p='.$_GET['post'].'" name="fleet" width="800" height="auto" scrolling="no" frameborder="no" id="fleet"> Your browser does not support inline frames or is currently configured not to display inline frames. </iframe>';} ?>
Whenever I open the page, it does not automatically expand to the framed page height, how can I fix this...?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Echoing Sql
Another good thing to do would be to set the sql statement equal to a variable instead of just inside of the mysql_query() function. PHP Code:
Echoing Image
form action="index.php#order" method="post" name="image1" id="image1"> <input name="image1" type="submit" id="image1" value="Buy!"> form action="index.php#order" method="post" name="image2" id="image2"> <input name="image2" type="submit" id="image3" value="Buy!"> <form name="form1" method="post" action="thankyou.php"> <?php if ($_POST[image1]) { echo "<img src="image/image1.jpg">"; } if ($_POST[image2]) { echo "<img src="image/image2.jpg">"; } ?>
Problem Echoing
If I set a varaible as $EOL = " " But then want to echo that to a HTML page to see the above string i.e. by doing: echo($EOL); How do I do it? I've tried quotemeta, addslashes and htmlspecialchar but can't seem to work it out.
Echoing An '&' Character?
I'm trying to figure out how to include an '&' character in a php echo. I'm not looking for the html & a m p ; special character, but the actual character, since i'm trying to do this: Code: echo "<A HREF"/download.php?type=wallpaper&file=$filename">Download</A>"; instead it returns a link such as this: Code: /download.php?type=wallpaperfile=wallpaper.zip
Echoing Php In A Textfield
when i echo out text from mysql in a text area field it also echoes out the line breaks e.g it doesn't happen if i echo out anywhere else on the page, could i do a preg_replace to make all the line breaks echo NULL? Code:
Echoing Out A While In A Table
i use this while loop to echout all my categories at once, but is there a way i could have them echo out in a table say 5 across at a time? Code:
Echoing Strings With Quotemarks?
I have a statement that gives me an error: echo "<table><tr><td>Title</td><td>Author</td><td>Date added</td><td>Hits</td></tr><tr><td><a href="test">$arttitle</a></td><td>$artauthor (<a href=/"mailto:$artauthoremail/">)</td><td>$artcreationdate</td><td>$arthits</td></tr></table><br>"; Parse error: parse error, unexpected T_STRING, expecting ',' or '' in /home/hsphere/local/home/cmwong/singaporeanimenews.net/mm-article.php on line 299 backslashing the quotemarks continues giving the error. How might I get around this?
Echoing Variables Into HTML
So I'm playing with a very retarded list of products 1-9, and have the following list.php page snippet excluding html header/footers/table tags:
Echoing PHP Code From A Database?
I have the following data in a MySQL database: <a href="<?php echo $server; ?>Sugapablo-Stick_It_To_The_Man.mp3" let's call it $row[0]. when I echo $row[0], the php code is shown as opposed to the value of $server. How can I get the value of $server to appear? str_replace?
Php/mysql Echoing Same Thing Twice--help!
I'm just learning php and set up a sample mysql db to practice with. I have the following script and cannot for the life of me figure out why it is printing each field of the row twice? I checked my db and it only contains the entries once. What is causing this?! ----------------------------------------------------------------------- <?php $con_id = mysql_connect('localhost','dboard_mbr','pa1ss2wo3r d'); mysql_select_db('kp_dboard',$con_id); echo join(mysql_fetch_array($thequery=mysql_query('sele ct * from threads',$con_id)),' --- ') . '<br>' echo join(mysql_fetch_array($thequery),' --- ') . '<br>' echo join(mysql_fetch_array($thequery),' --- '); ?> -----------------------------------------------------------------------
Strange Results Echoing '£'
I'm getting a very strange result trying to echo a simple pound sign '£'. Here's my code: $currency = '£'; echo $currency; For some reason it's outputting this: £With the Â... I've tried this as well: echo htmlentities($currency)but I get the same result.. I've never had this problem before and it doesn't6 happen with any other symbols, could anyone suggest an answer?
Echoing The Correct XML Tag Data
I am having trouble ECHOing specific data and for some reason the links for each sub parent are combined into one link...Let me explain that. The first link is correct and outputs http://example.com/1, but the second link outputs http://example.com/1http://example.com/2 Does anyone know why that is? The other problem I have is that I have about 200 sub parents in my xml file and the sub parents represent different categories, for example: Code:
Join And Echoing Correct Id
The information is displayed correctly. The problem comes into play with the record id's. The link I would click on for the employees name is echoing the job id and not the employee id so I get sent to the job page and not the employee profile. The link I would click on for the job is echoing fine. Code:
Echoing Multiple Arrays
I have a products table that I want to echo the results of 3 different categories, I can query the db just fine and get results for a single category, but I'm a newb to PHP and don't know the trick way to do slick recursion. Code:
Gathering Results And Echoing Them As One?
I'm trying to display all the results from a database and use echo them using $total. $total = do { "".$row_use['lon']." ".$row_use['lat']."" } while ($row_use = mysql_fetch_assoc($use)); echo $total; I was wondering why does that not work? How do I get the php repeated regions to work?
Echoing A Variable Which Isn't Set Until Later In The File?
I could have sworn this was possible somehow, but it isn't working for me... Let's say I have a line at the top of my file, which is echo "$links". Then, the variable $links is set further down in the file, depending on some SQL results and GET variables. For me, even though I'm setting $links in the file, it will only echo if it's set before it's echoed. It make sense, but I have a definete memory that I once had a way around that problem - anyone know how to do it? Code:
Zip Codes
I have a script that will cross check a form variable against existing variables in a database and redirects visitors based on that, but, I'm also looking to extract the corresponding fields associated with the form variable and inserting that into another form that the visitor may be directed to. I understand this will most likely be an if/else statement, that says something along the lines of PHP Code:
How To Do VB Codes?
i was wondering if there is an easy (ready made) way to implement VB codes or if there is any tutorial available. nor do i need to do my own functions ?
BB Codes
I'm having trouble parsing BB codes to HTML code, I was wondering if someone could help me get started or point me in the direction of a tut, I've been trying to use PEAR but it's not working for me.
Setting Headers And Echoing Images
My scenario is that I am trying to put an image on a page using php not on my server, that does not have php. I am using the tag <img src=http://myserver.com/asdf.php3> and asdf will a) read an image b) set a header("Content-type: image/gif") and c) echo the image. That works fine. The problem is that I also wanted to include a link based on the image (ie - dynamic, involving php). After I set the header, regular tags are ignored and I can't echo anything before a header, nor can I set a different header. SO my question is, does anyone know a workaround to this problem: like displaying an image on a non-server page, without setting a header, or a way to dynamical reference something? Any help is greatly appreciated and if you think you might be able to help, but don't understand my situation or need clarification, contact me. PS - If it can't be done with PHP, can it be done with any other language anyone knows of?
Time - Echoing It Back Differently
I have a datetime column setup in a mysql database. My web host, which i based in Hawaii, has a different time zone to that of mine over her in good old England. I was wondering is there a way of echoing out the time from the datetime column but adding on 9 hours more?? Or even would it be easier to submit the data into the database with the time difference?
Echoing 3 Types Of Data From 1 Table Row
I have this script where one of the rows in a mysql table is named "type" tinyint(3). now when a person joins the site they have a basic membership and their data is 0 in the type row when they become silver members it is 1 and gold is 2 all 3 numbers are entered into that one row for each member depending on what kind of membership they have. what I want to do is echo each type of membership on a page by the total number of each type so say there is 100 basic memberships then it would add up all the 0's within the row in the mysql database and then echo that total. I have already gotten it to display total number of users by adding. Code: $query = "select id from user"; $result = MYSQL_QUERY($query); $totalusers=mysql_num_rows($result); @mysql_free_result($result); if(($s=="")or($s>=$totalusers)or($s<0)){ $s=0;} and then having <?print $totalusers;?> where ever I want it to echo. How can I do the same with the memberships? I have a feeling that it would have something to do with $totalusers=mysql_num_rows($result); i need to change mysql_num_rows to something else?
Selective Echoing And Database Select
I have written a search engine for business listings for the company I work for. Each listing is in a database, and that works fine. The problem though is two-fold. The first part of the problem is that not all listings utilise every column of the database, and this leaves gaps when echoing the results. This is not what i had in mind, Any ideas/help would be appreciated. The second part of the problem is related to the first in that there is a link for any listing that has a website, but not every listing has a website, so every listing having a "Visit our Site" link is impractical and shoddy. Also, i'm not sure how to echo the url from the database effectively in the first place.
Echoing Multiple Html Tables
im trying to echo out multiple results from a database and returning them in a table. Each new row in the database leads should lead to a new row in the HTML table. However I can only get it so the first row from the database goes into the html table as it should, the rest go outside it. Any ideas? Code:
Echoing Users Data From Mysql
when users on my site look at they're profile details some of the data in like this: <select name="somename"> <option value="Option 1">Option 1</option> <option value="Option 2">Option 2</option> </select> once a user has selected an option and it's stored in mysql i was wanting the specific information to be displayed in the drop down box, if i selected option 2 next time i log in option 2 is displayed and so on. what would be the best way to achieve this?
PHP Displaying Codes
I installed PHP manually on windows XP (just trying to do things manually) with Apache 2 and Mysql 5. Everything seems working fine. Now i saw very strange problem here, When i write any php code i use <?php ?> and if i dont put PHP after <? then my php code doesnt work.. it displayed code as it is in browser. Even previously i was able to run php without writing PHP after "<?".. can anyone tel me where i am wrong?
With Codes - Need To Resize
Hi, I am having problems resizing a text. What is wrong with the script? <td><size=6>For payment information, please contact us at (021) 221100 or at <a href="mailto:info@altha.com">info@altha.com</a></size></td>
BB-Codes Question
I've made a BB-code script, but I'm wondering about one thing. I want to have a maximum allowed size when using [size='x'][/size]. Here is a sample code snippet of my bbcode script: function format_bbcodes($text) { $text = preg_replace("([size=(.+?)](.+?)[/size])is",'<span style="font-size: $1px">$2</span>',$text); return $text;}
PHP 5 Or PHP 4 Compatible Codes
I haven't yet moved to PHP5. But, interested to know how many of you _really_ started using it or moved? Are you doing any compatible tweaks specifically for PHP 5 (forward compatible) or PHP 4 (backward compatible)?
Newsletter Codes
do you happen to know a ready scripts for newsletter sending and can be send to several number of emails taken from the database?
Is_dir() And Opendir() - Detecting Sub_directories And Echoing Them?
I am working on a single script to: 1) create a menu of directories containing photos (jump to script below) 2) output all the thumbnails of each photo (linked to photo itself) within each linked directory I have step 2 solved. However, as I was about to solve step 1, I mucked up my code so badly I lost it. I simply want to output all the sub_directory names within a directory. my structure is as follows: ../images/photos/group ../images/photos/sports ../images/photos/outdoors etc. The script itself is currently located in the images directory but could also be located in the photos directory as I want to detect all sub_directories of photos. Here is the part of the script that is supposed to do what I want in step 1. PHP Code:
Not Echoing A Variable If It Exists In A MySQL Table
I have a variable $mydate which loops for all the days of a month (in a while loop), so therefore for April its: 01042007 02042007 03042007, etc... I also have a MySQL table "bookings", which contains the field "date". This field is populated with rows of dates, with the same format as those in $mydate (eg. 01042007) Is there any way to not echo $mydate if it exists as one of the entries in the "date" field in the database?
Blocking Html And Php Codes
I am setting up a simple news submission system at my site and I want to know how to filter out or block people from inputting php or html into the site so as to block malicious posting. How do I get that to work?
2 Adsense Codes But Want To Show Only One
I use only one adsense block on my pages. My pages are usually in wdget.php - widget-blue.php form and there are links on them to some articles. However, when a person clicks on article link they go to widget.php?showfulli_etc. etc. and since I implemented one more adsense code in my script when a person goes to the article page. They see the adsense codes which is the regular one (the first one on wdiget-blue.php and the one in the script which is the second one. What I want is I don't want to show the first adblock when my visitor goes to the article page (widget.php?showfulletc.) instead i want to show the which i implemented into the script. I was wondering if there is any script will disable the first one when a visitr goes to the article page and will show only the one which is implmeneted in the script.
Sending Error Codes
I am having trouble sending error codes to the browser from my php page. I want to send a 401 Unauthorized, and a 404 not found. I have tried these (in seperate documents): header("HTTP/1.0 404 Not Found"); header("Status: 401 Unauthorized"); I put a single header at the top of the page but I received a blank document in return. What else do I have to do send error responses in PHP?
ANSI Character Codes
I looked in the PHP manual and I couldn't find what I was looking for. I need a function that will return the ANSI code value for a character. E.g. "a" should return 97. In ASP the function is Asc() if that helps anyone (I'm switching from ASP to PHP...)
Get Http Response Codes
I have a website in php in which I have some kind of portal to external links that come from a database. When a user clicks on a link, "link.php" is called, does some stuff (e.g. adds 1 to the visit-count of that certain page) and then forwards the user with a location-header to the asked page. Now my question: is it possible to get the response-code of that asked page? E.g. when code 404 is returned, I can put that in the database and then it's easy for me to know when a link is broken.
Auto Generator Codes.
I know this is very easy. what i want is a six codes generator. Let say i have a button when i press this button it will generate six digit codes. for example i have this code 543545. now i wanted also when i use this code it will tell me it's the valid codes. maybe you have the idea, just want to know the functions that i should use for this.
Sending HTTP Codes
How can i send a http response code 200 to google checkout? Obviously I have the url to send to!
Distance Calculation Based On ZIP Codes,etc (need Help)
Does not anyone know how distances are calculated on sites like mapquest.com and verizon.com. You type in the ZIP code or some other information and they tell you how far something is from it or businesses in a particular radius.
Mail () Display All Html Codes
i'm using the mail() to send mail to customer once they confirmed their orders. my problem is, i wnat to display my mails with tables but when i received the email, it display out all the html codes.
Delete Codes For Unix Platform
can anyone post codes for delete on unix platform. i am looking for codes that will delete a dir containing data in it.
Online Reference To Mysql_errno() Codes?
I want to do something like this: while(false == ($result = mysql_query($query)) ) { switch(mysql_errno()) { case $fixableError[0]: case $fixableError[1]: /* fix the errors */ break; default: die ("Fatal error in '$query': " . mysql_error() ); break; } } But I haven't found a satisfactory reference to the error codes. My googling has returned tonnes of references to files in the PHP source, but I'm not willing to download the source files and I doubt that they'd have the kind of error descriptions that would be useful (like, suggestions on how to avoid the error). So can someone supply an address to a reference list of these error numbers? Also, would the syntax in the "while" clause above work in PHP?
Postgres Insert Return Codes
I am collecitng form data and inserting into multiple tables with a foregin key. Can someone tell me why if the insert fails on the 1st insert, then all the other inserts also return a FAILURE return code : $delegatecontent = array( "id" => $idnum, "language" => $insertlang ); $delegateres = pg_insert($conn, 'delegate', $delegatecontent); if ($delegateres) { // echo "success del"; } else { echo "<b>INSERT Failed! } $meetingcontent = array( "fk_meetingsid" => $idnum, "meetingsga" => $meetingga ); $meetingres = pg_insert($conn, 'meetings', $meetingcontent); if ($meetingres) { // echo "success meetings"; } else { echo "<b>INSERT Failed! }
|