DavidB 44 Junior Poster

Hi, everybody.

I am looking for advice from veteran webmasters--those who have successfully made money on the Internet.

To me, it seems like the main ways to make money from a website are either an affiliate program or an AdSense account. However, I am becoming increasingly skeptical about making money from affiliate programs. I have joined affiliate programs, a couple that are related to my websites and promoting products that are of personal interest to me, and the promised commissions are okay--but no money has ever materialized. So far, I have avoided AdSense because I think it cheapens the look of a website. I have been content to be an affiliate member for products that fit nicely into the themes of my websites. However, I have lately been thinking that $1.00 a day, a few pennies at a time through AdSense, is better than the prospect of big commissions that never appear. Real money is better than wishful thinking.

So now I am wondering if the experiences of more experienced webmasters confirms my perception? Is an AdSense account the best option for webmasters trying to monetize their sites? Or should I wait longer and hope traffic on my site grows to the point my affiliate participation finally makes money? I mean, statistically, you’d think one day somebody will send a commission my way. . . . won’t they?!?!

DavidB 44 Junior Poster

Hi, folks.

I am wondering if anybody in this forum is in, or going to, Vienna, Austria? (With over 200K members, I hope somebody in this forum can reply)

It may sound like a silly request, but I am wondering if somebody could tell me what is at Rathausstrasse 20. I don’t want somebody to do a web search and tell me what is supposed to be at this address; I want to hear from somebody who is physically in Vienna, who has seen with their own eyes what is there. Secondly, if you have seen the business at this address, I would like to hear your impressions of the business. What kind of business is it? Does it look like a reputable, successful company within its industry, etc.?

Thanks.


David

DavidB 44 Junior Poster

Thanks to all who replied!
What are the best social bookmarking sites?

The biggest sites (like delicious) don't pass on PR. However, following are a couple lists you might find helpful. The first one is a list of bookmarking sites that pass on PR, so they help your site rank higher in searches. The second one is a list of bookmarking sites that actually send traffic (most don't. Neither do directories, which provide virtually no benefit in terms of PR either).

24 Do-Follow Social Bookmarking Sites

Top 29 Niche Social Media Sites (That Actually Send Traffic)

DavidB 44 Junior Poster

Have you also checked out SNIP I believe they have scalable options (i.e. - they offer webmail software products that depend upon the number of users. Of course the cost varies with option.).

Offering a webmail service on your domain is a good way to do some viral marketing for your website (assuming your domain name is attractive); you can then attach a tag line to the bottom of each outgoing e-mail, like Hotmail does, and each user then does some advertising for you.

DavidB 44 Junior Poster

DP is an SEO forum though ... whole different ballpark.

On a related note:
one nice feature of DP is that they have a sub-forum specifically for the introduction of new directories. Every day you can visit this forum and there seems to be at least five new directories being introduced by their webmasters. And because the directories are brand new, the webmasters often tell people to submit links for free, to ignore the statements about a payment or reciprocal link being required. (Yes, I know directory submission doesn't do much for SEO anymore, but I like to keep all bases covered if I can.)

Otherwise, I would say there are other forums that are a lot better than DP in terms of level of professionalism (e.g. - SP, webproworld, etc.).

DavidB 44 Junior Poster

I think writing your own webmail software would be too much hassle.

Are you sure there is nothing else presently available that might serve your purpose? I know of several webmail services in which the software runs on the other company's servers (even though the mail is of the form username@abc.com). For example, there is gmail for your domain, which runs on Google's servers.

If you actually want the software to run on your own server, there are products for that too, but they cost money. I don't think they cost a lot, but they give you control, and I am sure they are worth it--the elimination of the headaches involved with writing your own software alone justify their cost.

DavidB 44 Junior Poster

is there a software that i can use to generate keywords and submit to top search engines?

and is there a way to do it for free with out having their logos all of your site?

thanks for the help

None of the search engines I know about require you to put their logo on your site just to submit your site to them.

Perhaps you are actually thinking about submitting to directories. Many of them require payment or a reciprocal link to get listed in them. If you do not want to pay, or do not want to place a reciprocal link on your website, just submit to directories that are free AND do not require a reciprocal link; there are thousands such directories out there.

As for software for generating keywords, I have found the best software for that purpose to be the gray matter between your ears.

DavidB 44 Junior Poster

I have used a free tracker from Extreme Tracking before and found that to be acceptable:

http://extremetracking.com/

However, their terms of service require you to place their icon somewhere on your page. In addition, based on discussions I have seen in other forums, it is not the best tracker (although, since I am just a hobbyist webmaster, it was good enough for my purposes.)

I later decided I didn't want their icon on my website, so I switched to Google Analytics:

https://www.google.com/analytics/home/

Google Analytics is the best free tracker I am aware of, providing way more information than most people will ever use.

I have also heard good things about StatCounter, but I have no personal experience with it:

http://www.statcounter.com/

I think the best counter is one that is server-based, and most web hosting companies offer such a service with their hosting. Does the host of your website not offer a traffic tracking service?

DavidB 44 Junior Poster

Below is how I have declared I. Can anybody point me in the right direction with this error? If more code is needed please ask.

I=A(:,1:20)';
T=A(:,21:21)';
NNA=sim(NN,I)

I am no expert in MATLAB, but I would find it helpful to see more of your code, specifically, the declaration of A.

DavidB 44 Junior Poster

Hi, folks.

I have written some pretty complicated programs in Javascript (in terms of the code itself), but I haven’t experimented much with the nuts-and-bolts of Javascript. In particular, I have written all my programs as single blocks of code. For example, I have written several programs to solve for the eigenvalues and eigenvectors of matrices. One page solves for a 3 x 3 matrix, one for a 4 x 4 matrix, one for a 5 x 5 matrix, etc. Each javascript program is on its own page and takes the following form:

<script language="javascript" type="text/javascript">
<!--Define JavaScript function.-->

function OneBigProgram(dataForm){

// Code to input the matrix elements for the specifically-sized matrix

 . . .

// Code to calculate the eigenvalues and eigenvectors
// BIG BLOCK OF CODE
. . .

// Code to output the results for the specifically-sized matrix
 . . . 

// end of JavaScript-->
</script>

The algorithm for actually calculating the eigenvalues and eigenvectors does not change depending upon matrix size, it is included in the BIG BLOCK OF CODE.

What I am hoping to do now is turn the code block for the BIG BLOCK OF CODE into an external file, and have the several programs refer to it. That way, I won't have six programs include the same big block of code; they can all refer to the same external file--saving space on the server. For example:

<script language="javascript" type="text/javascript">
<!--Define JavaScript function.-->

function A_Smaller_Program_Input(dataForm){

// Code to input the …
DavidB 44 Junior Poster

Hi, folks.

I am about to start exploring a field I haven't bothered with up to now: Internet TV. I do not have cable television (not even a basic service), but I do have a high-speed Internet connection.

So I thought I'd learn what the Internet has to offer in terms of a TV replacement.

(Yes, I will be doing some searches of my own, but I would still like to hear your recommendations.)

DavidB 44 Junior Poster

Hi to all. Recently joined this site looking forward to expand my knowledge and interact with ppl of similar interests.

Hello, gurlmystique.

Welcome to DaniWeb. I am sure you will find these forums an excellent resource. You mentioned interacting with people of similar interests. What are your interests and specialties?

DavidB 44 Junior Poster

also can we make a program which does definate integration....???

Yes, such programs can be made. In fact, programs already exist which do definite integration. Some take a given function that cannot be solved analytically and solve it numerically over a specified interval. Others input data (from, say, a graph) and numerically integrate it.

DavidB 44 Junior Poster

My taste in poetry is pretty mainstream.

Three of my favorite poems follow.

The Road Not Taken
by Robert Frost

Two roads diverged in a yellow wood,
And sorry I could not travel both
And be one traveler, long I stood
And looked down one as far as I could
To where it bent in the undergrowth;
Then took the other, as just as fair,
And having perhaps the better claim,
Because it was grassy and wanted wear;
Though as for that the passing there
Had worn them really about the same,
And both that morning equally lay
In leaves no step had trodden black.
Oh, I kept the first for another day!
Yet knowing how way leads on to way,
I doubted if I should ever come back.
I shall be telling this with a sigh
Somewhere ages and ages hence:
Two roads diverged in a wood, and I-
I took the one less traveled by,
And that has made all the difference.

- - - - -

O Captain! My Captain!
by Walt Whitman

O Captain! my Captain! our fearful trip is done;
The ship has weather’d every rack, the prize we sought is won;
The port is near, the bells I hear, the people all exulting,
While follow eyes the steady keel, the vessel grim and daring:

DavidB 44 Junior Poster

Setting up an e-mail service using your domain is another example of viral marketing. You would set it up so that all outgoing e-mails have a tagline at the bottom mentioning your product, website, or service. Hotmail, Yahoo!, etc do this. As people sign up for your e-mail service, and send e-mails to their contacts, they all do advertising for you. In turn, their contacts notice the message at the bottom of the e-mails they have received, and then sign up for your e-mail service too. And on it goes, growing exponentially (in theory).

DavidB 44 Junior Poster

Using a form would be one approach. Are you trying to avoid the use of forms?

Alternately, you could try innerHTML. Put a div or span where results are to be inserted and then write the Javascript code such that it outputs the appropriate HTML.

DavidB 44 Junior Poster

What do you guys think of JavaScript-heavy forums such as DaniWeb? Would you rather spend time on a forum with a very unique skin and all the bells and whistles, or something very simplistic and standard that's quick loading and far less confusing?

I wouldn't call Daniweb's layout confusing. Although I would prefer if ads were confined to one of the sides of the pages instead of being listed at the top. Every time I click into a forum, instead of seeing the first thread in the forum, I see an ad.

What I find to be the bigger annoyance is when I move my mouse around the page and trigger several pop-up menus along the way, which block my view of whatever I was aiming for in the first place.

For example, let's say I have just made a post. Instead of backing all the way into the main forums menu and then going back into the "Growing an Online Community" forums, I'd like to go directly back to the "Growing an Online Community" forums. So I move my mouse toward the "Growing an Online Community" forums link. However, on the way to click the link, my mouse goes over the "TECH TALK" button, which triggers a pop-up menu, which blocks my access to the "Growing an Online Community" forums link. Now I have to move my mouse around, trying to avoid triggering other pop-ups so I can get back into the sub-forums I was aiming for.

DavidB 44 Junior Poster

i couldnt found CJ.com

May have been down when you tried it. I just tried it and it is working fine:

http://www.cj.com/

DavidB 44 Junior Poster

Hi all,
Is there any site for checking statistics of my site url. Please let me know if you know that type of site. Thanks!

If you want to know what other sites link to you, you could just do a link search on the Google or MSN search pages. For example, on the Google search page just enter the following:

link:www.sitetocheck.com

(where www.sitetocheck.com is actually the URL of the page whose popularity you want to check).

If you want more detailed statistics about your site (i.e. - number of visitors, originating sites, keywords used to find your site, etc), I recommend using a proper analytics program.

DavidB 44 Junior Poster

ABestWeb lists many affiliate programs, and more are added to the list all the time:

http://www.abestweb.com/

ValueClick is good, similar to AdSense ads:

http://www.valueclickmedia.com/index.shtml

They are picky about who they sign up as publishers. Your site has to be very good in order to become a publisher for them.

DavidB 44 Junior Poster

Correct...right strategist can make the things in right direction.

I agree.

In addition, I think SEO goals are different depending upon whether the website being promoted is (i) made for AdSense, or (ii) made for a brick-and-mortar store directly selling real-world products and services.

In the case of a website whose purpose is to generate AdSense income, the webmasters of those sites seem to take a shotgun approach: just aim in the general vicinity of the target and hope to get some click-throughs. In fact, many AdSense sites don’t seem to do any targeting at all--they go after any and all traffic. Their reason for doing any SEO work at all is the recognition that search engines can send a lot of traffic to a site (although I have found that having a good ranking among the search engines doesn’t necessarily result in a lot of traffic). The bottom line is that SEO work done for an AdSense site is to generate as much traffic as possible.

On the other hand, SEO considerations done for the site of a brick-and-mortar store are done primarily to keep the store’s site near the top of search engines’ results pages, just like being one of the first entries in the yellow pages of a phone book. To a brick-and-mortar store, a lot of irrelevant traffic is simply wasted bandwidth that comes out of their budget; all they want to do is ensure that when customers look for the product they …

DavidB 44 Junior Poster

You might find a relevant code snippet at tutorialblog:

http://tutorialblog.org/25-code-snippets-for-web-designers-part7/

DavidB 44 Junior Poster
// Until the user enters "end" keep asking what product they want
while(product != 0)
{
    product = prompt("Please enter which product you would like: ");
    total = total + price;
}

In the while loop, I don't see the program enter the switch block of code, so the "price" variable is never re-assigned. The code just sees "price" (= 0) being added to "total".

DavidB 44 Junior Poster

In C++ you should have access to the language constants DBL_MIN and DBL_EPSILON.

DBL_MIN is the smallest normalized number representable by the floating point type you are using. DBL_EPSILON is the smallest number such that (1.0 + DBL_EPSILON) > 1.0

Relating to root-finding, DBL_EPSILON is the lower limit of precision to which you could seek a zero. If you tried to find a zero with precision 1e-10 on a computer whose DBL_EPSILON was only 1.0e-5, you'd be wasting your time; a precision of 1.0e-5 would be the best you could do.

DavidB 44 Junior Poster

It talked about the Mayan calendar and that it abruptly ends in 2012.

It is not the end of the world; it is the end of an age. There have been four ages before the present one; we are presently in the fifth age, which is supposed to end December 21, 2012. The previous four ages all ended in some sort of natural calamity: water, wind, quakes and storms, wild animals. . .

The first age was the Age of the White Haired Giants;
the second age was the Golden Age;
the third age was the Age of the Red Haired People;
the fourth age was the Age of the Black Haired People.

A Google search on “Mayan calendar” turns up many good links. The Wikipedia entry is quite informative:

http://en.wikipedia.org/wiki/Maya_calendar

There is also an interesting calendar at the following link, on which are listed significant events from the Mayan calendar, the Christian calendar, the Jewish calendar, and as well as astrological events:

http://www.diagnosis2012.co.uk/cal.htm

DavidB 44 Junior Poster

I have two. Both are always paid off each month so interest is avoided.

One is for day-to-day purchases and preauthorized monthly purchases such as telephone, Internet, gas, bills, etc.

The other is hidden away at home and used only a couple times per year. This card is for online purchases (i.e. - on Amazon) and has the lowest limit possible. My theory is that, if somebody does ever get my card data, having an extremely low maximum will limit the damage they can do.

DavidB 44 Junior Poster

Hi, folks.

(Any Gmail experts here?)

I am getting involved with the Parent Advisory Council (PAC) at my son’s school and have created a Google Calendar that includes all meetings, school events, etc. For the monthly PAC meetings I have specified that a reminder e-mail be sent out two days before the meeting. By default, the reminder e-mail is sent to the Gmail address on which the calendar is based. I was hoping to create a rule in Gmail by which e-mails from the calendar were forwarded to all the Council members (about twenty people); however, forwarding to multiple e-mail addresses doesn’t seem possible. Am I missing something, or does Gmail, indeed, not allow automatic forwarding to multiple addresses?

Alternately, can somebody please suggest a third-party that offers this service (i.e. - define a rule by which all e-mails from a specific e-mail address are forwarded to multiple e-mail addresses).

Regards.


David

DavidB 44 Junior Poster

I'd like to suggest another logout link for DaniWeb.

I often browse the site from my local public library, which runs Linux machines with the Epiphany web browser.

When surfing DaniWeb, the first five links are visible once a page is loaded:"CONTROL PANEL", "DONATE", "FAQ", "RULES", and "MEMBER SEARCH". When a page is in the process of loading, or refreshing, I get a quick glimpse of the "LOGOUT" link--on the line below--but once the page finishes loading, it disappears behind the big ad at the top (advising surfers to visit the Geeks Lounge).

Basically, there is no way to logout.

Another logout link, on the right side or bottom of pages would be convenient.

David

DavidB 44 Junior Poster

Thank-you, DMR, for the excellent information. I don't know if I want the complete set just yet, but I now have a skit name.

Thanks lasher511 for the video link.


David

DavidB 44 Junior Poster

Hopefully, there are some Monty Python fans here who can help me.

I recall seeing a Monty Python skit in which there was blood squirting all over.

For example, one person played the piano and another person accidentally dropped the key cover down on the player's fingers. His fingers were severed and blood squirted everywhere.

That person, leaned on the shoulder of somebody else, but that person's arm detached and squirted blood all over.

Then the armless guy fell over in pain, grabbed the leg of somebody else, but that person's leg came off and squirted blood.

It sounds gory, but it was actually quite hilarious because you knew it was all being exaggerated (like the vomit scene in "Team America", which made me laugh my head off).

Anyhow, I noticed some Monty Python DVDs available, but they are in plastic-wrapped cases that do not have that particular skit listed on the outside of the DVD case. For example, "The Life of Brian", "The Quest for the Hoy Grail", and "Now for Something Different".

Is the skit I am seeking on one of those DVDs? If not, would you know what DVD would have this particular skit?


David

DavidB 44 Junior Poster

I remember them and used to be quite a comic collector. In fact, I still have about 5000 comics (literally) stored at my parents' place. I liked Marvel comics better than DC comics because the story lines were more mature, and the art was great. Among my favorites: The X-Men and Spiderman.

However, then the storylines started to get too complicated, sub-plots within sub-plots within sub-plots. They started to feel too much like soap operas. So I stopped buying years ago. Now, I take a look at the comic line-ups just to see what's available, but I haven't seen anything to turn me into a purchaser again. And the prices have sure gone up (Ouch!)


David

maravich12 commented: Awesome fan list. +2
DavidB 44 Junior Poster

Here is a basic question (I thought I knew how to do this, but apparently not).

(I am using Firefox 2.0.0.4, in case that is a factor).

I am writing a Javascript page and want one of the text fields to default to a blank when the page is reloaded. Basically, the page accepts a few values via a form, does some calculations in Javascript, and then outputs the results and an Error Code. The page will be run many times, feeding it new inputs each time.
After each execution, if a user clicks the "Reload Page" button, I'd like the Error Code field to be empty. However, presently this field retains the Error Code value of the previous trial.
Following is my present code:

<tr align="center">
<td align="right"> Error Code</td>
<td align="left"> <input type = "text" name = "erCode" value = " "></td>
<td > &nbsp; &nbsp; </td>
<td> &nbsp; &nbsp; </td>
</tr>

This code snippet is in the HTML part of the page and I had assumed that by giving the field a blank for a value, the field would appear to be empty, which is what I want. However, when I click the "Reload Page" button, the last value is NOT cleared (it remains at, say, 4).

I suspect I am overlooking something simple.

Looking forward to reading your suggestions.


David

DavidB 44 Junior Poster

I am presently translating some code from C++ to Javascript and it involves quite a few floating point calculations. The program uses several built-in machine constants to help it quantify and limit computer round-off error. For example, it includes the constants DBL_MIN and DBL_EPSILON from the <cfloat> library within C++.

I am now wondering: does Javascript offer these constants as built-in values too? I suppose I could calculate them myself, by brute force, but if these values are already available, it would help me keep the Javascript version shorter.

Does Javascript provide built-in, comparable values for DBL_MIN and DBL_EPSILON? (If so, how do I access them?)

Regards.


David

DavidB 44 Junior Poster

Came across a couple online conversion services that may be of interest:

https://www.pdfonline.com/convert_pdf.asp

http://www.pdfforge.org/products/pdfcreator

Regards.


David

DavidB 44 Junior Poster

This might be what you are looking for.
http://www.google.com/calendar

Thanks for the reply.

Actually, I had signed up for Google Calendar some time ago and then forgotten about it. However, if I recall correctly, I had to sign up for it with my gmail username. If I propose to my group the use of Google Calendar, wouldn’t all users then be compelled to sign up for a gmail account, AND THEN sign up to Google Calendar? I was hoping not to force people into going with a Google, Hotmail, Yahoo!, etc. service. Something else would be my preferred option. I used to have a mycalendar account, which was very slick, but they discontinued that service about a year ago.

Any other options besides Google Calendar?

DavidB 44 Junior Poster

To convert files from all those programs you listed, I think the best option is simply to get the proper Adobe Writer. That would put a plug-in onto each of those software products, which would allow you to easily convert any of them to PDF. And it would allow users to digitally sign a document, if you are using it for business purposes (i.e. - creating quotations for customers).


Alternately, WordPerfect comes with the option of publishing its documents to PDF format.

Also, I know you asked about a writer, but if you are also looking for alternatives to the reader as well, you might consider the Foxit reader. It loads faster than the reader that actually comes from Adobe, and it is much smaller:

http://www.foxitsoftware.com/pdf/rd_intro.php

Regards.


David

DavidB 44 Junior Poster

Hi, folks.

I recently started to get involved in my child's school's Parent Group. I am considering suggesting to the group the use of an online calendar to keep track of activities throughout the year (for example, September 18 is a symphony field trip, January 13 is hot lunch day, May 15 is a walkathon, etc.) .

I am seeking your recommendations for such a calendar if, indeed, one exists with all the desired features:

1) it should be free;

2) it should be editable by several different users;

3) users should be able to mark events private or public. All parents of the school's students will be sent the URL of the calendar, and each month a paper copy of the upcoming month's event calendar will be sent home as part of the monthly newsletter. Private events might be events entered by the fundraiser regarding, say, a walkathon. The Chairman might enter the next meeting of the Parent Group. Such events are not secret, but they are irrelevant to the public viewer, so should not appear on the public view or the paper print-out.

Looking forward to hearing your suggestions.


David

DavidB 44 Junior Poster

Perhaps A Best Web (abestweb.com) is worth a look. They list affiliate programs up the ying yang. And they have a mailing list you can join; almost every day you receive an e-mail about new affiliate programs starting or new merchants joining a program.

DavidB 44 Junior Poster

Also, do not overlook social bookmarking sites like del.icio.us and shadows. The search engines are aware of what gets bookmarked on these sites so, to cover all the bases, bookmark your sites here.

DavidB 44 Junior Poster

There were a few different approaches.

I think the Northwest Ordinance is the particular one I had in mind.

Thanks.


David

DavidB 44 Junior Poster

Hi, folks.

Hopefully, some of the "geeks" in this lounge can help me with a topic from American History.

I think it was in Grade 10 (which was quite a few years ago) that I learned a little about early American history. Some years after the original thirteen colonies were established, politicians wanted to encourage western settlement. In some regions, lotteries were held for plots of land. In other regions, plots of land were allotted to people who raced out to grab stakes when a whistle was blown at, say, 9 am one morning. However, there was a substantial piece of legislation that allotted land simply by the presence of people working that land—if a person settled on a piece of land, and worked what was previously an unused piece of land, that was their claim to it. I think that legislation was named the “Northwest Bill”, or the “Western Expansion Bill” or something like that. I cannot remember the name of this Bill and it is bugging me. Does anybody here know the name of the Bill I am talking about?


David

DavidB 44 Junior Poster

Hello, wish you all a prosperous 2007.
I ever bought traffics from several web promotion companies but the result was very bad.
For example I ordered 10,000 traffics from << bulk traffic reseller >> in order to promote my website << url snipped >> They were boasting all the traffics were really targeted and will send 10,000 traffics to me within a month. But unfortunately it tooked more than 45 days for me to only receive 2,200 traffics and their campaign finished. It seemed their traffics were from a same frame and just some fake hits. Even no any vistors browse the second page of my website. I will never buy traffics again.

Hope to share your thoughts with you all, thanks.

I have never trusted services that promise X thousands of visitors to a website. Chances are, it would be untargeted traffic anyhow. Besides paying for a few links in high-PR directories, paying for Google or Yahoo search advertising is another way to go. Even then, it would be hard to predict how many hits you would get. (You could set up a limit, but the very first time you set up the account, you would really have no idea how much traffic would be sent your way.).

The other factor to keep in mind is how much income you expect to earn from visitors. If you are paying $0.05 for each visitor, but only expect to earn, say, $0.03 from each visitor, the advertising wouldn't …

DavidB 44 Junior Poster

I have a site with many math-related utilities
I am also working on posting C++ source code.

However, I don't do reciprocal linking; do you anticipate any opportunities to get listed in the Daniweb directory without a reciprocal link?

Regards.


David

DavidB 44 Junior Poster

Creating the transpose of a matrix is one of the simplest things to do; creating the matrices themselves will probably take you more time than doing the transpose. Are you having troubles with the mathematics of a matrix transposition, or the coding?

David

DavidB 44 Junior Poster

Thanks for the replies.

I am working on a PHP parser that I had worked on some time ago, set aside, and am now getting back to.

So far the newsfeed works fine. However, JUST IN CASE the feed ever goes down, I would like the rest of the page to display properly. At the moment, I am working on a test page and am deliberately feeding it a bad link to test as I debug. So far, I keep getting a blank page.

UrbanSky, your suggestion is pretty slick; I hadn't thought if that. Is the syntax proper (would it actually work)? In any case, I suspect that by turning off the PHP, the following PHP code would be displayed in the browser.

For example, from your example, if the condition were true and the PHP turned off, wouldn't the following code be displayed as text in the browser (something I don't want):

<p>My True Statment</p>
<? }else {
//Some php Code
}?>

DavidB 44 Junior Poster

Hi, folks.

As you may have gathered from a previous post, I know next to nothing about PHP, so I have a very basic question:

How do I force an exit from PHP?

I have gone through a few books and come across the "die" and "exit" commands; however, they don't seem to be doing what I want.

What I'd like to do: if a condition is true, exit PHP execution and display the rest of the (HTML) page normally. I suppose I could create a big block for the case if the condition is not true; however, a quick exit from the PHP would be my preferred option. Presently, using the "die" or "exit" commands with a test condition that forces the error causes the entire webpage to display a blank page, not even the error message echoed BEFORE the "die" statement displays.

Any suggestions?

David

DavidB 44 Junior Poster

Use MagpieRSS. :)

I have heard of Magpie before, and looked at it briefly, but wasn't clear how to use it. I think it is just a "black-box" approach, isn't it? I have styled the output quite a bit and got the impression Magpie didn't allow a lot of customization (font style and size, background colors, number of news headlines to display, etc.). Am I mistaken?


-- David

DavidB 44 Junior Poster

Hi, folks.

I input an RSS news feed on to my site and I use a PHP routine to parse the input. I barely know PHP; basically, I learned just enough to get the feed working.

I would now like to make a small edit to the code and am seeking some help.

Presently, if the XML input stream cannot be opened, the code outputs a message and then dies. Here is the code:

if (!($fp = fopen($file, "r"))) {
   die("could not open XML input");
}

Since this code is one of the first things the page does when loading, if the stream cannot be opened, the rest of the page doesn't display.

What I'd like to do now is to have the rest of the page display properly even when the PHP code encounters an error (the rest of the page is just static HTML).

Any suggestions for an alternative to the "die" approach I am presently using?

Thanks.


David

DavidB 44 Junior Poster

Do you know some conditions ahead of time? For example, will the denominator always be a linear term, such as (x- a)? If so, it would make the program a lot simpler.

You might find something by doing a search on the term "synthetic division".

It is often used for solving the roots of polynomials (deflating them).
Say you have the polynomial P(x) = 0 and you know one root is x = a. You then know P(x) = (x-a)*Q(x) = 0. Q(x) is found by synthetic division, removing the root you already know so that the remaining equation, Q(x), is simpler to solve.

For example, check out sub-routine quadsd on the following page:

http://www.crbond.com/download/misc/rpoly.cpp

You may not be solving for the roots of polynomials, but the synthetic division procedure, itself, might be applicable to your problem. "Numerical Recipes" also provides some code.

Hope this gives you some ideas.


David

DavidB 44 Junior Poster

At least you are getting growth; I, on the other hand, am lucky to get ten unique visitors per day on one of my sites.

Myself, I browse DaniWeb once per day but, unless I have a question to post, or see a question I can answer, I don't bother logging in.


I think maybe you young people have come to expect too much. I remember the days when I had to walk five miles each way, uphill, in a raging snowstorm to get to an Internet Cafe . . . :cheesy:

David