473,511 Members | 16,888 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with php passing variable

114 New Member
Dear Friends,

I have a table which has four rows at one column and on other column it has one cell colspan with 4.

I have some hyperlinks in each row on left side and I want that by clicking on every link different data should be print on right column.

But I have failed to do it. Please tell me what shoud I do...

Here is the code..............



[PHP]<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="50%" style="padding: 10"><a href="file.php?add=category">Add
category</a></td>
<td width="50%" style="padding: 10" rowspan="4" valign="top">

<?

if ($add == "category")
{
echo "You can add category here";
}
else if($add == "subcat")
{
echo "You can add sub category here";
}
else if($add == "city")
{
echo "You can add City here";
}
else if($add == "country")
{
echo "You can add country here";
}



?>

&nbsp;</td>
</tr>
<tr>
<td width="50%" style="padding: 10"><a href="file.php?add=subcat">Add
sub-category</a></td>
</tr>
<tr>
<td width="50%" style="padding: 10"><a href="file.php?add=city">Add City</a></td>
</tr>
<tr>
<td width="50%" style="padding: 10"><a href="file.php?add=country">Add
Country</a></td>
</tr>
</table>[/PHP]


I know my way of doing this is totally wrong...Please tell me the better way to do this.

Your advice/help on this will be really appreciated.............

Thanks
Deepak
May 3 '07 #1
4 2619
ak1dnar
1,584 Recognized Expert Top Contributor
This coding is working perfectly. do you need to do more apart from printing this dynamic values for the click of hyper links.
May 3 '07 #2
deepaks85
114 New Member
I have also tried this scripting but it's not working for me. When I click on the hyperlinks only the url gets changed. I want to print the value also on the right hand side but it's not getting printed right now. What should I do?

Please help...............

Thanks
Deepak


This coding is working perfectly. do you need to do more apart from printing this dynamic values for the click of hyper links.
May 3 '07 #3
ak1dnar
1,584 Recognized Expert Top Contributor
I have also tried this scripting but it's not working for me. When I click on the hyperlinks only the url gets changed. I want to print the value also on the right hand side but it's not getting printed right now. What should I do?

Please help...............

Thanks
Deepak
This coding is working perfectly in my end. for a example if u click Add City link You can add City here will print in right hand side.
May 4 '07 #4
rohitsavalia
8 New Member
Just replace this code in your body tag and save that file as file.php

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="50%" style="padding: 10"><a href="file.php?add=category">Add
category</a></td>
<td width="50%" style="padding: 10" rowspan="4" valign="top">

<?
$add = $_GET["add"];
if ($add == "category")
{
echo "You can add category here";
}
else if($add == "subcat")
{
echo "You can add sub category here";
}
else if($add == "city")
{
echo "You can add City here";
}
else if($add == "country")
{
echo "You can add country here";
}



?>

&nbsp;</td>
</tr>
<tr>
<td width="50%" style="padding: 10"><a href="file.php?add=subcat">Add
sub-category</a></td>
</tr>
<tr>
<td width="50%" style="padding: 10"><a href="file.php?add=city">Add City</a></td>
</tr>
<tr>
<td width="50%" style="padding: 10"><a href="file.php?add=country">Add
Country</a></td>
</tr>
</table>
May 4 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

58
10049
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
6
1401
by: Olaf Martens | last post by:
Greetings! Please consider the following piece of program code (note that I have stripped quite a lot of code here): int foo(void) { unsigned short l_valbuf; // address of this goes to...
6
3242
by: Scott Zabolotzky | last post by:
I'm trying to pass a custom object back and forth between forms. This custom object is pulled into the app using an external reference to an assembly DLL that was given to me by a co-worker. A...
11
8095
by: John Pass | last post by:
Hi, In the attached example, I do understand that the references are not changed if an array is passed by Val. What I do not understand is the result of line 99 (If one can find this by line...
6
5979
by: MSDNAndi | last post by:
Hi, I get the following warning: "Possibly incorrect assignment to local 'oLockObject' which is the argument to a using or lock statement. The Dispose call or unlocking will happen on the...
12
3000
by: scottt | last post by:
hi, I am having a little problem passing in reference of my calling class (in my ..exe)into a DLL. Both programs are C# and what I am trying to do is pass a reference to my one class into a DLL...
12
2662
by: Andrew Bullock | last post by:
Hi, I have two classes, A and B, B takes an A as an argument in its constructor: A a1 = new A(); B b = new B(a1);
3
1969
by: James Robertson | last post by:
I am new to the ASP and VB thing so be kind. Question I have is that I have created an ASPX web site to use as an E-Mail page. But I want to use this for a lot of users. Can I create the link on...
3
2387
by: DaTurk | last post by:
If I call this method, and pass it a byte by ref, and initialize another byte array, set the original equal to it, and then null the reference, why is the original byte array not null as well? I...
11
3333
by: venkatagmail | last post by:
I have problem understanding pass by value and pass by reference and want to how how they are or appear in the memory: I had to get my basics right again. I create an array and try all possible...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5668
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5066
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3225
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3213
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1576
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.