Re: unpack a string
On Sep 9, 7:54 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
I tried print_r I got a parse error on that line:
Parse error: syntax error, unexpected T_VARIABLE in /home/allrail/
public_html/idle_cars.php on line 101
Does that mean it is working because there is soemthing in the string?
here is that section of code:
}else{
$s1 = isset($_GET['order_by']) ? $_GET['order_by'] : '';
print_r $s1 ;
#$data.=makexcl ();
}
include "footer.php ";
I don't think I have a typo in it., tnx,
Janis
On Sep 9, 7:54 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
JRough wrote:
>
>
>
>
None of this is in the browser - it all occurs on the server. And if
you are clicking on the link as you indicate, it will be in the $_GET array.
>
Try print_r($_GET); to see what you get.
>
On Sep 9, 2:12 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
JRough wrote:
>I have used this function to create a string called $headers:
>function GetHeaders($fil e_name){
> return "<th><a href='".$file_n ame."&order_by= l_e'>L_E</a></th>
> <th><a href='".$file_n ame."&order_by= carnumber'>Carn umber</a></th>
> <th><a href='".$file_n ame."&order_by= location'>Locat ion</a></th>
> <th><a href='".$file_n ame."&order_by= sighting_date_a sc'>Sighting
>Date</a></th>
> <th><a href='".$file_n ame."&order_by= classification' >Code</a></th>
> <th><a href='".$file_n ame."&order_by= railroad'>RR</a></th>
> <th><a href='".$file_n ame."order_by=o rigin'>Origin</a></th>
> <th><a href='".$file_n ame."&order_by= destination'>De stination</a></
>th>
> <th width='15%'><a href='".$file_n ame."'>ETA</a></th>";
>}
>Now I want to unpack the $header array and create two strings,
>called s1 and s2. I want s1 to be field names for excel and s2 to
>be the column names. For example l_e is the field name and L_E is
>capitalized to be the column header in Excel. In other words, I want
>is the two fields after the order_by= without the 'and the </a>.
>How to use unpack?
>s1=unpack($hea ders/37, 9, $data)
>I don't know how to use unpack but I have the $header array as the
>string, I counted 37 characters to the word order_by and the word
>order_by= is 9 characters I want to grab that word before the '.
>How do I make use of the unpack function to get what I want?
>tia,
What's wrong with
>I have used this function to create a string called $headers:
>function GetHeaders($fil e_name){
> return "<th><a href='".$file_n ame."&order_by= l_e'>L_E</a></th>
> <th><a href='".$file_n ame."&order_by= carnumber'>Carn umber</a></th>
> <th><a href='".$file_n ame."&order_by= location'>Locat ion</a></th>
> <th><a href='".$file_n ame."&order_by= sighting_date_a sc'>Sighting
>Date</a></th>
> <th><a href='".$file_n ame."&order_by= classification' >Code</a></th>
> <th><a href='".$file_n ame."&order_by= railroad'>RR</a></th>
> <th><a href='".$file_n ame."order_by=o rigin'>Origin</a></th>
> <th><a href='".$file_n ame."&order_by= destination'>De stination</a></
>th>
> <th width='15%'><a href='".$file_n ame."'>ETA</a></th>";
>}
>Now I want to unpack the $header array and create two strings,
>called s1 and s2. I want s1 to be field names for excel and s2 to
>be the column names. For example l_e is the field name and L_E is
>capitalized to be the column header in Excel. In other words, I want
>is the two fields after the order_by= without the 'and the </a>.
>How to use unpack?
>s1=unpack($hea ders/37, 9, $data)
>I don't know how to use unpack but I have the $header array as the
>string, I counted 37 characters to the word order_by and the word
>order_by= is 9 characters I want to grab that word before the '.
>How do I make use of the unpack function to get what I want?
>tia,
What's wrong with
$s1 = isset($_GET['order_by']) ? $_GET['order_by'] : '';
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ===
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ===
I do wonder why it doesn't work? If the user clicks an anchor then it
sorts the rows. You would think the $_GET would pick it up
in the url but I suspect the answer to that is the list only prints
in the browser but when you hit the else in the code then
you aren't in the browser anymore you are formatting the query list
for output to excel. Maybe that is the answer.
thanks,
sorts the rows. You would think the $_GET would pick it up
in the url but I suspect the answer to that is the list only prints
in the browser but when you hit the else in the code then
you aren't in the browser anymore you are formatting the query list
for output to excel. Maybe that is the answer.
thanks,
None of this is in the browser - it all occurs on the server. And if
you are clicking on the link as you indicate, it will be in the $_GET array.
>
Try print_r($_GET); to see what you get.
>
Parse error: syntax error, unexpected T_VARIABLE in /home/allrail/
public_html/idle_cars.php on line 101
Does that mean it is working because there is soemthing in the string?
here is that section of code:
}else{
$s1 = isset($_GET['order_by']) ? $_GET['order_by'] : '';
print_r $s1 ;
#$data.=makexcl ();
}
include "footer.php ";
I don't think I have a typo in it., tnx,
Janis
Comment