Mr.M 89 Future Programmers

Figured out the problem. On my php file there is a part where I try to send what ever was posted to this file and send it by email, for some reasons that I don't know the POST data is not included in the email and I tried to use var_dump which was what turns out to print back the posted data to my ajax response.

Mr.M 89 Future Programmers

Hi DW.

I'm trying to post data without refreshing the page using the ajax, and its works fine the problem is that on the response I also get the array data that I posted to my php file then at the end of response is the returned data which is echoed from my php file. I post 3 data which are from my form but the problem is that on my response this data is also shown when I do alert(response); please check attached image and you will see that on the alert response firstly the array of what I posted to my php file is returned then my response is returned at the end of the response.

My question is how can I only show the returned response not what I posted to my php file?

$(document).ready(function(){
$("#btn").click(function(){
var custdata = $("#custom_str1").val();
var vname = $("#name").val();
var vemail = $("#email").val();
if(vname=='' && vemail=='')
{
alert("Please fill out the form");
}
else if(vname=='' && vemail!==''){alert('Name field is required')}
else if(vemail=='' && vname!==''){alert('Email field is required')}
else{
$.post("pass.php", //Required URL of the page on server
{ // Data Sending With Request To Server
custom_str1:custdata,
name:vname,
email:vemail
},
function(response){ // Required Callback Function

if(response == "Mr.M"){
    var mdqq = document.getElementById("suc");
    if(mdqq.style.display === "none"){
        mdqq.style.display = "block";
    }
}else{

      var ssgd = document.getElementById("sucaa");
      if(ssgd.style.display === "none"){
          ssgd.style.display = "block";
      }
    }
alert(response);//"response" receives - whatever written in echo of above PHP script.

$("#form")[0].reset();
});
}
});
});

On my php file I simply …

Mr.M 89 Future Programmers

Well in my case we have bought sms and we have a website so I just simplified my work by creating a simple php file which gets data to be sent then it sends the sms. In my VB.net I call this file and feed it with required data to complete.

Mr.M 89 Future Programmers

This post is 4 years old, you can't hijack other peoples posts. You haven't also stated what have you tried so far.

Mr.M 89 Future Programmers

Also I just don't think my code does send the post/get method because on the server I have a php file that should write a file with what ever was posted to it and then return back the post data by means of echo but if I post via my app nothing happens on the server but if I use some other tools like postman the file is created and I get the data back.

Mr.M 89 Future Programmers

The html was the requirement of cookies, I've found a solution to it, but I dont get anything back now.

Basically I send a key with a value to my php file and the only thing that php file does is echo the POST/GET data which is what I should see on my Textview which is what I'm trying to achieve in line 33, which means I should see what I sent to the server back.

Mr.M 89 Future Programmers

Hi Dw.

This is my first Android app, and what I'm trying to do is to post a POST/GET method to my webserver using Http in Android studio.

I also have a Textview which suppose to display echoed data from server which will be a response to a request since the php file I'm posting to simply echo back the data.

Here is what I have:

try {
            URL url = new URL("http://myURLAddress/run.php");
            JSONObject postDataParams = new JSONObject();
            postDataParams.put("name", "Mr.M");
            Log.e("params", postDataParams.toString());

            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setReadTimeout(15000 /* milliseconds */);
            conn.setConnectTimeout(15000 /* milliseconds */);
            conn.setRequestMethod("GET");
            conn.setDoOutput(true);
            conn.setDoInput(true);

            OutputStream os = conn.getOutputStream();
            BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os, "UTF-8"));
            writer.write(getPostDataString(postDataParams));

            writer.flush();
            writer.close();
            os.close();

            int responseCode=conn.getResponseCode();
            if(responseCode == HttpURLConnection.HTTP_OK){
                BufferedReader in=new BufferedReader(new InputStreamReader(conn.getInputStream()));
                StringBuffer sb = new StringBuffer("");
                String line = "";
                while ((line = in.readLine()) != null){
                    sb.append(line);
                    break;
                }
                in.close();
                //return sb.toString();"Message Sent."
                MainActivity.tvresult.setText(sb.toString());
            }else{
                //return new String("false : " +responseCode);
                MainActivity.tvresult.setText(responseCode);
                //MainActivity.tvresult.append(,responseCode);
            }
        }catch (MalformedURLException e){
            e.printStackTrace();
        }catch (IOException e){
            e.printStackTrace();
        }catch (JSONException e){
            e.printStackTrace();
        } catch (NetworkOnMainThreadException e){
            //MainActivity.tvresult.setText(e);
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }

I get a 200 respond and with this line MainActivity.tvresult.setText(sb.toString()); on Textview I see some HTML code not data that was echoed by server.

How can I get the data server echoed?

Mr.M 89 Future Programmers

Got it. Just did it like this:

        <div class="<?php echo $_SESSION['iiio'] == "pending" ? 'show' : 'hidden';?> <?php echo $_SESSION['xmm'] == "standard" ? 'hidden' :'show';?>"
        <a href="https://www.paymentgateway.com">
        <button align="right" id="completeReg" name="completeReg" class="btn btn-danger my-cart-btn my-cart-b" >Complete RegistrationComplete Registration</button>
        </a>
        </div>
Mr.M 89 Future Programmers

Hi broj1,

Can you explain how can I have two conditions that both affect the display of the same div. e.g.

    <div class="<?php echo $_SESSION['iiio'] == "pending" ? 'show' : 'hidden' AND $_SESSION['xmm'] == "standard" ? 'hidden' :'show';?>"
    <a href="https://www.paymentgateway.com">
    <button align="right" id="completeReg" name="completeReg" class="btn btn-danger my-cart-btn my-cart-b" >Complete RegistrationComplete Registration</button>
    </a>
    </div>

I'm sure you can see that I'm trying to show this div is session[iiio] is pending and also hide it if session['xmm'] is a standard member.

A simple and good example is when you have a member and there is an option you want to only display it to certain users, now both the standard user account and lets say profesional user account does meet iiio but now only professional user account can see this. This is just an example to show why I need this kind of condition in this.

Thanks

Mr.M 89 Future Programmers

Well I'm not to sure how many levels do you have and also I didn't read your code that much. In my case there are 5 levels so what I did was first get the current user's ID then get how many children that user have, once I have that I then loop though each child to find out how many child each have which those are now grand childrens of the current user same thing again with the grand children loop through them to get their grand children which are this current users grand grand childrens and so on to level 5.

With that you can also get their details such as name, usernames, their total tree number and so on.

Mr.M 89 Future Programmers

Hi DW.

I am able to purchase from my online store but I don't seem to be able to get the pass through data which whould be sent to my notify_url. Payfast is my payment gateway and now it does call my notify_url because two files are created after I try to purchase but the files are blank and what I want is to get the posted variables and their values, but I'm not sure if the variables are posted on call or because even if I try to trap the $_POST I don't get any data.

Here is my notify_url script which should write file with posted data but the files are empty. The files created are the first two files not the failed file.

header( 'HTTP/1.0 200 OK' );
flush();

// Posted variables from ITN
$pfData = $_POST;
$myfile = fopen("payfastPost.txt", "w") or die("Unable to open file!");
$txt = $pfData;
fwrite($myfile, $txt);
fclose($myfile);
//update db
switch( $pfData['payment_status'] )
{
 case 'COMPLETE':
    // If complete, update your application, email the buyer and process the transaction as paid     
    $myfile = fopen("payfastComplete.txt", "w") or die("Unable to open file!");
$txt = $pfData;
fwrite($myfile, $txt);
fclose($myfile);
 break;
 case 'FAILED':                    
    // There was an error, update your application
    $myfile = fopen("payfastFailed.txt", "w") or die("Unable to open file!");
$txt = $pfData;
fwrite($myfile, $txt);
fclose($myfile);
 break;
 default:
    // If unknown status, do nothing (safest course of action)
 break;
}

Here is my purchase button:

<button id="cCart" type="submit"  class="btn btn-danger my-cart-btn my-cart-b" onClick="Javascript:window.location.href = 'https://sandbox.payfast.co.za/eng/process?merchant_id=10007327&amp;merchant_key=cdfgwzzwudp39&amp;item_name=test&amp;item_description=test&amp;payment_method=cc&amp;amount=5.00&amp;email_address=<?php echo $_SESSION['qwertp'];?>&amp;custom_str1=first&amp;custom_str2=xx&amp;custom_str3=<?php …
Mr.M 89 Future Programmers

Thank you very much, you are a life saver.

Thanks

Mr.M 89 Future Programmers

Hi Guys. I'm having a serious problem that is holding me back. I have a file which is a user dashboard and this file gets data from another php script file which is called by a user login screen when a user clicks login. The file verify the credentials then if correct that its start to pull some data from the database. The problem is that now there are some users who don't complete their registration process which some stop where they need to make their payments so their accounts are kept with a status of pending which indicate that the user has not pay the registration fee. Now I am able to read the status from the database and assign it to the session so that I will work with on the dashboard, this controls which tells if the complete your registration button should be shown or not of which in this case because the status is pending the dashboard should show this button. My problem is showing or hiding it as this should be hidden when a user has paid his/her registration fee because this update the database with Active status.

I've tried this:

<div if($_SESSION['iiio'] == "pending"){echo " style='display: block';"};><a href="https://www.paymentgateway.com" ><button align="right" id="completeReg" name="completeReg" class="btn btn-danger my-cart-btn my-cart-b" >Complete RegistrationComplete Registration</button></a></div>

But the above will just do what the display:xxxx has if it has none it won't display the block even if the condition is not met for this where it should display because the condition …

Mr.M 89 Future Programmers

Its a good idea to do database but if your data is not too big and you don't worry that much with data loos then you can still continue with text file but since you are new I think you will have to read more in file streams, IO, just to name a few and there are ways also to search for data using also regex and delimitors and Array. I think thats what you need to look into.

Mr.M 89 Future Programmers

Mmmm thanks everyone for your comments and your suggestions as well. Well I will close this post. I've got an alternative to this problem I had.

Mr.M 89 Future Programmers

Ok lets stick with

I'm trying to record someone's phone number without them actually submitting the form

Mr.M 89 Future Programmers

@pty

what are actually you trying to do?

Well I've already stated

what I want is to take what is typed on the textbox and assign it to another control variable or at least take that data that was typed and assign it to session

Mr.M 89 Future Programmers

Well @pty you can call it whatever you call it, but the it remain the same. The reason for you to talk like that is because you haven't faced this kind of gateway so I wont argue with you but it is what you see.

Mr.M 89 Future Programmers

Thanks but I think you miss understood. I want to take what is typed on the dCell input box and assign it to a session so that I can call that session to have that data.

So this

<?php
 $_SESSION['num']='4567890123';
?>

should not be hardcoded but it should be assigned by a value that will be from dCell inputbox so if it possible it this php should be in the checkmax function and it should get the data from there. Basically I want to assign this data to a variable that will be sent as a query in the url when the the user click the button.

The problem with the button is that its a link button so it doesn't submit the form but the link is formed and the user is taken to that link. This is an integration with payment gateway so this data should be passed to them via this way so that why I don't post or get this to another php file.

Mr.M 89 Future Programmers

I want to achieve something like this or I want to do this but its doesn't work here how can I do it, take note of parameter data-name

<div class="clearfix"></div> <button id="cCart" class="btn btn-danger my-cart-btn my-cart-b" data-id="16" data-name="<script>var session ='<%=Session["unumber"]%>'</script>" data-summary="summary 16" data-price="50" data-quantity="1" data-image="images/of15.png">MMM</button>

The texbox which the data will be taken from:

<input  type="text" id="dCell" value="Cellphone Number" maxlength="10" onkeypress="checkmax(this)" name="CellphoneNumber2" id="cCell" onblur="checkmax(this)" onfocus="if (this.value = '') {this.value = 'Cellphone Number';}" required>

The checkmax script:

<script>
                    function checkmax(element){
                        if(element.value.length == 9){
                            //var idNumber = $('#dCell').val();
                            var vvc = document.getElementById('#dCell').value;
                            <%Session["unumber"] = vvc;%>
                            var Session_value='<%=Session["unumber"]%>';
                            alert(Session_value);
                            //$(function() {
                                //$('#dCell').change(function() {

                                    //'<%Session["unumber"] = "' + this.value + '"; %>';
                                    //alert('<%=Session["unumber"] %>');
                                    //<?php
                                    //$thh = (this.value);

//$_SESSION['thulani'] = $thh;
//?>

                                    //$('#cCart').attr('data-name', this.value);
                                //});
                            //});
                        }else{

                        }
                    }
                    </script>
Mr.M 89 Future Programmers

Hi guys sorry for the late reply.

Basically what I want is to take what is typed on the textbox and assign it to another control variable or at least take that data that was typed and assign it to session with Javascript so that I will be able to keep using that data within some control before the form is actually submited. So the form submit goes to another separate file.

I think triggers like these onChange="chkLen();" would work instead of submitting the form. So I think now whats left is to get a way of, on onChange="chkLen();" get the actual data typed and then take that data and assign it to a session mySessionIDHere so that when I call this session on controls the data that was typed on that textbox will be displayed on the control I'm calling the session on.

I'm not sure if that is clear now but I hope it is.

Mr.M 89 Future Programmers

This may sound confusing but I have a textbox which is a cell number textbox and I want when the max length of 10 has been reached then fire the php code which is inside the same html page as form and this php code will then get the value or data which has been keyed in to this text box. I've tried Javascript and the problem I'm having with javasacript is to now display this data so that why I've deiced to change to php because I know how to display the php session data within the textbox with something like

<input type="text" id="dCell" value="<?php echo $_SESSION['mySessionIDHere'];?>">"

so I tried to do something like this but with javascript but the whole tag codes just show on screen when I run load the page so that why I've choose to go with php.

Please do note that the page is HTML and the input from which I want to take the data from is also in html not php the php function script will be written within the html page so all of this will be in one page not that it will be passed to another page no.

Mr.M 89 Future Programmers

Yes I did, I even tried using the attr () but still.

Mr.M 89 Future Programmers

Ow I've spotted what you are talking about, I missed the # I've just did as you said but still the 'data-name=testbutton' is not updated. its just writes 'testbutton' to the cart

Mr.M 89 Future Programmers

But my code is the same as what you posted except that you had 'name' and I have 'data-name' which is where I want to apply the changes.

Mr.M 89 Future Programmers

Hi everyone.

I'm having a very seriouse problem where I have a textbox and I want a button and I want to take whatever a user type in this textbox/textarea and set it to the data-name which is a button's parameter. Here is the codes.

Textarea: <input type="text" id="dCell" value="Cellphone Number" maxlength="10" onkeypress="checkmax(this)" name="CellphoneNumber2" id="cCell" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Cellphone Number';}" required>

Button:<button id="cCart" class="btn btn-danger my-cart-btn my-cart-b" data-id="16" data-name="testbutton" data-summary="summary 16" data-price="50" data-quantity="1" data-image="images/of15.png">Buy Airtime</button>

The code I tried:

function checkmax(element){
                        if(element.value.length == 9){
                            //var idNumber = $('#dCell').val();
                            $(function() {
                                $('dCell').change(function() {
                                    $('#cCart').data('data-name', this.value);
                                });
                            });
                        }else{

                        }
                    }

I can't seem to make this work. I want to assign whatever the user typed to the button on the 'data-name' so it will change from testbutton to whatever the user typed. How can I get that working?

Mr.M 89 Future Programmers

Thanks.

Mr.M 89 Future Programmers

I managed to get the solution to this problem and the solution is:

<?php
$mysqli = new mysqli($host, $user, $password, $database);
// DO ERROR CHECKING HERE

$article_id = isset($_GET['id']) ? $_GET['id'] : false;

if ($article_id) {
  $query = <<< QUERY
SELECT * 
FROM 
  `ndlelabyte`.`messages` 
WHERE 
  `articleid` ={$article_id} 
LIMIT 0 , 30
QUERY;

  $result = $mysqli->query($query);
  if ($result) {
    while ($row = $result->fetch_object()) {
      echo <<< COMMENT
  <div class="col-xs-12">
    <div class="mbr-testimonial card">
      <div class="card-block"><p>{$row['comments']}</p></div>
      <div class="mbr-author card-footer">
      <div class="mbr-author-name">{$row['author']}</div>
    </div>
    </div>
  </div>
COMMENT;
    }
  }
}
Mr.M 89 Future Programmers

Hi DW.

I have built a website using Mobirise and now what I want to do is to enable the site to accept comments from people and also display them on the page on the section COMMENTS, now the problem is that I want the comments to use the themes format but the problem with that is that the javascript produce and error if I take the entire DIV section that produce this comment style so that it will be applied to each and every comment. Please check the site and click on the Piracy Impact and check the comment section to see how I want all of my comments to show like. I have 2 php files which one is for retrieving the comment and the other for retrieving the name, this helps me to keep the style but this only works for the first comment, then the rest just displays bellow the first comment and without separating the retrieving process the name is not displayed in a correct stye.

Bellow are the codes that I use to retrieve data:

1) Display Comments

<?php

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

mysql_select_db("ndlelabyte",$con);

$article_id = $_GET['id'];

$query = "SELECT * FROM `ndlelabyte`.`messages` WHERE `articleid` =$article_id LIMIT 0 , 30";
$condolencey = mysql_query($query);

while($row = mysql_fetch_array($condolencey, MYSQL_ASSOC))
{

$cond = $row['comments'];

echo "<p>$cond</p>
";
}

mysql_close($con);

?>

2) Displaying the name is the similar code as above but this time I point/retrieve the name.

Mr.M 89 Future Programmers

I've found the solution to this problem and the problem was that I was writting the code in the wrong place, the correct place is inside the Form1.h and you will be able to do all the possible things to the control even on run time, you can update, change its colors, show, hide, etc.

Mr.M 89 Future Programmers

@Glenda I think that easy as you already know where you want that to be visible which means you will have to modify the

Label1.Text = DataGridView1.CurrentCell.Value.ToString

to what ever you want, but I think you will have to have some sort of verification if you will have more then one option so that the displayed message will correspond to a correct DataGridView Item.

Mr.M 89 Future Programmers

@Thines01. I've tested your code and it does retrieve the data, but the issue that I'm having now is that on my other code that read a file on a local system uses a getline and .find, npos to find the specific data from the file but now I can't seem to do this or apply it when using your code.

Here is a sample text file which should give you an idea of what kind of file I'm working on and how data is inside.
STRUCTURE

ID,Number,Key (Sometimes this part is empty or had a 1 digit)
111,676546755,
132,4735432,4

Now what I'm trying to do is to search the given ID from the file and if the ID is found then read and split that line to corresponding variables which will hold each piece but the piece that we now deal with is the Number as well as the key (Note that sometimes Key can be empty) this is for further verification process purposes.

Thats what I want to archieve. Here is just a piece of code that I used to archive this in a local file.

ifstream in("d:\\aaaa.txt");
if(in.is_open())
                         {
                             while(!in.eof() && getline(in, line, ','))
                             {
                                if((offset = line.find(ID, 0)) == string::npos)
                                {
                                // AS YOU CAN SEE HERE IS WHERE I ASIGN EACH FIELD DATA
                                // TO ITS CORRESPONDING VARIABLE.
                                    ID = atoi(line.c_str());
                                    in >> dat;
                                    getline(in, NUMBER, ',');
                                    getline(in, line, '\n');

                                    KEY = (int)atof(line.c_str());
Mr.M 89 Future Programmers

@Thines01. Thank you for that and it look like its what I'm looking for indeed. To mention I'm using Microsoft Visual C++ 2010 under the Microsoft Visual Studio 2010 IDE, and the project is a GUI (CLI) application. My out comes with the boost is that it worked fine with a console application but when I tried to include it to my GUI app an error of already included WinSock.h is thrown so that means boost didn't help as its gives me a problem with my intended application.

I will give this a try and see if it will solve my problem then I will also comment back. About the cURL, I had already had downloaded it, but I couldn't understand it as to how I can use it to read the text and also I couldn't understand the library building part as its talked about UNIX OS whereas I'm using Windows OS.

Mr.M 89 Future Programmers

I've just saw something about

boost

and I will try it and see if its whats I'm looking for but its look like its is what I'm looking for.

Mr.M 89 Future Programmers

Hi DW.

Is there anyone know how to read a text file line by line from the web/internet in VC++?

I have a function which works well in reading the local file but its seems as if its doesn't find or read a file on a web server. A file I would like to read is located on a web address like this : http://www.thesitedomain.com/test.txt
Any working idea in solving this problem?

Mr.M 89 Future Programmers

You problem is here

        cmd = New OdbcCommand("insert into arsip values (?, ?, ?, ?)", conn)
        With cmd
            .Parameters.AddWithValue("?", TextNO.Text)
            .Parameters.AddWithValue("?", TextJenis.Text)
            .ExecuteNonQuery()
        End With
        conn.Close()

you have 4 values that need to be used but you only used 2.

If your database doen't have 4 fields then your code should be like this:

        cmd = New OdbcCommand("insert into arsip values (?, ?)", conn)
        With cmd
            .Parameters.AddWithValue("?", TextNO.Text)
            .Parameters.AddWithValue("?", TextJenis.Text)
            .ExecuteNonQuery()
        End With
        conn.Close()
Mr.M 89 Future Programmers

Is the problem with getting and reporting data or you haven't used Crystal Report?

Mr.M 89 Future Programmers

Just to be specific to the problem exactly. The error indicate that it couldn't find the file you specified, and it also say that you didn't handle such expection by using a Try method.

What could help in this problem is to ensure that the file path is correct.

Open your file explorer, go inside the folder where your image is located.

Once you there on the explorer at the very top, there is a URL box (TextBox) which shows you where you currently are, move your mouse the the end of the text inside that textbox then click and copy it to your code and at the end of it put a / then your image name. AFter done that reRun you program and your problem of image location should be resolved.

Check the bellow images as to what I meant above. Sample1.png Sample2.png

Mr.M 89 Future Programmers

Nah didn't say that. Thought maybe there's another reason behind.

Mr.M 89 Future Programmers

Ok cool. I will check this out and see, @rproffitt, well I must say I'm actually going forward and also regarding the post you are refering to, I've also mark most of them as solve because I managed to find solutions to it.

This also make me a bit suspecious that you are also following me and my posts. Are you also trying to do what I'm doing? because I'm way to far now. infact I'm almost done with my project.

Mr.M 89 Future Programmers

Hi DW.

I would like to know if its possible to get the source path of a file copied/moved to a folder I set a FileSystemWatcher? What I mean is that get the location as to where this file is coming from if its was copied/moved into this folder.

Thank you.

Mr.M 89 Future Programmers

Thanks I did find the problem to this months ago and the problem was actually with the Internet Package I had. The package didn't have a static Public IP address, the IP was changing now and then and also another problem was that the router didn't issue a computer connecting to it a static IP address the IP addresses of our computers were keep swopping around, this time this IP address is issued to my computer, next time its issued to another computer and I'm issued another IP address. This was caused by not staying connected to the router and when another person comes and connect while you are offline then the IP address you were using will be issued someone else whos connected by that time.

Mr.M 89 Future Programmers

Thanks what I did was that I kept it on that main function a added more control which are for each and every function and its worked. I also think this isn't the good way of programming in C++ as its limits me. I think I should have wrote my Functions on the .h file not on the .cpp but if I do that errors occures.

Mr.M 89 Future Programmers

Please post that code as of the start of the Sub to the end of that sub End Sub so that we can see what's wrong, but I think your code is outside the Sub that why you are getting those errors but that can be confirmed after you have posted the code as I stated above so that we can see what went wrong or what is wrong with your code.

Mr.M 89 Future Programmers

What code do you have so far?

Mr.M 89 Future Programmers

Does your script has a connection time out? This can happen if the end user's internet connetcion is slow and also if they are also behind the proxy or their network connection has some blockings in sertain ports. In my case it was the network which had certain ports being blocked so I wasn't able to access but if they can access, maybe your script/server has some sort of time out which will result in those who are using slow connection not being able to upload large files.

Mr.M 89 Future Programmers

In addition to what @ddanbe has asked, can you also be more specific as to what data you want to populate and also where about in the form you want to populate it, I mean the control you want to use to display such data.

Mr.M 89 Future Programmers

So you mean I can call

form->label1->Text = "Text has changed from the out side.";
Application::Run(form);

as much as need and where ever I want to? I will have to try it out and see then.

Mr.M 89 Future Programmers

Hi well my code is not inside the .h file but its inside the .cpp file and those are the functions that should access the control on the .h file from .cpp file. I've manage to get it to update on startup under the main function like this

Form1 ^form = gcnew Form1();
form->label1->Text = "Text has changed from the out side.";
Application::Run(form);

Now I have other functions which should also update this label control. How can I do that or is it safe to use the above code on each and every function that needs to update this label?

Mr.M 89 Future Programmers

Provide us with the code you have so that it will be easy for use to help you out.