Nyight 10

Perhaps because no one has the answer hmm?
If it's that pressing and you don't mind feeling like an idiot... [url]http://stackoverflow.com/[/url]

[Steps to solve almost every problem]

  1. Look at the code, piece by piece.
  2. Try an alternative method to doing what you want to do.
  3. Look up information or documentation on the tools you're using.
  4. Google.
  5. Google.
  6. Google more.
  7. Get tired of google and come back later.
  8. Get a good idea and watch it fail.
  9. Go back thoroughly through the information and or documentation you've already gone through several times.
  10. Ask on a forum.
  11. While waiting for a possible solution, continue experimenting.
  12. Checking back to the forum frequently to see if there has been a reply [b][u]WHILE[/u][/b] continuing to play the trial and error game.
  13. Try a solution if the thread has received one.
  14. Repeat.

I've started 4 topics myself and only 1 has ever received a reply. The rest I had to answer on my own.

Nyight 10

There are 2 simplistic ways.

The first and most recommended is the header redirect:
header("Location: pagename.php");
That sends the header location to the browser, telling it to redirect itself to whatever you replace pagename with.

The second, less elegant way:

Where 2 is the number of seconds to wait before sending a refresh command to the browser and the url obviously being the page you want to redirect to.

The main problem I have with the second is that the page has to load before it even begins the countdown and witin that amount of time, if the user presses ESC or clicks the stop button, the countdown stops and the page does not redirect. The header sent by php is, as far as I've ever been able to manipulate, impossible to stop from redirecting as it's one of the very first things the browser receives.

However, the header refresh can be tricky to use. As it's a header, you [b]cannot[/b] echo or display [b]ANY[/b] kind of text or anything. If you decide to use it but cannot get it to work, just post it and we'll see what we can do.

Nyight 10

To clarify on a few things, if it was a mysql_connect or just a general mysql_error, php would display the problem and then continue parsing the page until it ran into a critical error.

I've ran into situations where the page merely returns blank without any explanation whatsoever and after several days of trying to figure out what was going on, I decided to echo display_errors. My host, by default, had it disabled.

Anyway, to check to see if this is your problem, try echoing display_errors or error_reporting. If you can't get that to work, just use phpinfo() and scroll to find them. If display_errors is off then you can do several things to rectify the situation.

The most common methods are to place [b]ini_set('display_errors',1);[/b] and or [b]error_reporting(E_WARNING | E_PARSE)[/b] at the top of your page, usually the header file so it only has to be typed once.

The next most common method (as I have never been able to get ini_set() or error_reporting() to work properly) is to place a [b]php.ini file within each directory(folder) that displays pages[/b] with the single line of [b]display_errors = 1[/b]. This method has always worked for me.

Hope this helps.


qazplm114477 commented: agreed +1

Nyight 10


if (isset($_GET['beginCount'])) $_SESSION['countView'] = true;
if ($_SESSION['countView']) $_SESSION['count']++;
if ($_SESSION['count'] % 5 == 0)
echo "test";


Nyight 10

!(count) isn't a valid php variable, php would look at that like a function... unless it is a function defined somewhere else. Anyway, you'd probably want to use the $_SESSION['count'] itself. Also, $_SESSION['count'], to my knowledge, won't return a bool for your ternary statement.

% = modulus, meaning it'll divide and return any remainders. With that in mind, if it returns 0, it means it's divisible by the number given.


Nyight 10

The code I posted was an example for you to use on your own to show you how to add the event handler and will fail for copy/paste. I don't know what you named your browser in your own application so there is no realistic way for me to provide "plug-n-play" code.

My recommendation would be to add the event handler either [b]after[/b] InitializeComponent() is called or during the form load event.


As for allowing it to open up in a new tab, you're going to have to have tab support for your current application (to my knowledge the web browser control only gives you a basic web browser, tab controls have to added manually).

Assuming it does, you'll have to create a tab, button, something the user can click that when they do, allows a new tab to be added. The best solution that I can think of, would be to make a class or method that would automatically add all you want to the new tab.

Nyight 10

I know this is old and I know I'm barely into this myself but you might want to check into jQuery if you're thinking web based and are leaning away from flash/java. It's very efficient and a lot of games are starting to come out with jQuery as the basis for the engine. By default it has ajax commands built into it and it's highly, if not insanely, customizable. Best of all it's JavaScript so it's as real time as you want it to be on the web browser. (Done right, you don't even need anymore than a single page to run the entire game though that can be difficult to do.) [url]http://www.jquery.com/[/url]

Java is good for creating 2d and basic 3d games but not many really prefer it anymore. Most use flash because it simplifies the process of putting images on the screen and making them interactive.

[url]http://www.gamedev.net/[/url] is a website I use frequently for game development questions though they tend to stick with the industry standards for game dev (e.g. C++, DirectX, etc...).

Hope this helps.

SoulMazer commented: Great advice. Thanks. +2

Nyight 10

else if (dgvActions.Rows[dgvAAddR - 1].Cells[0].Value != null && dgvActions.Rows[dgvAAddR - 1].Cells[1].Value != null && dgvActions.Rows[dgvAAddR - 1].Cells[2].Value != null)

Or try-catch()
else if ((!string.IsNullOrEmpty(dgvActions.Rows[dgvAAddR - 1].Cells[0].Value.ToString())) && (!string.IsNullOrEmpty(dgvActions.Rows[dgvAAddR - 1].Cells[1].Value.ToString())) && (!string.IsNullOrEmpty(dgvActions.Rows[dgvAAddR - 1].Cells[2].Value.ToString()))
// This will trigger if any kind of error occurs in the try{} section.
Try-catch docs: [url]http://msdn.microsoft.com/en-us/library/0yd65esw(VS.80).aspx[/url]

ddanbe commented: Very willing to help :) +7