473,766 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

variable from URL $_GET

I have a problem which must be in this :

print" <script type='text/javascript'>
document.locati on.replace('htt p://127.0.0.1/add_task.php?re q_id={$maxValue }&tk_request_na me={$req_name}' );
</script>";

or maybe here, in file2

<?php
$tk_req_id = $_GET['req_id'];
//$tk_req_id = 1;
?>

<?php
$tK_req_name = $_GET['tk_request_nam e'];
?>

I have to tell you that at some point it worked, but I did not do anything
different since then...

when I get in add_task.php the "insert" does not work. I get this message :

Add Task
tasque 2 = task name
05.04.2006 = start date
05.04.2006 = end date
2 = id_fulfiller
1000 = task duration
Resource id #4
insert into tasks ( task_request_id , task_fulfiller_ id, task_start_date ,
task_end_date, task_name, task_duration) values (, 2,
to_date('05.04. 2006','DD.MM.YY YY'),
to_date('05.04. 2006','DD.MM.YY YY'),'tasque 2',1000)

I can see that I miss "task_request_i d"...

I really have no idea what's wrong with that. Can you tell please?
Thanks for looking.
file1__________ _______________ _______________ ______

<html>

<head>
<link href="../withStyle.css" rel="stylesheet " type="text/css">

<title>Reportin g System Demand Management</title>

<script language="JavaS cript" src="javascript/overlib_mini.js "></script>

<?php
include ("javascript/function_calend ar.js");
?>

</head>

<body>
<?php

// variable name of submit button in request form

$addrequest = $_POST['addrequest'];

print "$addreques t <BR>";// for testing
//test if something is submited in the form if this is the case then insert
data in DB

if ($addrequest!=' ') {

$req_name = $_POST['request_name'];

$req_date = $_POST['request_date'];

$req_client_id = $_POST['request_client _name'];

$req_req_type_i d = $_POST['request_type'];

$req_brand_id = $_POST['request_brand_ name'];
if ($req_brand_id= ='Brand Name') $req_brand_id=' NULL';

$req_exp_date = $_POST['request_expect ed_date'];

$req_comment = $_POST['request_commen t'];

$c1=oci_connect ("stephane","St ef1975",$bdtest 05);

$query="insert into requests (
request_name, request_date, request_client_ id, request_request _type_id,
request_brand_i d, request_wished_ delivery_date, request_comment )
values
('$req_name',to _date('$req_dat e','DD.MM.YYYY' ),$req_client_i d,$req_req_type _id,
$req_brand_id,t o_date('$req_ex p_date','DD.MM. YYYY'),'$req_co mment')";

$stmt=oci_parse ($c1,$query);

Print "$stmt <BR>"; // for testing
Print "$query <BR>";

If (oci_execute($s tmt)){

// fermer les connections et libérer les variables avant de partir de
cette page
oci_free_statem ent($stmt);

print "add_task.php?r equest_name=$re q_name";// test

$query="select seq_request_id. currval from dual";
//select max(request_id) from requests;

$stmt=oci_parse ($c1,$query);

oci_execute($st mt);

oci_fetch($stmt );
$maxValue= oci_result($stm t,1);
oci_free_statem ent($stmt);
print" <script type='text/javascript'>
document.locati on.replace('htt p://127.0.0.1/add_task.php?re q_id={$maxValue }&tk_request_na me={$req_name}' );
</script>";

exit;
}
else{
print "insert on Tasks failed";

}
}

?>
<center><h1>A dd Request</h1></p></center>
<hr>

<p align="center">
&nbsp;

<form method="POST" name="requestfo rm" action="add_req uest.php">
<table border="1" width="50%">
<tr>
<td align="left" width="50%" height="25">
<p align="left">Re quest Name</p>
</td>
<td align="left" width="50%" height="25" colspan="2">
<p align="left"><i nput type="text" size="40"
name="request_n ame">&nbsp<b>* </b>&nbsp</p>
</td>
</tr>
<tr>
<td align="left" width="50%" height="25">
<p align="left">Re quest Date</p>
</td>
<td align="left" width="50%" height="25" colspan="2">
<p align="left"><i nput type="text" size="20"
name="request_d ate">&nbsp<b>* </b>&nbsp;&nbsp;
<a
href="javascrip t:show_calendar ('requestform.r equest_date',nu ll,null,'DD.MM. YYYY');"
onMouseOver="wi ndow.status='Da te Picker'; overlib('Click here to choose a
date from a one month pop-up calendar.'); return true;"
onMouseOut="win dow.status=''; nd(); return true;"><img
src="show-calendar.gif" width=24 height=22 border=0></a></p>
</td>
</tr>
<tr>
<td align="left" width="50%" height="25">
<p align="left">Cl ient Name</p>
</td>
<td align="left" width="50%" height="25" colspan="2">
<p align="left">
<select name="request_c lient_name" size="1">
<option>Clien t Name</option>
<?php

//connection to database

$c1=oci_connect ("stephane","St ef1975",$bdtest 05);

$query="select client_id, client_firstnam e||' '||client_lastn ame as
client_fullname from clients";

$stmt=oci_parse ($c1,$query);

oci_execute($st mt);

while ($row = oci_fetch_array ($stmt,OCI_NUM) )
{
echo"<option value=$row[0]>$row[1]</option>";
}

oci_free_statem ent($stmt);
?>

</select>&nbsp<b> *</b></p>
</td>
</tr>
<tr>
<td align="left" width="50%" height="25">
<p align="left">Re quest Type</p>
</td>
<td align="left" width="50%" height="25" colspan="2">
<p align="left">
<select name="request_t ype" size="1">
<option>Reque st Type</option>

<?php

$query="select request_type_id , request_type_na me from request_types";

$stmt=oci_parse ($c1,$query);

oci_execute($st mt);

while ($row = oci_fetch_array ($stmt,OCI_NUM) )
{
echo"<option value=$row[0]>$row[1]</option>";
}

oci_free_statem ent($stmt);

?>

</select>&nbsp<b> *</b>
</p>
</td>
</tr>
<tr>
<td align="left" width="50%" height="25">
<p align="left">Br and Name</p>
</td>
<td align="left" width="50%" height="25" colspan="2">
<p align="left">
<select name="request_b rand_name" size="1">
<option>Brand Name</option>

<?php

$query="select brand_id, brand_name from brands";

$stmt=oci_parse ($c1,$query);

oci_execute($st mt);

while ($row = oci_fetch_array ($stmt,OCI_NUM) )
{
echo"<option value=$row[0]>$row[1]</option>";
}

oci_free_statem ent($stmt);

//close connection to database

oci_close($c1);
?>

</select>
</p>
</td>
</tr>
<tr>
<td align="left" width="50%" height="25">
<p align="left">Ex pected Delivery Date</p>
</td>
<td align="left" width="50%" height="25" colspan="2">
<p align="left"><i nput type="text" size="20"
name="request_e xpected_date">& nbsp<b>*</b>&nbsp;&nbsp;
<a
href="javascrip t:show_calendar ('requestform.r equest_expected _date',null,nul l,'DD.MM.YYYY') ;"
onMouseOver="wi ndow.status='Da te Picker'; overlib('Click here to choose a
date from a full year pop-up calendar.'); return true;"
onMouseOut="win dow.status=''; nd(); return true;"><img
src="show-calendar.gif" width=24 height=22 border=0></a></p>
</td>
</tr>
<tr>
<td align="left" width="50%" height="25">
<p align="left">Co mment on Request</p>
</td>
<td align="left" width="50%" height="25" colspan="2"><te xtarea
name="request_c omment" cols="30" rows="4"></textarea><p>
</td>
</tr>
<tr>
<td align="left" width="50%" height="25">
<p align="left"></td>
<td align="left" width="25%" height="25">
<p align="left"><i nput type="submit" name="addreques t" value="add
request">
</p>
</td>
<td align="left" width="25%" height="25">
<input type="reset" name="resetButt on" value="Reset">
</td>
</tr>
</table>
</form>
<p align="left"></p>
<hr>

<div id="overDiv" style="position :absolute; visibility:hidd en;
z-index:1000;"></div>
<p align="center"> <a href="index.htm ">[Home]</a></p>
</form>
</body>

</html>

file2__________ _______________ _______________ _______________ ____

<html>
<head>

<link href="../withStyle.css" rel="stylesheet " type="text/css">

<title>Reportin g System Demand Management</title>

<script language="JavaS cript" src="javascript/overlib_mini.js "></script>

<?php
include ("javascript/function_calend ar.js");
?>

</head>
<body>

<?php
$tk_req_id = $_GET['req_id'];
//$tk_req_id = 1;
?>

<?php
$tK_req_name = $_GET['tk_request_nam e'];
?>

<?php print "$tK_req_na me"; ?>

<?php print "$tk_req_id "; ?>
<?php

// variable name of submit button of request form

$addtask = $_POST['addtask'];
print "$addtask <BR>"; // for testing


//test if something is submited in the form if this is the case then insert
data in DB

if ($addtask!='') {

$tk_name = $_POST['task_name'];
print "$tk_name = task name <br>";

$tk_start_date = $_POST['task_start_dat e'];
print "$tk_start_ date = start date <br>";

$tk_end_date = $_POST['task_end_date'];
print "$tk_end_da te = end date <br>";

$tk_fulfil_id = $_POST['task_fulfiller _name'];
print "$tk_fulfil _id = id_fulfiller <br>";

$tk_duration = $_POST['task_duration'];
print "$tk_durati on = task duration <br>";

$c1=oci_connect ("stephane","St ef1975",$bdtest 05);

// if ($req_brand_id= ='Brand Name') $req_brand_id=' NULL';


// $tk_request_id = ?????request to do

$query="insert into tasks (
task_request_id , task_fulfiller_ id, task_start_date ,
task_end_date, task_name, task_duration)
values ($tk_req_id, $tk_fulfil_id, to_date('$tk_st art_date','DD.M M.YYYY'),
to_date('$tk_en d_date','DD.MM. YYYY'),'$tk_nam e',$tk_duration )";

$stmt=oci_parse ($c1,$query);

Print "$stmt <BR>";
Print "$query <BR>";

If(oci_execute( $stmt)){

// fermer les connections et libérer les variables avant de partir de
cette page

oci_free_statem ent($stmt);

print" <script type='text/javascript'>
document.locati on.replace('htt p://127.0.0.1/add_task.php?tk _request_name={ $tk_req_name}&r eq_id={$tk_req_ id}');
</script>";

};
// gestion du else: erreur dans l'insertion en BD

}

else
{

// $tk_request_id = ????

$tk_name = $_POST['task_name'];

}
?>

<center><h1>A dd Task</h1></p></center>
<hr>

<p align="center">
<form name="taskform" method="POST" action="add_tas k.php">
<table border="1" width="45%">
<tr>
<td align="left" width="50%" height="25">Req uest name
</td>
<td align="left" width="50%" height="25" colspan="2">
&nbsp;<?php print "$tK_req_na me"; ?>

</td>
</tr>
<tr>
<td align="left" width="50%" height="25">
<p align="left">Ta sk Name</p>
</td>
<td align="left" width="50%" height="25" colspan="2">
<p align="left"><i nput type="text" size="35"
name="task_name ">&nbsp;<b> *</b></p>
</td>
</tr>
<tr>
<td align="left" width="50%" height="25">
<p align="left">Ta sk Start Date</p>
</td>
<td align="left" width="50%" height="25" colspan="2">
<p align="left"><i nput type="text" size="12"
name="task_star t_date">&nbsp;& nbsp;
<a
href="javascrip t:show_calendar ('taskform.task _start_date',nu ll,null,'DD.MM. YYYY');"
onMouseOver="wi ndow.status='Da te Picker'; overlib('Click here to choose a
date from a one month pop-up calendar.'); return true;"
onMouseOut="win dow.status=''; nd(); return true;"><img
src="show-calendar.gif" width=24 height=22 border=0></a>
</p>
</td>
</tr>
<tr>
<td align="left" width="50%" height="25">
<p align="left">Ta sk End Date</p>
</td>
<td align="left" width="50%" height="25" colspan="2">
<p align="left"><i nput type="text" size="12"
name="task_end_ date">&nbsp;&nb sp;
<a
href="javascrip t:show_calendar ('taskform.task _end_date',null ,null,'DD.MM.YY YY');"
onMouseOver="wi ndow.status='Da te Picker'; overlib('Click here to choose a
date from a one month pop-up calendar.'); return true;"
onMouseOut="win dow.status=''; nd(); return true;"><img
src="show-calendar.gif" width=24 height=22 border=0></a>
</p>
</td>
</tr>
<tr>
<td align="left" width="50%" height="25">
<p align="left">Fu lfiller Name</p>
</td>
<td align="left" width="50%" height="25" colspan="2">
<p align="left">
<select name="task_fulf iller_name" size="1">
<option selected>Fulfil ler Name</option>

<?php

//connection to database

$c1=oci_connect ("stephane","St ef1975",$bdtest 05);

$query="select fulfiller_id, fulfiller_first name||' '||fulfiller_la stname as
fulfiller_fulln ame from fulfillers";

$stmt=oci_parse ($c1,$query);

oci_execute($st mt);

while ($row = oci_fetch_array ($stmt,OCI_NUM) )
{
echo"<option value=$row[0]>$row[1]</option>";
}

oci_free_statem ent($stmt);

?>

</select></p>
</td>
</tr>
<tr>
<td align="left" width="50%" height="25">
Task duration</td>
<td align="left" width="50%" height="25" colspan="2">
<input type="text" size="8" name="task_dura tion"> minutes
</td>
</tr>
<tr>
<td align="left" width="50%" height="25">
<p align="left"></td>
<td align="left" width="24%" height="25">
<p align="left"><i nput type="submit" name="addtask" value="Add
Task">

</p>
</td>
<td align="left" width="26%" height="25">
<input type="reset" name="resetButt on" value="Reset">
</td>
</tr>
</table>
</form>
<h2>Tasks List of above request</h2>

<?php

$query="select c.task_id
,a.fulfiller_fi rstname||' '||a.fulfiller_ lastname as fullname
,b.request_type _name
,c.task_name
,c.task_start_d ate
,c.task_end_dat e
,e.client_first name||' '||e.client_las tname as clientname
from fulfillers a
,request_types b
,tasks c
,requests d
,clients e
where c.task_fulfille r_id = a.fulfiller_id
and c.task_request_ id = d.request_id
and d.request_reque st_type_id = b.request_type_ id
and d.request_clien t_id = e.client_id
and c.task_end_date is NULL";// à ne pas mettre
// and d.request_id = $tk_req_id"; // à mettre

$stmt=oci_parse ($c1,$query);

oci_execute($st mt);

$nbcolumns = oci_num_fields ($stmt);

?>

<p align="center">

<table border="1" width="100%">
<tr>
<th width="10%">Tas k Number</td>
<th width="15%">Ful filler Name</td>
<th width="15%">Req uest Type</td>
<th width="25%">Tas k Name</td>
<th width="10%">Sta rt Date</td>
<th width="10%">End Date</td>
<th width="15%">Cli ent Name</td>
</tr>

<?php
while ($row = oci_fetch_array ($stmt,OCI_NUM) )
{
$it=it+1;

echo "<tr>";
echo "<td>$row[0]</td>";
echo "<td>$row[1]</td>";
echo "<td>$row[2]</td>";
echo "<td>$row[3]</td>";
echo "<td>$row[4]</td>";
echo "<td>$row[5]</td>";
echo "<td>$row[6]</td>";
echo "</tr>";
}

oci_free_statem ent($stmt);
oci_close($c1);

?>

</table>

<?php

// if the Query doesn't return a result, it showes this message
if($it==0)
{
print"&nbsp;";
print"<pre>ther e is no task related to this request</pre>";
print"&nbsp;";
}

?>

<p align="left">&n bsp;</p>
<hr>

<!-- this line is required for the calendar function -->
<div id="overDiv" style="position :absolute; visibility:hidd en;
z-index:1000;"></div>

<p align="center"> <a href="index.htm ">[Home]</a>&nbsp;&nbsp; <a
href="reporting .htm">[Reporting]</a>&nbsp;&nbsp;& nbsp;
<a href="add_reque st.php">[Add Request]</a></p>

</body>
</html>
Apr 5 '06 #1
1 5679
Lee wrote:

You seem to be asking for help with PHP in a Javascript newsgroup.


What's the difference? ;)
Apr 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3535
by: Hans | last post by:
Hi There, I have a page that has links with some variables and I need to open the results set in a frameset. I have tried doing this in various different ways, but still cannot get the variable passed to the relevant frames within the frameset. What is the best way of getting this done. Thanks Hans
4
1687
by: Lost arcade | last post by:
I am using PHP 4.3.4 and found something strange with a variable name. When I try to use "$company" variable (lowercase), I get odd behavior from that variable. The name of my php file is "company.php" but I didn't think that php associated them together. The behavior is that "$company" will take on values of the previously accessed $_GET variable. I fixed it by using "$company_info" variable instead but I would really like to know why...
1
1137
by: Steven Bethard | last post by:
I'd like to be able to have an instance variable that can sometimes be accessed as a property, and sometimes as a regular value, e.g. something like: py> class C(object): .... def usevalue(self, x): .... self.x = x .... def usefunc(self, func, *args, **kwds): .... self._func, self._args, self._kwds = func, args, kwds .... self.x = C._x
3
5724
by: mbasil7 | last post by:
Hi at all! I want to use a javascript variable in php. The reason is that i want to know the client's screen resolution. Keep in mind that i am not a javascript programmer but php. Here is the code i'm using: <head> <script language='JavaScript'>
5
5378
by: Chuck Anderson | last post by:
I have finally started coding with register_globals off (crowd roars - yeay!). This has created a situation that I am not sure how I should handle. I have scripts (pages) that can receive an input variable from the POST array (initial entry) or it could be in the GET array (go back and re-edit a form, for instance.) In my old sloppy scripting days this was no problem, as I had register_globals on and would merely access the the input...
3
1606
by: stephane | last post by:
I have a file.php in which a created dynamic hypertext links and send a variable $row echo "<td><a href='modify_request.php?$row'>$row</a></td>"; I can see in the url on modify_request.php the variable value. But I can't get it in another variable in modify_request.php here is a simple example of what I am trying to do with file1
1
1774
by: gogelpot | last post by:
Why is it that every time I run this code in a session that it does not add my new values to the session variable but it replaces the old value with the new. Here is the Code: <?php session_start(); ############## # Link to DB # ############## require_once('DB_connect.php');
2
3141
by: keeps21 | last post by:
I have a script that recieves an id number via the address bar when a link is clicked. ie . index.php?id=1 if the link was for the story whose ID is 1. My script checks if a user is logged in, if not they are redirected to the login page. If logged in they may edit the story. I assign $_GET to $id.
3
1845
by: leonardodiserpierodavinci | last post by:
Hi. Sorry for what is perhaps a neophyte question: is it possible to pass a variable to a PHP script from inside another PHP piece of code? For instance, the file test.php (which of course resides on a webserver that supports PHP) is as such: <?php echo("<i>the variable abc contains " . $_GET . "</i>"); ?>
0
10168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10008
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8833
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7381
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6651
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
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 we have to send another system
2
3532
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.