bbb
Members-
Posts
18 -
Joined
-
Last visited
Everything posted by bbb
-
Thanks... i've used 'break' in my codes before, but just couldn't think of it this time around and couldn't figure out to exit a function without exiting the entire code. I'm all set for now. Thank you again for your help.
-
Along the same loop lines.... Some fields in my db are empty, and i need to loop thru a db querry and retrieve the first non-empty value from columnX (so it can be used later in the program), at which point the loop can stop. I tried: while ($x == "") { while ($newArray = mysql_fetch_array($result)) { $x = $newArray['x']; } } My thought process is that "while $x is empty, the loop will continue. Once $x has a value (which would be a non-integer number from the db) the above loop would stop", but that's not the case and the above continues to loop thru all the results (and maybe more as it sometimes 'times out' at over 30 seconds). Can you get me back on track and steer me in the right direction? Thank you.
-
Thanks for the reply(s). Actually got it solved (with some TCH help), had this line which was 'using' the first row of data: $row = mysql_fetch_array($result, MYSQL_ASSOC); I thought all the above did was use the column heading as variables, but apparently i was wrong, and it was 'using' the first row of data, thus starting the loop at row 2. Hope my posting/follow-up can help somebody else down the road. Thanks again for the assistance.
-
Thanks for the reply and suggestion. I tried adding the above code and it didn't work. Before posting originally i put the above code into its own file (with nothing else other than the db query) and i still come up one row short, which is why i'm so stumped, as i think i've excluded any other parts of the program by 'testing' it this way. Any other ways to go about the above (such as setting up a counter with the number of rows and then looping while the counter is =< the number of rows?) This seems like it would be another way to accomplish the same thing, but i'm not sure how to set up the array and use them in the code. If this is another way to go about the same thing, can you explain how i could set up the array to use format such as: $link["$i"] where "i" would be a counter and also act as the 'key' for the $link array (hope i got my terminology correct, but if not, hopefully you understand what i'm trying to do) Thanks.
-
The following is a modified snippet of code (copied from a book) i am using to loop thru results of a db query and display them on screen (where 'link' is a column name in the db): echo "<table>"; while ($Array = mysql_fetch_array($result)) { $link = $Array['link']; echo "<tr><td>$link</td></tr>"; } echo "</table>"; The problem i am having is that the table always contains one less row than the db query. To test i have added the following before the "while loop" begins: $rows = mysql_num_rows($result); echo "$rows"; Sure enough if my table has 4 rows, the $rows echo shows 5 (if the $rows shows 28, the actual number or rows in the table created is only 27). Can any one please comment on my error and put me on the right track. Thank you.
-
If a directory does not have an index.html, index.php, etc. file, how can i prevent the directory contents (ie- files) from showing if somebody types in the url of that directory? Example: www.mysite.com/folder where 'folder' has no index file in it Thanks!
-
Don't meen to doublepost, but i posted THIS QUESTION about XSL but don't know if my question belongs here. Please move if necessary. Thanks.
-
Obviously the above should be XSL (and not XLS)
-
I am trying to get a program working that uses a (poorly) written tutorial. It uses an XML file which calls an XLS style sheet. This is the XLS Style Sheet: The tutorial goes on to 'hack' the above style sheet so that the XML file can use standard HTML tags. The 'hack' to the XLS style sheet isn't precisely given, but when clicking on the link that is suppsoed to give the code for the style sheet, this is what i get: The code for the above stylesheet doesn't look long enough (relative to the one above it) and i really don't know anything about XML and XLS files (can you tell ). Can anybody tell if the above should be enough to display HTML tags in an XML file that calls this style sheet; if not, what is missing and/or any leads as to what may be wrong. (or am i way off base?) As always, thank you.
-
It certainly does help... tried a quick test and got it to work <thanks!>... will try it on all the pages tomorrow. A few additional questions along the same lines if i may: 1) I did previously try this in the original file where i used the include statement: $data .= include('myfile.php'); why would this too have printed the include statement and not simply accumulated the data into the variable $data 2) what language uses the "->" and "=>" symbols: I'd like to read up on it so i have a better understanding of how it works (and can write similar code when necessary). Is there a name for "->" and "=>" so that i can search for it. Thanks again!
-
Code is below (changed some stuff to protect data and filenames): I tried it with echo "<tr><td>"; (both opening and closing) included and removed... they are commented out above as that is the last thing i did in my testing. Thank you!
-
After too many hours on this i still can't seem to get it right (yes, i can do it by calling a webpage but i want to do it the right way). Essentially this is the part of the code that i believe is messing up: As you may see i am creating a table and inserting data (from myfile.php) into the table. The problem is that the data from myfile.php appears at the top of the page instead of in the table. The "hello" is just put in there as a test as that text does indeed show up inside the table. Can somebody please explain wh the data from the include statement appears at the top of the page? Thank you. PS- above i mentioned i understand most of the code... the parts wtih "->" in it is what i don't understand... is that html, php, etc? Thanks again.
-
Thanks for the reply... I was actually editing a pre-made script and although i tried a few variations of include() i was not able to get it to work (as i only understand most of the code in the pre-configured script) For anyone else that may be faced with a similar situation, here is what i did: Since it worked as i wanted wtih fopen('http://www.mysite.com/filename.php', 'r') i set the url in the fopen() as such: 'http://www.mysite.com/' . '$variablefile' So now $variablefile can be: myfile1.php myfile2.php etc, etc and will be called up accordingly. I understanding this uses a little extra bandwidth since the files are called thru the internet rather than locally thru the server, but it serves my purposes well and seems to be working fine. If there are any pitfalls with the above method that i'm not aware of please let us me know. Thanks.
-
An additional comment: Once the file is selected fread() is used to read it. Also, even a line i've added as a test to filename.php: echo "hello world"; does not appear when the file is called from fopen() and fread() (but does appear when called by typing the path url into a browser) Thanks.
-
I'm trying to run a script that uses: fopen('filename.php', 'r') where filename.php contains a loop code to create a page of links If i load the filename in the browser: www.mysite.com/filename.php then it works as expected However, when calling the file using the fopen method above, nothing appears on the page. If i do a 'view source' i can see the code from filename.php, but there is nothing on the page in the browser (where i want the links to be). The <?php and ?> are in the filename.php file. As a test i tried hard-coding it as such: fopen('http://www.mysite.com/filename.php', 'r') and it performed as desired. Any insight on this one? Thank you.
-
Using squirrelmail i know a link will automatically be created using the following format: http://www.test.com However, i would like the link to be clickable and appear as: test.com (ie- similar to using the html code <a href="http://www.test.com>test.com</a>) Can this be done? Thank you.
-
Thanks for the answer and the welcome. The forwarder does work as i want. I have seen forwarders set-up to work both way (one leaving a copy, one only forwarding and leaving no copy)... glad to see TCH's works the way i like.
-
I would like to use web based email and have the email forward to another account. (this i know how to do) However, how can i have it so that there is also a copy of the email that remains on the web based account. In other words i get an email at me@****, i want to forward it to me2@****, but also still have a copy remain at me@**** Thank you.
