help to create a hyperlink

mja1356 27 May, 2008
Hi
I have to do a project until tomorrow and I need your help.
I want to create a soccer betting site.
I created a form that an author user can put info about betting in each day and this data save in database.it is work normally.chan vay cong so, ao so mi cong so, vay cong so, quan ao, quan ao tre em, quan lot nu, do lot sexy, xe day cho be, do so sinh cho be, ban buon quan ao, do lot[/url]
now i want to query database by today date and this query must be select league name in today date and show them in front end (probably in another form) as a hyperlink. this hyper link must be connected to a query that select data in corresponding league and date and show them in a html table.
it's normal in every site betting and you can see an ex in http://www.pinnaclesports.com/ and http://www.pinnaclesports.com/League/Soccer/Copa+Liber~2E~/7/Lines.aspx

HOW can i do that.
PLZ:(😟😟😟 :blink:
GreyHead 27 May, 2008
Hi mja136,

What have you got so far? You need some SQL to select the records by data and then it's simple to create a hyperlink / or a form button from each record. The hyperlink needs to include the league and date.

Then you just repeat the same process with the second form.

Bob
mja1356 27 May, 2008
Hi
Thank you for your reply.
I created hyperlink . how can i connect this hyperlink to a query.
do i insert address of query in href"".if yes what's the query address?
GreyHead 27 May, 2008
Hi mja1356,

You need to have the url go to a new ChronoForms form, then in the Form HTML you can access the variables from the URL using $_GET['variable_name'] (or JRequest in Joomla 1.5). Build the new query and get the resultes, then use these in the Form HTML.

Bob
mja1356 27 May, 2008
Hi
I don't understand what do you mean.can you please describe it in more detail.
Let me tell you what i did.
for showing hyperlink data in front end I make a new form and add this code to it.
<html>
<body>
<div align = "center">
<table border = "1"  >
<tr>
  <th>league</th>
  
</tr>
<?php
 $db = mysql_connect("localhost", "parsibet", "123456");
   if(!$db)
   {
       echo 'Error : Cannot connect to MySQL server.';
       exit;
    }
    mysql_select_db('parsdera_parsibet');
   $query = "select distinct category.label from jos_chronoforms_4";
   $result = mysql_query($query);
   if(!$result)
   {
      echo "Query not executed.";
      exit;
    }
    $num = mysql_num_rows($result);
    for($i = 0; $i < $num; $i ++)
    {
        $row = mysql_fetch_row($result);
        echo '<tr>';
        echo "<td><b><a href=''> $row[0]</a></b> </td>";
        echo '</tr>';
    } 
    mysql_close();
?>
</table>
</div>
</body>
</html>
this code list all league as a hyperlink.
now I want to connect this by a query that search database according to it's name and show the result.
for example if hyperlink will be uefa champions league after clicking it it must be return result that league (category) name is "UEFA CH L"
thanks.
mja1356 27 May, 2008
I also created a form that run my desired query .
now i have three form.first to enter data second to run a query and third a form that show my desired field as a hyperlink in frontend.
I'm so confused now and don't know how to use $_get to connect each hyperlink to it's query table.
mja1356 28 May, 2008
Hi Bob

I'm sorry for post several time.But I need some help.
plz:(
mja1356 28 May, 2008
Bob
PLZ write somthing here that I'll know what can i do?
is it solution for this problem?if no i'll go somwhere else.
GreyHead 28 May, 2008
Hi mja1356,

I can't tell from this what you have in the link. The core output is
<a href=''> $row[0]</a>
What value is in $row[0]? - is this where 'uefa champions league' appears.

In that case you need your hyperlink to look like
<a href='http://www.domain.name/index.php?option=com_chronocontact&formname=xxx&leagueid=999'> $row[0]</a>
Bob
mja1356 28 May, 2008
thank you for your reply.
there is a problem.I can't understand url well.I put my own data in that url as below.
<a href='index.php?option=com_chronocontact&formname=query_table&leagueid=999'>
I work in local and delete site name!!!
query_table is a form that query database as my desire.
after i put this code and click on link at frontend this message appear:
There is no form with this name, Please check the url and the form management
I don't understand but this form exist.
another question is can i put a variable instead of leagueid?
therre is several league that i list them in select list.should i assign an id to each of them and create a variable to call them?
GreyHead 28 May, 2008
Hi mja1356,

I can't tell why you are getting the 'No form' error without looking at the site.

You can add anything to the url in the form &variable_name=value

Bob
mja1356 28 May, 2008
Hi again
can you please direct me to a source that i can understand url and it's details.
and can you post one url that redirect to a form.
thanks
mja1356 28 May, 2008
Hi Bob
you must be angry:angry: becouse of my posts.
I can't solve the my problem with form url.I created a form already with this url:
index.php?option=com_chronocontact&chronoformname=view_line
and if i use this address as a href address , the link redirect me to view_line form ok.
now you wrote that i must use this url to access the form as my desire:
<a href='http://www.domain.name/index.php?option=com_chronocontact&chronoformname=xxx&leagueid=999'> $row[0]</a>

league field store in database via a select list.
ex
<select name=league>
<option value=1>bundesliga</option>
<option value=2>uefa champions league</option>
.
.
.
</select>
now my question is what is leagueid?
is it value in option tag?

when i form name and league id as describe above, by clicking the link all leagues info's been shown.
GreyHead 28 May, 2008
Hi mja1356,

The kind of code that you want is like this:
<select name='leagueid'> 
<option value='1'>bundesliga</option> 
<option value='2'>uefa champions league</option> 
. . . 
</select>
and in the 'OnSubmit after' bux you can create your url
$url = "http://www.domain.name/index.php?option=com_chronocontact&chronoformname=xxx&leagueid=<?php echo $_POST['leagueid']; ?>";
Then you can do something with $url.

Bob

PS No, I'm not angry but I'm really not sure what you are trying to do here - or what it has to do with ChronoForms (except that's where you are putting the code). I think that you are trying something that is quite difficult with your current knowledge and experience. There are plenty of good tutorials out there at places like w3schools.
mja1356 28 May, 2008
Hi
I'll try it.
maybe you're right.I want to do something bigger than my ability but I'll try to learn something new everyday.
maybe I have to return to basic html and php training that I study them without concentration.
thank you
GreyHead 29 May, 2008
Hi mja1356,

Trying new stuff is good - but I don't have time to help you through every small step. Start out with a simpler project and build up. Look at code form here and other sites and work out how it works. Joomla itself is a great place to find useful code (though 1.5 is more difficult to understnd than 1.0)

Bob
This topic is locked and no more replies can be posted.