dilipv 0 Light Poster

Okay...here's the html form part:

move_uploaded_file($_FILES["pic1"]["tmp_name"], "../uploads/" . $_FILES["pic1"]["name"]);

hi there,
i think you need to make sure image is properly uploaded in to the folder. For this you can use

$result = move_uploaded_file($TempFileName, $FilePath);

					if (!$result) 
					{
						echo "Error in uploading file"; 
						exit;
					}
					chmod($FilePath,0777);

chmod change permission to that folder. Also you need to manually change permission using your FTP. Simply right click on that folder in FTP and choose CHMOD option change it to WRITE ALL.
If problem persist please reply.
Hope this will help you.
Thanks & Regards
Dilip Kumar Vishwakarma

dilipv 0 Light Poster

Hello DaniWeb users, I'm in search of a script that is currently in use by JoyStiq, or something like it if it is unique.

[img]http://i40.tinypic.com/qqqwm1.png[/img]

It basically lets you hover the image and a link is displayed under and you can click the image or the link. Visit http://www.joystiq.com/ to see what I mean. Can anybody help me find this script or a script like it?

hi there,
this is dilip here,
i have seen that website but not able to figure out what he/she had done, because he/she uses large amount of javascript code in web page itself. Which is not a good idea, it's just my advice.
Now back to the point i think you can do this using javascript easily.

<table><tr>
<td><a id='one' onmouseover="change_text(this,'answer')">Check Availability<img src='http://www.perrypl.okpls.org/computer.jpg' width=100px height=100px></a></td>
<td><a  id='two' onmouseover="change_text(this,'answer')">Check Availability<img src='http://www.perrypl.okpls.org/computer.jpg' width=100px height=100px></a></td>
<td><a id='three' onmouseover="change_text(this,'answer')">Check Availability<img src='http://www.perrypl.okpls.org/computer.jpg' width=100px height=100px></a></td>
</tr></table>
<span width="200px;" id="answer">&nbsp;</span><br/>

in above code there are 3 images, on mouse over event you need to call javascript function and there is span which is used to display information based on selected mouse over event. That javascript function will change text of that span. The javascript function will look like

<script>
function change_text(control,display)
{
 var ctr=document.getElementById(control);
 switch(ctr)
{
   case 'one':document.getElementById(display).innerHTML='This text is on ONE'; break;
   case 'two':document.getElementById(display).innerHTML='This text is on TWO'; break;
   case 'three':document.getElementById(display).innerHTML='This text is on THREE'; break;
default:document.getElementById(display).innerHTML='This text is on default text'; break;
}
} …
dilipv 0 Light Poster

i want to insert it in a database by taking from form
KNR

First you are in DaniWeb dont ever ask for any code. Ask your doubts.
Now for your problem
If you wanna user to choose a date then use following
Download DataTimePicker.js a javascript file which on ckick of a link it will allow you to choose date. After that you can submit your form which holds your date value. Now you can easily insert that date to database.
Check given Url
http://www.javascriptkit.com/script/script2/tengcalendar.shtml

else
you wanna current date of the system you can use Date function of php.
hope this will help you.
Thanks & Regards
Dilip Kumar Vishwakarma

dilipv 0 Light Poster

<input type="radio" name="position" value="Alumnus">Alumnus<br>
<input type="radio" name="position" value="Member">Member<br>
<input type="radio" name="position" value="Former Member">Former Member<br>
<input type="radio" name="position" value="Voting Member">Voting Member<br>
<input type="radio" name="position" value="HR Vicepresident">HR Vicepresident<br>
<input type="radio" name="position" value="MK Vicepresident">MK Vicepresident<br>
<input type="radio" name="position" value="PR Responsible">PR Responsible<br>
<input type="radio" name="position" value="President">President<br>
<input type="radio" name="position" value="Secretary">Secretary<br>
<input type="radio" name="position" value="Treasurer">Treasurer<br>

hi, i think you have problem with primary key after postback it wont get primary key by which it will make updation , so use

<input type="hidden" name="pno" value="<?php echo $pno; ?>" />

and also you have difficult programming structure in above quote.

<input type="radio" name="position" value="1">Voting  Member<br>

At value property of each radio button insert its corresponding value like you have checked for 0,1,2,3,4,5,6.
Which will ease your task.

$add=mysql_query("UPDATE people SET name='".$_POST['name']."', surname='".$_POST['surname']."', position='".$_POST['position']."', photo='".$_POST['photo']."', board='".$board."' WHERE pno='".$_POST['pno']."' ")or die(mysql_error());

hope you understand my point
Thanks & Regards
Dilip Kumar Vishwakarma

dilipv 0 Light Poster
<form>
	<table border="0" width="100%">
	<tr>		
	<td align="right" width="60%"><select name="select" size="1"  onChange='submit()'>
	<option value='0'>Select Category</option>
	<? $sql1=mysql_query("select name from categories") or die(mysql_error());
	$num=mysql_num_rows($sql1);
	while($row=mysql_fetch_array($sql1))
		{
			$category = $row['name'];
	
       ?>
	<option value='<?php echo $category; ?>'><?php echo $category; ?></option>
		 
      <?     
	    }
      ?>
	</select>
     </td>		
	</tr>
	</table>
</form>

i think you can either submit your form for processing php script on change event of select or you can call javascript function which will call php page for processing. 2nd option is known as Ajax with php.
If you wanna see ajax and php then visit given url
http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=333
hope this will help you.
Dilip Kumar Vishwakarma

dilipv 0 Light Poster

while($result = mysql_fetch_array($qry))

hi there,
you get error at this line becuase in mysql_fetch_array($result) function can takes only result variable which holds output generated by $result=mysql_query($qry);
hope you understand.
Now for deleting part ,me also suggest make table which contain each row returned by query and last column contains link which hold link of php processing page and primary key of that row in the form of querysting.
please check this Url
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Databases/Q_23328726.html
Hope this will help you.
Thanks & Regards
Dilip Kumar Vishwakarma

dilipv 0 Light Poster

hi firebirds98,
You can populate DropDownlList from Sql database as follows.

connection_object.start_connection()
datareader_object = connection_object.executequery("SELECT city_name from City")
DropDownList1.Items.Clear()
While dr.Read
DropDownList1.Items.Add(dr(0))
End While
dr.Close()
connection_object.close_connection()

Hope this will help you.
Thanks & Regards
Dilipv

dilipv 0 Light Poster

hi ebabes,
I think problem exists in your connection string.Since you are using C# as your coding language then due to Escape sequence ('\') problem your connection string is not proper.
It should be like that.

this.oleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + Server.MapPath("~\\MyData\\grades.mdb");

OR

this.oleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:\\MyData\\grades.mdb";

Hope this will help you.
Thanks & Regards
Dilipv

dilipv 0 Light Poster

hi mukund_007,
For doing the same you need to add Textbox, DropDownList and Button and datagrid to aspx page as follows.

<asp: TextBox ID ="txtBox"  runat ="server"></asp: TextBox>
<asp: DropDownList ID="ddlist" runat ="server" >
<asp: ListItem Text ="1" Value ="1"></asp: ListItem>
<asp: ListItem Text ="2" Value ="2"></asp: ListItem>
<asp: ListItem Text ="3" Value ="3"></asp: ListItem>
<asp: ListItem Text ="4" Value ="4"></asp: ListItem>
</asp: DropDownList>
<asp: Button ID="submit" runat ="server" Text="submit" OnClick="submit_Click"/>
<asp: DataGrid ID="dgrid" runat ="server" ></asp: DataGrid>

You need to add your datagrid table to session["SampleDataTable"]; on page load.
Then on the Button click event you write as follows.

protected void submit_Click(object sender, EventArgs e)
    {
        DataTable dt = new DataTable("ani");
        dt = (DataTable)Session["SampleDataTable"];
        if (dt == null)
        {            
            dt.Columns.Add(new DataColumn("TextBox_Value", typeof(String)));
            dt.Columns.Add(new DataColumn("Item_Name", typeof(String)));            
        }
        DataRow dr = dt.NewRow();
        dr[0] = txtBox.Text;
        dr[1] = ddlist.SelectedValue;
        dt.Rows.Add(dr);
        dgrid.DataSource = dt;
        dgrid.DataBind();
        Session["SampleDataTable"] = dt;        
    }

After finishing of all the batch operation you need to update database to reflect the change in database.
Hope this will help you.
Thakns & Regards
Dilipv

dilipv 0 Light Poster

hi bungek84,
You can use MySql with ASP.net easily. There are lots of article's you can learn from there.
But for your help please visit the given link.

http://www.codeproject.com/KB/webforms/MySQLsuite.aspx

http://www.15seconds.com/issue/050210.htm

Hope this will help you.
Thanks & Regards
Dilipv

dilipv 0 Light Poster

hi johnny.g,
There are several article's were available , make Googled and you can definately got some solution on it.
I found out two article based on it. Just visit the link.

http://www.daniweb.com/forums/thread6028.html

http://support.microsoft.com/default.aspx?scid=KB;EN-US;q301240&ID=KB;EN-US;q301240

Hope this will help you.
Thanks & Regards
Dilipv

dilipv 0 Light Poster

I need help getting a variable from one page displayed onto another. I have two pages, mainmenu.aspx and secondmenu.aspx. mainmenu.aspx contains Textbox1 which contains some user-entered number in it. When the user clicks on Button1 on mainmenu.aspx, I need the table, Table1, on secondmenu.aspx to reflect that new selection.
Thanks for any help or ideas.

hi Dano56,
I think answer for your query is QueryString OR Session. But according to me prefer querystring so, i given following example as follows.
For ex. You want to go from Page1 on click event of button it redirects you at Page2 then pass query string along with Page2's URL. Suppoese your query string name is "qstr" then on click of button following steps should occur.

Button_click
{
Response.Redirect(Page2.aspx?qstr=id);
}

Then 1) on the load event of page2 check for query string
2) update your page base on querystring

To get the value of the query string on the page2 load event as follows

protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["qstr"] != null)
{
string qstr1 = Request.QueryString["qstr"].ToString (); // statement for accessing querystring from aspx.cs file
}
}

To get the value of the query string from any class as follows

System.Web.HttpContext.Current.Request.QueryString["id"].ToString ();  //statement for accessing querystring from any .cs file

Hope this will help you.
Thanks & Regards
Dilip Kumar Vishwakarma
Programmer.Net Consulting

dilipv 0 Light Poster

Hi

i m working with ASP.Net, C#

i need to have an example of trigger

how to call it from C#, and how to execute???

Hi u4umang2001,
Just check this link, which contains good article. Hope this will help you.

http://www.c-sharpcorner.com/UploadFile/pk_khuman/ManagedTrigersUsingCSharp02202007230729PM/ManagedTrigersUsingCSharp.aspx

Thanks & Regards
Dilip Kumar Vishwakarma
Programmer

dilipv 0 Light Poster

I have question about Temporary Web Page.
When I click on link in my web application and redirect to ( for example)
mywebsite.com/12.aspx.
When event OnLoad() fire,I read value 12, which is Primary key and make query to the database,get record and represent on web page.
But,I need temporary web page with a address mywebsite.com/mynumber.aspx.
or whatever,where I can read value of mynumber ,make query and represents data to web page.
Is there any idea how can I solve this problem.
Thanks in advance
David

Hi david_bronsky,
You are talking about Querystring OR URL Rewriting. Querystring is some information attached on the end of the URL after question mark sign. For ex
http://www.mydomain.com/productdetails.aspx?pid=12
Quesrystring is pid=12
You can access querystring as follows
int i=Request.QueryString["pid"].ToInt32();
After that you can easily make database connection and access appropriate data from it.

Hope this will help you.
Thanks & Regards
Dilip Kumar Vishwakarma
Programmer
.Net Consulting

dilipv 0 Light Poster

hi u4umang2001,

if(para1='' or para1= null) then
'update table1 set para2='''+@para2+''' and para3='''+@para3+''''
else
'update table1 set para1='''+@para1+''' and para2='''+@para2+''' and para3='''+@para3+''' '

Your query is little bit simple but you should try first using various article. These articles can be easily found using Google. If you want to learn things, you should try atleast once.
Following is solution for your query.

CREATE PROCEDURE sp_myStoredProcedure
   @para1   varchar(100),
   @para2   varchar(100),
   @para3   varchar(100)
AS
   if @para1 IS NULL
        update table1 set para2=@para2 and para3=@para3
   else
        update table1 set para1=@para1 And para2=@para2 And para3=@para3
Go

Hope this will help you. Don't rely on others, first try yourself if not possible then ask for solution.
Thanks & Regards
Dilip Kumar Vishwakarma
Programmer
.Net Consulting

dilipv 0 Light Poster

Hi psathish2,

cmdjds.ExecuteNonQuery();

First of all remove the above quote because it is used when there is no rows are returned, but you are using SELECT statement which returns some number of rows.

if (username.Text = "login1" && pass.Text = "pass2" && clientid.Text = "client1" )

Secondly your if condition is totally wrong. Because you collected rows information in to login1 and pass2 then you can directly compare it with any text, no need of Double quote. For ex: -
if(username.Text == login1 && pass.Text == pass2 && clientid.Text == client1)
Instead OF
if(username.Text = "login1" && pass.Text = "pass2" && clientid.Text = "client1")

OR you can use String1.Equals(String2) function to campare two strings.
So if condtion should be
if(username.Text.Equals(login1) && pass.Text.Equals(pass2) && clientid.Text.Equals(client1))


Hope this will help you. If problem persist feel free to ask again to me.
Thanks & Regards
Dilip Kumar Vishwakarma
Programmer
.Net Consulting

dilipv 0 Light Poster

Hi

i want to use "text" datatype to declare a variable in stored procedure.
how can i do this???

Hi u4umang2001,
Declaring a text variable in stored procedure is easy. Following example shows as below.

CREATE PROCEDURE sp_myStoredProcedure
   @myString varchar(100)
AS
.....
Go

For detail understanding visit the link.
http://databases.about.com/od/sqlserver/a/storedprocedure.htm
Hope this will help you. For further assistance feel free to ask with me.
Thanks & Regards
Dilip Kumar Vishwakarma
Programmer
.Net Consulting

dilipv 0 Light Poster

hi majestic0110,
There is ASP Login Control exists in VS 2005 OR VS 2008, but you still want to use traditional database technique to design login control. For this, i have one article which help's you a lot.
Just check this link, hope this will help you.

http://www.4guysfromrolla.com/webtech/100500-1.shtml

If problem persist then feel free to share with us.
Thanks & Regards
Dilip Kumar Vishwakarma
Programmer
.Net Consulting

dilipv 0 Light Poster

hi ebabes,
I think you needed website counter which simply tells number of times website has been visited rather than individual page visit counter. So, you have 2 alternatives to store Visit Count either in to Text File or in to database. I seen one article based on text file, just check the following link.

http://imar.spaanjaars.com/QuickDocID.aspx?QUICKDOC=227

http://www.daniweb.com/forums/thread6566.html

Hope this will help you. If problem persist then feel free to share with me.
Thanks & Regards
Dilip Kumar Vishwakarma
Programmer
.Net Consulting

dilipv 0 Light Poster

hi Slade,
According to me URL rewriting can help in solving your problem. Just check following URL

http://forums.asp.net/p/1217523/2165532.aspx

Hope this will help you.
If problem persist feel free to share with me.
Thanks & Regards
Dilip Kumar Vishwakarma
Programmer
.Net Consulting

dilipv 0 Light Poster

Thanks for replying my friend serkansendur, This umapathyperumal...
problem in creating menu bar in asp.net2003
What i am asking is? Inorder to create menubar in the web form of Asp.Net2003(Through by java script)
For Example: Menu Bar should be like this
File
New
Open
Save
What is the coding for this?

Hi umapathyperumal,
Few days ago i also wanted to develop menu for my website, during this i came across the dynamic menu which is generated from Database. Following is the link, please visit that link.

http://aspalliance.com/822

Hope this will help also you can customize according to your need.
Thanks & Regards
Dilip Kumar Vishwakarma
Programmer
.Net Consulting

dilipv 0 Light Poster

Thanks for replying my friend serkansendur, This umapathyperumal...
problem in creating menu bar in asp.net2003
What i am asking is? Inorder to create menubar in the web form of Asp.Net2003(Through by java script)
For Example: Menu Bar should be like this
File
New
Open
Save
What is the coding for this?

Hi umapathyperumal,
Few days ago i also wanted to develop menu for my website, during this i came across the dynamic menu which is generated from Database. Following is the link, please visit that link.

http://aspalliance.com/822

Hope this will help also you can customize according to your need.
Thanks & Regards
Dilip Kumar Vishwakarma
Programmer
.Net Consulting

dilipv 0 Light Poster

I'm usng ASP.Net 2005 (Web Developer). I am not aware that there are built in functions provided in the page. What are those functions and how can I make use of it?

Hi ebabes,
Datagrid has built-in functionality as DataBind() and property as DataSource. You need to set DataSet, ArrayList OR Any Collection as DataSource of DataGrid object. After that you can call DataBind() method of DataGrid object.
For ex: in c#, DataGrid_Object.DataSource=DataSet_Object;
DataGrid_Object.DataBind();


There are lots of articles are available on the internet, you can search through google.
Hope this will help you.
If problem persist then feel free to ask any number of questions.
Thanks & Regards
Dilip Kumar Vishwakarma
Programmer
.Net Consulting

dilipv 0 Light Poster

hi ansari.wajid,
You can easily remove selected items from DropDownList. On the click of Delete button you first take index of selected item and then pass it to the Remove function of DropDownList control.Use following code.

DropDownList_Object.Items.Remove(DropDownList_Object.SelectedIndex);

Hope this will help you. If you have any problem feel free to share with us.
Thanks & Regards
Dilip Kumar Vishwakarma
Programmer
.Net Consulting

dilipv 0 Light Poster

hi ebabes,


if you use the dropdownlist and add the number in to it, then there is no question of user making the mistake and so no need to prompt too..

Visual Basic code

Private flag As Boolean

Private Sub MyTextChangedHandler(sender As System.Object, e As System.EventArgs)
' Check the flag to prevent code re-entry.
If flag = False Then
' Set the flag to True to prevent re-entry of the code below.
flag = True
' Determine if the text of the control is a number.
If IsNumeric(textBox1.Text) = False Then
' Display a message box and clear the contents if not a number.
MessageBox.Show("The text is not a valid number. Please re-enter")
' Clear the contents of the text box to allow re-entry.
textBox1.Clear()
End If
' Reset the flag so other TextChanged events are processed correctly.
flag = False
End If
End Sub

Hope this will help you out.

Thank you
Jitesh
.Net Consulting

dilipv 0 Light Poster

<script language="javascript" type="text/javascript">
function confirm()
{
if (confirm ==true)

else

return false;

}
</script>
then write in .aspx.cs
ButtonSave.Attributes.Add("onclick", "return confirm('Are you sure you proceed?');");

hope this code will help you out.

Thank tou
Jitesh
.Net Consulting

dilipv 0 Light Poster

hey some one help me out in calculation O(n)

int koodle (int n)
{
  int  j,k:int x;
  if(n%2==0)
    for(j=0;j<n;j++)
      x+=rand()%2;
  else
    for(k=0;k<n;k++)
      x+=rand()%2;
  return x;
}

I need to obtain the time complexity of the above matrix transpose algorithm using program step count method.

Thanks for any help I can get on this.

hi there,

here's a couple links based on obtaining Time Complexity algorithm
http://www.cs.uiowa.edu/~jier/cs3/2003-11-11_discussion.pdf
http://www.cs.wisc.edu/~hasti/cs367-common/notes/COMPLEXITY.html

hope this will solve your query.
Thank you
Jitesh
.Net Consulting

dilipv 0 Light Poster

Hello.. i need some help.. WHich lang to use for my proj on Online recruitment system.. And how 2 start.. I haven't studied asp,vbscript.. what shd i do.. i m really worried. plz help.

hi there,
Don't worry friend.I think that ASP.net using C# language will be the suitable as well as convenient because you are developing a web based application online recruitment.
and you could learn it from http://www.w3schools.com/aspnet/aspnet_intro.asp

Hope This will help you out.

Thank you
Jitesh
.Net Consulting

dilipv 0 Light Poster

how can i display a table using user control

You have to create a user control and you can create table in it save the user control. and then from the toolbar you can directly drag and drop the user control on your web form or windows form.

hope this will help you out.

Thank you
Jitesh
.Net Consulting

dilipv 0 Light Poster

hi there,

i can suggest you to follow the following links this will help you out.You will get many automated testing tolls for your appllication
http://www.acutest.co.uk/acutest/automated-testing-tools

Thank you
Jitesh
.Net Consulting