A webbrowser control. I need to handle the link opening instead of opening in IE.

I am having the most horrendous time searching for this. I swear I have trawled the web 10 times over.

All I need is to get the URL of the link that has been clicked on, and open it in a new form window that is maximised with a web browser control inside, to the URL of the link.

Sounds so simple yet I can't figure it out, I am wondering if any of the marvellous genius' on here can fathom it out, any help appreciated!

Jack - Written as I am litterally pulling my hair out.

Solved, I didn't realise that when I was creating the submodule form from the dashboard, it was doing it "As New FORMCLASSNAME" instead of "FORMCLASSNAME", therefore creating a new private instance only visible to the dashboard each time, which is why I couldn't change anything. This has been solved, thanks for your contributions.

Hi, yes the click event is triggered from and is in the UserControl. For reference, here is the UserControl code.

Imports MySql.Data.MySqlClient
Public Class clientlist_individual
    Dim ind As New globalclasses

    Private Sub clientlist_individual_Click(sender As Object, e As EventArgs) Handles MyBase.Click
        Dim clid As String = Me.Name
        ind.get_ind_data(Me.Name)
    End Sub

    Private Sub btn_arrow_Click(sender As Object, e As EventArgs) Handles btn_arrow.Click
        Dim clid As String = Me.Name
        ind.get_ind_data(Me.Name) **'THIS IS WHERE THE FUNCTION IS TRIGGERED**
    End Sub

    Private Sub btn_arrow_MouseHover(sender As Object, e As EventArgs) Handles btn_arrow.MouseHover
        btn_arrow.BackColor = Color.DarkBlue
        btn_arrow.ForeColor = Color.White
    End Sub

    Private Sub btn_arrow_MouseLeave(sender As Object, e As EventArgs) Handles btn_arrow.MouseLeave
        btn_arrow.BackColor = Color.Transparent
        btn_arrow.ForeColor = Color.SteelBlue
    End Sub

    Private Sub clientlist_individual_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    End Sub
End Class

As you can see, in the click event, the function is run, the function works as it should but cannot set the data in the form ims_submodule_directory.

Cheers
Jack

Yes it does.

Cheers
Jack

As said before, the issue is not with this function, the function although it doesn't return a value, it works as intended. The problem is with line 49, when it trys to update the text on screen on the main form (ims_submodule_directory). The form is not allowing changes by the user control.

As said before, the process is as follows:

Database query runs and creates usercontrols for each value. In the usercontrols once clicked, it should update text on the main form with the rest of the data that was brought across when the query ran. This is what fails. The userControl seems to have no access to the main form. What I am asking is if anyone can simply explain the way of accessing the main form to allow changes whilst in runtime.

Cheers.

I think the only real way for you to do this would be to run two queries and create a variable for the field from the other table. That is probably your simplest way, if I have understood you correctly.

So like where you have your query text, just have two, named $query1 and $query2.

First run the first one which gets everything, then run your second one in the same way and store the single field to a variable.

Let me know if you need further help.

Jack

I created mine when i was 9. It was called coolsurf... cos I was cool and i was surfing xD lol Literally was just a general website with things I liked etc. More a blog without the blogposts. Had a forum and things. It was built on what is now known as webs.com but used to be called freewebs.com. I am now 22 :D and building websites for a living... although no longer on webs! ;)

Ok here is the required feature:

To send data gathered from a database inside a UserControl to the main form which houses the UserControl.

Hierarchy at present:

Mainform
--FlowLayoutPanel
----UserControl

The UserControls are generated on the fly by a client list in a database. This all works fine.
When you click on the UserControl, the UserControl gathers the information associated with the client and stores them in to strings.

What should happen is the strings are then passed and set on screen to the main form, but this doesn't happen.

There is no real point in me posting code from the main window as the code there is working and does exactly what it should be, however below is the code that shows what should happen when the UserControl is clicked on.

Public Function get_ind_data(indclid As String)
        Dim firstname, lastname, middlename, postcode, address1, address2, county, country, email, compname, phone, clientid, pass As String
        Try
            Dim ind_fetcher As New MySqlConnection("REMOVED")
            Using ind_command As New MySqlCommand("SELECT * FROM clients WHERE clid='" + indclid + "'", ind_fetcher)
                ind_fetcher.Open()
                Using ind_reader As MySqlDataReader = ind_command.ExecuteReader()
                    While ind_reader.Read()
                        If (Not ind_reader.GetString(ind_reader.GetOrdinal("cl_firstname")) Is DBNull.Value) Then
                            firstname = ind_reader.GetString(ind_reader.GetOrdinal("cl_firstname"))
                        End If
                        If (Not ind_reader.GetString(ind_reader.GetOrdinal("cl_lastname")) Is DBNull.Value) Then
                            lastname = ind_reader.GetString(ind_reader.GetOrdinal("cl_lastname"))
                        End If
                        If (Not ind_reader.GetString(ind_reader.GetOrdinal("cl_middlenames")) Is DBNull.Value) Then
                            middlename = ind_reader.GetString(ind_reader.GetOrdinal("cl_middlenames"))
                        End If
                        If (Not ind_reader.GetString(ind_reader.GetOrdinal("cl_postcode")) Is DBNull.Value) Then
                            postcode = ind_reader.GetString(ind_reader.GetOrdinal("cl_postcode"))
                        End If
                        If (Not ind_reader.GetString(ind_reader.GetOrdinal("cl_address_1")) Is DBNull.Value) Then
                            address1 = ind_reader.GetString(ind_reader.GetOrdinal("cl_address_1"))
                        End If
                        If (Not ind_reader.GetString(ind_reader.GetOrdinal("cl_address_2")) Is DBNull.Value) Then
                            address2 = ind_reader.GetString(ind_reader.GetOrdinal("cl_address_2"))
                        End If
                        If ...

How do you do this, I have never worked with json_decode or json_encode.

Thanks for replying.

Hi everyone,

Let me first explain the idea:
I have a JSON document which has the following structure:

{
        "timeline":
        {
            "headline":"Example Content",
            "type":"default",
            "text":"Example Content",
            "startDate":"2013,1,1",
            "endDate":"2013,1,28",
            "date": [
                {
                    "startDate":"2013,1,10",
                    "headline":"Example Content",
                    "text":"Example Content",
                    "asset":
                    {
                        "media":"Example Content",
                        "credit":"",
                        "caption":""
                    }
                },
                {
                    "startDate":"2013,1,14",
                    "headline":"Example Content",
                    "text":"Example Content",
                    "asset":
                    {
                        "media":"Example Content",
                        "credit":"",
                        "caption":""
                    }
                },
                {
                    "startDate":"2013,1,21",
                    "headline":"Example Content",
                    "text":"Example Content",
                    "asset":
                    {
                        "media":"Example Content",
                        "credit":"",
                        "caption":""
                    }
                }
            ]
        }
    }

I want to be able to add the following sections using PHP that will get data from a database:

            {
                "startDate":"2013,1,14",
                "headline":"Example Content",
                "text":"Example Content",
                "asset":
                {
                    "media":"Example Content",
                    "credit":"",
                    "caption":""
                }
            },

Now people have been talking about json_encode() however, I am not quite sure 1) how to do this to achieve what I want and 2) whether that method would allow me to do what I want.

So basically could someone provide some help as to how to do it using json_encode() or if anyone knows of an alternative way, I would be happy to take all advice.

Thanks a bunch.
Jack

I find that if something takes longer than a few hours to do, my patience runs thin, so then my temper starts to flare ;)

So, how long does it take others to Begin the classic desk thumping, space slamming, vocal announcing that you are now highly annoyed ;)

Mine is simply my surname reversed with boi appended :)

Does anyone see an issue with the following IF statement... I sure can't yet it doesn't work!

VARIABLES:
$CHECK = A returned value from the database either "y" or "n", the value is returned successfully so I know that is not the issue here.

There is no error message returned, the IF statement simply refuses to work.
[CODE]
$check = mysql_fetch_row($resultX);
if($check == "y"){
}elseif($check == "n"){
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=main.php\">";
}
[/CODE]

Thanks evstevemd, works a treat!!!!

Cheers!

hmm not quite what I had in mind but i think that would work.. cheers! :D

Hi Guys,

Another puzzle for someone to try and crack...

I have two divs inside the <body> that basically act as two versions of the same page.

I need PHP to call one based on a variable retrieved from a database.

As it stands, this is what I have...

[CODE]
<?php
session_start();
require("config.php");
if(!isset($_SESSION['username']))
{
header('location:denied.php?msg=LOGIN REQUIRED');
}
else
{

}

$curruser = $_SESSION['username'];

$con = mysql_connect("","","***");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("**", $con);
$result = mysql_query("SELECT
FROM users WHERE username='" . $_SESSION['username']) . "'";

while($row = mysql_fetch_array($result))
{
$version = $row['version'];
$username = $row['username'];
}

mysql_close($con);
$version = "pharmacy";
$msg = "";
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-19042201-7']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();
</script>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<title></title>
<meta content="
" name="keywords"/>
<meta content="***" name="description"/>
<link href="../sitewide_stylesheet.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
.auto-style1 {
text-align: center;
margin-top: 0px;
margin-bottom: 0px;
}
.auto-style8 {
text-align: center;
font-size: xx-small;
color: #336699;
}
.auto-style12 {
text-align: center;
}
.auto-style13 {
font-size: x-large;
}
</style>
</head>

<body>
<?php if($version == "pharmacy"){ ?>
<div id="dsh_body_wrapper">
<div id="dsh_wrapper" style="height: 564px;">
<div id="dsh_header">
<div id="site_title">
<h1><a href="../admint/index.html">DS Healthcare</a></h1>
</div>
</div>
<!-- end of dsh header -->
<div id="dsh_menu">
<ul>
<li><a href="index.php" style="width: 60px;">Home</a></li>
<li><a href="index.php" style="width: 70px;">Pricing</a></li>
<li><a href="logout.php" style="width: ...

It's alright, I fixed it. Was simply down to one of the values not being passed due to one variable being capitalised and I hadn't noticed cos I was so tired.

Thanks for your help pritaeas!!!!

If it helps anyone, here is the login form (form code) itself.

[CODE]
<form name="l-auth" method="post" action="newlogincheck.php" enctype="multipart/form-data" class="auto-style11">
<div class="auto-style2">
<div class="auto-style9">
<strong><span class="auto-style7">USERNAME</span>  
<input class="auto-style3" name="username" style="width: 165px; border-style: groove; background-color: #9FCBD0;" type="text" /><br />
<span class="auto-style7">PASSWORD</span> 
<input class="auto-style6" name="Password" style="width: 165px; border-style: groove; background-color: #9FCBD0;" type="password" /></strong>
</div>
</div>
<p class="auto-style1">
<input name="Submit" style="background-image: url('../images/admint/loginbtn.png'); border-style: none; width: 177px; height: 47px;" type="submit" value="" class="auto-style10" />
</p>
</form>
[/CODE]

Hi Pritaeas, It's not a MYSQL error I get. The system just simply refuses to login with any user from the DB. It seems like maybe it is not using the received data to check against the db, but I am unsure.

You should have posted this in the "Web Development > Web Design > HTML/CSS" Forum. Also Mark as Solved.

Hi everyone,

Having a little difficulty getting anything from this.

The code appears to me to be correct, then again I have been looking at it for hours, so it is possible there could be a mistake...... :/

Anyway, the code seems sound, should let me login and instead gets nothing from the database and says login failed every single time.

Any help much appreciated!

[CODE]
<?php
session_start();
require("./config.php");

$con = mysql_connect($sqlserver,$sqluser,$sqlpassword);
if (!$con)
{
die('Connection to SQL Server failed. Error: ' . mysql_error());
}

$username = $_POST['username'];
$password = $_POST['password'];

mysql_select_db($sqldb, $con);
$sql= "SELECT * FROM admins WHERE username='$username' AND password='$password'";
$result = mysql_query($sql) or die('Query failed: ' . mysql_error() . "<br />");

$count = mysql_num_rows($result);

if($count==1)
{
$_SESSION["username"] = $username;
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=./successpage.php\">\n";
}
else
{
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1;URL=./index.php?msg=Sorry those details were unrecognised, please try again.\">\n";
}
mysql_close($con);
?>
[/CODE]

Cheers,
Jack.

Brilliant, thank you Airshow, you are a legend!

I knew it would be something so simple :D It worked as needed!

Well, that bit of code in the onchange, was from a tut, so I shall get in touch with them to tell them it isn't quite correct depending on where it is being used.

Once again, cheers for the help Airshow!!!!!

Jack

Not sure about this, very hard to read the code without syntax.

However, it appears that "Mouse" has not been declared anywhere, yet it is being used within functions. You need to 1) use correct syntax when placing code on here (Just use [ CODE ] and [ /CODE ] (Without spaces). and 2) simplify what it is you want to achieve as I got lost about 5 lines down!

Cheers
Jack

The title of this post didn't need to contain "On Macbook Pro" Javascript is handled by Java and the client internet browser, therefore the OS makes no difference to how Javascript runs, it merely hosts it. Saying that, you should make sure you do not have Javascript disabled within your internet browser, this would account for this change not being reflected.

Could you post the entire page content on here? Which starts from <html> and ends at </html>

Thank you.

I am having trouble returning things from this function. Below is the function.

[CODE]
function switchframeAQUA(v) {
if (v == "0") {
document.getElementById("picframe").src = "/frames/cod-liver-oil_pic.html";
document.getElementById("blurbframe").src = "/frames/cod-liver-oil_blurb.html";
} else if (v == "1") {
document.getElementById("picframe").src = "/frames/fish-oil_pic.html";
document.getElementById("blurbframe").src = "/frames/fish-oil_blurb.html";
} else if (v == "2") {

} else if (v == "3") {

} else if (v == "4") {

} else if (v == "5") {

} else if (v == "6") {

} else if (v == "7") {

} else if (v == "8") {

} else if (v == "9") {

} else if (v == "10") {

} else if (v == "11") {

} else {
document.getElementById("picframe").src = "/frames/cod-liver-oil_pic.html";
document.getElementById("blurbframe").src = "/frames/cod-liver-oil_blurb.html";
}

};

[/CODE]

This below, is where this is called and the entire system. Just so you can all get the basic idea :D

[CODE]
<select name="aqua" style="width: 160px" class="auto-style5" onchange="switchframeAQUA(aqua.options[this.SelectedIndex].value)">
<option value="0" >Cod liver oil</option>
<option value="1" >Fish oil</option>
<option value="2">Evening Primrose oil</option>
<option value="3">Evening Primrose + Starflower oil</option>
<option value="4">Starflower oil</option>
<option value="5">Linseed oil</option>
<option value="6">Super Multi Minerals</option>
<option value="7">Magnesium + Vit B6</option>
<option value="8">Flaxseed oil</option>
<option value="9">Omega 3/6/9 Blend (Organic)</option>
<option value="10">Flaxseed oil (Organic)</option>
<option value="11">Super Multi Minerals</option>
</select>

[/CODE]

This doesn't do anything!
Seriously, nothing is returned at all and nothing changes.

Any help would be much appreciated as I have tried working at this for nearly two days now =[

Cheers!
Jack

Ok, do you know of any other methods in which i can use that will not check for caps/punctuation/symbols etc?

Cheers, Jack

Hi everyone,

Having difficulty comparing two strings (Inside variables) in php.
I have tried several methods, one being strcmp but I think I was doing that incorrectly, and now the simple [B]===[/B] / [B]==[/B] comparison methods.

Here is the code:

[CODE]
<?php

    if ($pubinfo_username === $currentuser) {
    echo "<img alt=\"Remove this post\" height=\"20\" src=\"../images/btns/x.png\" width=\"25\">";
    } else {
    }
    ?>

[/CODE]

That is the simple [B]===[/B] strict comparison between strings, personally I see no reason as to why this doesn't work, but clearly something is wrong.

Any help is much appreciated!

Cheers, Jack.

My aim is to have a function created in a while loop. In the while loop posts are retrieved from a db via sql . Each post has an id and what i wanted to do was have the post id used as the function name because simply placing a function in a while loop fails because it can only be declared once. So i need some way of being able to use a function once but that is generated on the fly. Each post has its own variables in which i need to use in the function, so if there is some way i can do that then that would be great!

Cheers.

Actually Diamonddrake, Cosmos allows for many different areas of development. If you take a look on Youtube you can see some GUI's that people have managed to create that runs on a cosmos based kernel. I myself have just begun development of a business OS for my business and at the stage I'm at can see many areas for development.

I think your statement was a bit harsh there my friend :)