(link for the picture http://d.pr/i/SCks just in case..)
On the three browsers above, the arabic text is well displayed.
On Chrome (V 15) bellow, it's a bit not well organized.
What seems to be the problem ?
PS: i'm using Fusioncharts
EDIT:
That's how I'm writing it:
echo '<set label="' . addslashes($label) . ' - \' + value_' . $i . ' + \'% (' . $label_value . ') " value="' . $data_pie['nb'] . '" />\';' . "\n";
Related
When trying to access an SmbFile with a DFS URL, the jcifs library fails. But when I use the UNC returned by dfsutil it works.
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication( domain, user, pass );
SmbFile folder = new SmbFile(path,auth);
If path is set to
smb://mydomain.example.com/ourdfs/go/to/my/folder
the call fails with
Exception in thread "main" jcifs.smb.SmbException: The network name cannot be found.
But it is successful when invoked with the resolved name
dfsutil diag viewdfspath \\mydomain.example.com\ourdfs\go\to\my\folder
The DFS Path <\\mydomain.example.com\ourdfs\go\to\my\folder>
resolves to -> <\\someserver.example.com\sharename$\my\folder>
Then the following url works for path
smb://someserver.example.com/sharename$/my/folder
How do I set up jcifs to handle DFS properly i.e. not having to translate urls thru dfsutil?
The solution is to set the WINS configuration. IPCONFIG /ALL will show the information:
Connection-specific DNS Suffix . : MYDOMAIN.EXAMPLE.COM
Description . . . . . . . . . . . : Ethernet Connection
Physical Address. . . . . . . . . : DE-AD-BE-EF-F0-0D
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IPv4 Address. . . . . . . . . . . : 10.10.1.42(Preferred)
Subnet Mask . . . . . . . . . . . : 255.0.0.0
Lease Obtained. . . . . . . . . . : December 3, 2018 09:03:04 AM
Lease Expires . . . . . . . . . . : December 9, 2018 09:03:04 AM
Default Gateway . . . . . . . . . : 10.10.1.1
DHCPv4 Class ID . . . . . . . . . : O-mobile
DHCP Server . . . . . . . . . . . : 10.10.11.13
DNS Servers . . . . . . . . . . . : 10.10.4.48
10.10.4.56
Primary WINS Server . . . . . . . : 10.10.1.59
Secondary WINS Server . . . . . . : 10.10.2.58
NetBIOS over Tcpip. . . . . . . . : Enabled
The then configuration item has to be set as follows:
jcifs.netbios.wins=10.10.1.59
or by setting it with jcifs.Config.setProperty()
I'm currently using Joomla 2.5 WYSIWYG and I'm trying to add a custom html module, but the text editor field area is limiting the number of characters allowed!
So my question is; how can I increase the number of characters allowed in the text field?
The reason why I want this is because I'm adding a javascript code that is too long to be saved.
Please help with any solution, thanks.
The textarea size in the Article Manager's TinyMCE editor of Joomla 2.5 is annoyingly small, especially for people used to the larger editable area that was available in Joomla 1.5.
You can change the height of this by clicking on the diagonal lined area at the bottom right hand corner and dragging up and down, but the size will reset after each session has ended. Here's how you can hardcode a height size of your choice...
Edit the file found in... plugins/editors/tinymce/tinymce.php
Then change line 723 (or thereabouts) from...
$editor = '<textarea name="' . $name . '" id="' . $id .'" cols="'. $col .'" rows="' . $row . '" style="width: ' . $width . ';
height:' . $height . ';" class="mce_editable">' . $content . "</textarea>\n" .
to...
$editor = '<textarea name="' . $name . '" id="' . $id .'" cols="'. $col .'" rows="' . $row . '" style="width: ' . $width . ';
height:500px;" class="mce_editable">' . $content . "</textarea>\n" .
Replacing the height value with the height of your choice.
it may help you.Thank you
I have following data line i need to parse in Perl:
my $string='Upper Left ( 440720.000, 3751320.000) (117d38\'28.21"W, 33d54\'8.47"N)';
Here is my perl script:
if ($string=~ m/Upper Left\s+[(]\s+\d{1,6}[.]\d{1,3}[\,]\s+\d{1,6}[.]\d{1,3}[)]\s+[(](\d{1,3})d(\d{1,2})['](\d{1,2})[.](\d{1,2})/ig) {
$upperLeft="lat=". $1. 'd'. $2. "'". $3. ".". $4. '"W long='. $5. 'd'. $6. "'". $7. ".". $8. '"W';
print $upperLeft. "\n";
}
However this expression fails to 117d38'28.21" as lat and 33d54'8.47 as long. Note the space and '(' in the input $string which i use to create this regular expression.
What I am I doing wrong in extracting (117d38'28.21"W, 33d54'8.47"N) into 8 fields? Any help is appreciated.
You had several issues. The main being your regex just parsing up to lat, not lon.
What changed:
m/Upper Left\s+[(]\s+\d{1,6}[.]\d{1,3}[\,]\s+\d{1,6}[.]\d{1,3}[)]\s+[(](\d{1,3})d(\d{1,2})['](\d{1,2})[.](\d{1,2})/ig
m/Upper Left\s+[(]\s+\d{1,6}[.]\d{1,3}[\,]\s+\d{1,7}[.]\d{1,3}[)]\s+[(](\d{1,3})d(\d{1,2})['](\d{1,2})[.](\d{1,2})"([WE])[\,]\s(\d{1,3})d(\d{1,2})['](\d{1,2})[.](\d{1,2})"([NS])/ig
^-- Your test number was 7-digit big ^-- (1) ^-- (2) ^-- (3)
At the ending: (1) added group to deal with W/E (([WE])). (2) Added groups to extract lon number. (3) Added group to deal with N/S (([NS])).
Your code, corrected:
if ($string=~ m/Upper Left\s+[(]\s+\d{1,6}[.]\d{1,3}[\,]\s+\d{1,7}[.]\d{1,3}[)]\s+[(](\d{1,3})d(\d{1,2})['](\d{1,2})[.](\d{1,2})"([WE])[\,]\s(\d{1,3})d(\d{1,2})['](\d{1,2})[.](\d{1,2})"([NS])/ig) {
$upperLeft = "lat=" . $1 . 'd' . $2 . "'" . $3 . "." . $4 . '"' . $5 . " long=" . $6 . 'd' . $7 . "'" . $8 . "." . $9 . '"' . $10;
print $upperLeft. "\n";
}
Output:
lat=117d38'28.21"W long=33d54'8.47"N
I am using a 'While' loop to run through an array of users' first names, last names, and emails. When my 'While' loop executes, and I echo the data, it successfully shows the row data from the database, but it does not show Row 1. It starts at row 2 and spits everything out properly, but why is it skipping row 1?
$query= "SELECT * FROM email_list";
$result=mysqli_query($dbc, $query);
$row=mysqli_fetch_array($result);
while ($row=mysqli_fetch_array($result)) {
echo $row['first_name'] . ' ' . $row['last_name'] . ' : '
. $row['email'] . '<br />';
}
mysqli_close($dbc);
One thing I have found, is if I put this section:
$row=mysqli_fetch_array($result);
echo $row['first_name'] . ' ' . $row['last_name'] . ' : '
. $row['email'] . '<br />';
above the 'While' loop, then it does successfully show the first row of data, and all the other rows too, so, if that's confusing, coding it like this (the long way - below) actually works, but it seems redundant and I want to use best DRY practices:
$query= "SELECT * FROM email_list";
$result=mysqli_query($dbc, $query);
$row=mysqli_fetch_array($result);
echo $row['first_name'] . ' ' . $row['last_name'] . ' : '
. $row['email'] . '<br />';
while ($row=mysqli_fetch_array($result)) {
echo $row['first_name'] . ' ' . $row['last_name'] . ' : '
. $row['email'] . '<br />';
}
mysqli_close($dbc);
You have 2 calls to $row=mysqli_fetch_array($result); before you print your result. One before the loop and the other as the expression in the while statement.
Try deleting the one before the while loop.
$result=mysqli_query($dbc, $query);
// kill this line $row=mysqli_fetch_array($result);
while ($row=mysqli_fetch_array($result)) {
echo $row['first_name'] . ' ' . $row['last_name'] . ' : '
. $row['email'] . '<br />';
}
I'm trying to get data from a database if a link is clicked.
Basically i have a main.php that contains this:
$sql2="SELECT projectsid, projectname, description,
SUBSTRING(description,0,80) FROM projects";
$result2=mysql_query($sql2);
while($row2 = mysql_fetch_assoc($result2)) {
echo "<div id=\"links\">";
echo "<ul>";
echo "<li> <a href=\"fullproject.php\">" . $row2['projectname'];
$_SESSION['projectname']= $row2['projectname'];
echo "<em>" . $row2['description'] . "</em></a></li>";
echo "</ul>";
echo "</div>";
}
This displays a list of names and a brief description.
Proj1
description
Proj2
description
What i'd like to do is to display the full contents of a project if that one is clicked.
fullproject.php
<?php
session_start();
$projectname= $_SESSION['projectname'];
// Connect to server.
require ("connect.php");
$sql1="SELECT projectsid, projectname, programme, difficult, requirements,
resources, description, contact, gsize, size
FROM projects WHERE projectname = '$projectname'";
$result1=mysql_query($sql1);
while($row1 = mysql_fetch_assoc($result1)) {
echo "Project Name: " . $row1['projectname']. "<br />";
echo "Programme : " . $row1['programme'] . "<br />";
echo "Difficult : " . $row1['difficult'] . "<br />";
echo "Requirements : " . $row1['requirements'] . "<br />";
echo "Resources : " . $row1['resources'] . "<br />";
echo "Description : " . $row1['description'] . "<br />";
echo "Contact : " . $row1['contact'] . "<br />";
echo "Group size : " . $row1['gsize'] . " " . $row1['size'] . "<br />";
echo "<br /> ";
}
Whenever I click any of the project list items, it only displays the last itemin the list.
I believe this is happening because when the while loop ends the session variable is set to the last one.
Can someone tell me how to fix this?
Thanks
Try using GET variable instead of session
in main.php use
echo "<li> <a href='fullproject.php?projectname=$row2[projectname]'>";
in fullproject.php declare a variable and initialize it to the get variable
$projectname= $_GET['projectname'];
There is a lot wrong with this code.
1) You are trying to send the primary key of the table via 2 different methods in main.php: in the session and via the path of the URL. This is just bad practice - the reason you have access to different conduits for passing data is that they all have different semantics, but even then, sending the same thing twice then there's always going to be a risk that the receiving end may see different values and must terefore have a way of reconciling the discrepancy.
2) You are using the session to pass a transactional data item. This is a bad idea - the data item relates to a specific transition - not to the session. $_SESSION should only be used for storing data relating to the sesion - not to navigation or transactions.
3) The other conduit you provided for passing the data item is by appending it to the path within the URL. While in some circumstances this approach has benefits it also has complications specific to the webserver the code is implemented on - you've not provided any explanation of why you are using this apporach instead of a conventional $_GET or $_POST var.
The reason your code is failing is because you can only store a single value in $_SESSION['projectname']. Even if you stored an array of values in the session, there is no mechanism for the webserver to know which of these values was selected when the code was delivered to the browser.
Your HTML is badly structured and poorly formatted too.
The code you've shown does not match the description you've given (it does not display the project name).
Your code is also wide open to SQL injection attacks.
Change it so that in main.php:
echo "<div id=\"links\">\n";
echo "<ul>\n";
while($row2 = mysql_fetch_assoc($result2)){
echo "<li> <a href=\"fullproject.php?project=\""
. urlencode($row2['projectname']) . "\">"
. htmlentities($row2['projectname']) . "</a>\n";
echo "<br /><em>" . $row2['description'] . "</em></li>";
}
echo "</ul>";
echo "</div>";
And in fullproject.php
<?php
session_start();
require ("connect.php");
$projectname= mysql_real_escape_string($_GET['projectname']);
echo"<a href='fullproject.php?project_id='".$row2['project_id'].
"> $row2['projectName']</a>";
in fullproject.php
$project_id=$_GET['project_id'];
then you can use this id to display contents of that project id from database