divyakrishnan 20 Junior Poster

Can I solve this using REGEXP?

divyakrishnan 20 Junior Poster

I am using XAMPP's phpmyadmin.Also I tried it with SQL Server2005.There also I am getting the error like
"traslate is not a recognized built-in function name"

divyakrishnan 20 Junior Poster

I am getting the error like

FUNCTION employ.translate does not exist

divyakrishnan 20 Junior Poster

The query I used is shown below,

SELECT * 
FROM emp
WHERE ename LIKE '%govindraj%'
OR ename LIKE '%/-%'
ESCAPE '/'
OR ename LIKE '%/.%'
ESCAPE '/'
OR ename LIKE '%/_%'
ESCAPE '/'

using this query I got all records except first (which is having space character)

divyakrishnan 20 Junior Poster

Hi...
I have a table named empl with following fields(eid,ename,esal)


I had inserted the following records to empl table

1 Govind Raj 20000
2 GovindRaj 600000
3 Govindraj 10000
4 govindraj 50000
5 Govind.Raj 50000
6 Govind-Raj 20000
7 Govind_raj 2000
8 Govind.raj.3000
9 govind,raj. 4000
10 Govind'raj 6000
11 Arun 6000
12 Deepthy 6000

I want to list all the records with ename govindraj (by avoding space ,comma,dot etc).That is all the records with following names
Govind Raj ,
GovindRaj ,
Govindraj
govindraj
Govind.Raj
Govind-Raj
Govind_raj
Govind.raj.
govind,raj.
Govind'raj


What is the query for this result?Heard about REGEXP.But I don't know how to write the query..


divyakrishnan 20 Junior Poster

I want to copy the drop down list into a dynamic div.
I used the following code.
But it is not not working.

<form action="drop_copy.php">
<div id="firstdrop" > 
<select name="s[]">
<option value=1> one</option>
<option value=2> two</option>
<option value=3> three</option>
<option value=4> four</option>
 </select> 
</div>

<input name="" type="submit">
</form>
<script language="javascript">
var curr2=1;
var divTag = document.createElement("div");
       	divTag.id = "div"+curr2;
		
      
        divTag.setAttribute("align","left");
divTag.innerHTML=document.getElementById("firstdrop").innerHTML;
 document.getElementById("firstdrop").appendChild(divTag);
</script>
divyakrishnan 20 Junior Poster

Hi...
Is it possible to copy a drop down list into another drop down list ?

divyakrishnan 20 Junior Poster

kindly give vb.net code samples for connecting crystal report and postgresql
Also give information about how to add tables to a crystal report from a postgresql database using ODBC or any other method.

divyakrishnan 20 Junior Poster

Hi..

I have a project to display PDF files by clicking a hyper link.
The PDF are huge in size and it will take a long time to load.
I want to show a message like "Loading Please wait" on that loading time..

Any body have idea about this?Help me....

Thanks in advance

divyakrishnan 20 Junior Poster

Hi...
I want to enter more than one date onto textfield array with same name.
The javascript I have used is shown below.It works with text field without array.

calender.html

<script src="CalendarPopup.js">
</script>



<SCRIPT LANGUAGE="JavaScript" ID="js1">
var cal1 = new CalendarPopup();
cal1.showNavigationDropdowns();
</script>
<form name="newenquiry"   method="post" >
<input maxLength="10" size="17"  onkeypress="return handleEnter(this, event)" id="1212" name="file_date_dt"  >
													<a id="anchor1" name="anchor1" onclick="cal1.select(document.newenquiry.file_date_dt,'anchor1','dd/MM/yyyy'); return false;" title="Click here and select Date" style="color: #33c; font-family: Lucida Sans Unicode;CURSOR: hand" href="#">
													<img style="CURSOR: hand"  alt="select" src="calendar.gif" align="absMiddle" border="0">
													</a>
													</form>

CalendarPopup.js

// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. 
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files …
divyakrishnan 20 Junior Poster

Hi...

I have a problem on my project which is done in VS2005.In which I am creating crystal report and i want to export it to a pdf on an export button click. But an error is showing as 'Missing Parameter Value'. The code i used is shown below:-

protected void btnExport_Click(object sender, EventArgs e)
{

System.IO.FileStream fs = null;
long FileSize = 0;

DiskFileDestinationOptions oDest = new DiskFileDestinationOptions();

string ExportFileName = Server.MapPath("\\Rpt_Disbursement_search.rpt") + "Export";
Rpt.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
Rpt.ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
oDest.DiskFileName = ExportFileName;
Rpt.ExportOptions.DestinationOptions = oDest;
Rpt.Export();--ERROR IS SHOWN HERE
Response.Clear();
Response.Buffer = true;
Response.AddHeader("Content-Type", "application/pdf");
Response.AddHeader("Content-Disposition", "attachment;filename=Disbursement.pdf;");
fs = new System.IO.FileStream(ExportFileName, FileMode.Open);
FileSize = fs.Length;
byte[] bBuffer = new byte[Convert.ToInt32(FileSize) + 1];
fs.Read(bBuffer, 0, Convert.ToInt32(FileSize));
fs.Close();
Response.BinaryWrite(bBuffer);
Response.Flush();
Response.Close();

}

Error is shown on line no _15(Rpt.Export();).
I am passing a parameter to the report.There's no problem in viewing the crystal report.Any body knows please help me.Its very urgent for project.

divyakrishnan 20 Junior Poster

Thank u very much :).........

divyakrishnan 20 Junior Poster

Hi...

I want to add a text field inside a div(div with id "my_div") tag dynamically(By clicking "Add" button).
The code below shown is adding the new textfield after the submit button not inside the "my_div" div .

<html>
<head>
<script language="javascript">

function add()
{

		var divTag = document.createElement("div");
       	divTag.id = "div";
		//alert(divTag.id);
       
        //divTag.setAttribute("align","center");
       
        //divTag.style.margin = "0px auto";
       
        divTag.className ="dynamicDiv";
       
        divTag.innerHTML = "<input type='text' name='mytext[]' value='mytext'>";
       
        document.f.appendChild(divTag);
		
}

</script>
</head>
<body>
<form name="f"  id="f" action="homep.php" method="get">

<input type="button" value="Add" onClick="add()">
<div id="my_div" name="my_div">

</div>
<br>
  <input type="submit" name="Submit" value="Submit">



</form>
</body>
</html>

I had given as following,
document.f.my_div.appendChild(divTag);
for adding textfield inside div.But it showing errors..

Any body knows this solution please help me...

divyakrishnan 20 Junior Poster

Hey....Thank u for your help.Now my problem is fixed.I can run the script..

divyakrishnan 20 Junior Poster

Hi,
I want to create a group of radio button(2 buttons on a group) by dynamically with different names.After submitting the form I want to retrieve it on PHP.
I can create the radio buttons dynamically.But I could not retrieve the values on PHP.
There is a problem with radio button name.
The code I used is listing below.By clicking Add more button the button is displaying..By clicking submit button the form is submitted..

main.html

<script language="javascript">
function changeIt()
{
//var i = 1;
my_div.innerHTML = my_div.innerHTML +"<br>Skills <input type='text' name='mytext[]' value='mytext'>";
my_div.innerHTML = my_div.innerHTML +" Good<input type='radio' id='my' value='mytext' value='1' name='radio[]'>";
my_div.innerHTML = my_div.innerHTML +"LOw<input type='radio' id='my' value='2' name='radio[]'>";


//var el = document.getElementById('my');
//el.name = 'level';
}
</script>

and write this in the body.........

<form name="form" action="homep.php" method="">

<div id="my_div">
  
</div>
<input type="button" value="ADD More" onClick="changeIt()">

<input type="submit" name="Submit" value="Submit">

</form>

homep.php

<?php 

$t= $_REQUEST['mytext'];
print_r($t);
$p=$_REQUEST['radio'];
print_r($p);

?>
divyakrishnan 20 Junior Poster

Hi..
I have a problem with my project.
I want to create dynamic radio button group with different names.

<script language="javascript">
function changeIt()
{

my_div.innerHTML = my_div.innerHTML +"<br>Skills<input type='text' name='mytext[]' value='mytext'>";
my_div.innerHTML = my_div.innerHTML +"<br><input type='radio' id='my' value='mytext' value='male' name='radio[]'>";
my_div.innerHTML = my_div.innerHTML +"<input type='radio' id='my' value='Female' name='radio[]'>";


//var el = document.getElementById('my');
//el.name = 'level';
}
</script>


<form name="form" action="homep.php" method="">

<input type="button" value="test" onClick="changeIt()">
<div id="my_div"></div>
  <input type="submit" name="Submit" value="Submit">


</form>

I want to create a radio button group(2 radio buttons on a group) with different name.
Anybody knows please help me..

divyakrishnan 20 Junior Poster

Tried it using following..But my browser is hanged.


<?php

echo exec("d:\\example\\php_exe\\1436.exe");

?>

divyakrishnan 20 Junior Poster

Is it possible to run an exe file directly onto the server without downloading/saving into client machine?
I had used that exec() function .But it is showing no display.

<?php

echo exec("d:\example\php_exe\1436.exe");

?>

Also I tried it using backticks operator

divyakrishnan 20 Junior Poster

It is a browser based problem.It works fine with IE.But it will not be work with other browsers.Showing security error.Is there any solutions to solve ?

divyakrishnan 20 Junior Poster

Hi ,
I want to access a pdf file by clicking a hyperlink using PHP.the pdf file is stored on a shared folder of a storage machine.It work with internet explorer.But with firefox and chrome its not working.Showing error on chrome as
"The loading of the URL has been blocked for security reasons."
And on firefox showing as "security error".

How to enable this on firefox and chrome?I am using xampp software.
The code I used listed below.

<?php 


$path1="file://192.168.0.230/pdf/p.pdf";

?>
<a href="<?php echo $path1; ?>">PDF click</a>
divyakrishnan 20 Junior Poster

Hi..
I have installed xampp-win32-1.7.4-VC6 on windows.
I can access it as localhost.
But showing the following error while it accessing from other machines which are locally connected.
The error as follows

Access forbidden!

New XAMPP security concept:

Access to the requested directory is only available from the local network.

This setting can be configured in the file "httpd-xampp.conf".

If you think this is a server error, please contact the webmaster.
Error 403
192.x.x.x
3/30/2011 3:50:12 PM
Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1

I had accessed it using the IPaddress as
http://192.x.x.x

Any body have any idea please help me.

divyakrishnan 20 Junior Poster

My problem is solved.I accessed it by installing a server.Using the the IP address.
Thank u for your support

divyakrishnan 20 Junior Poster

Yes I tried it with a shared drive.How should I give the path?

divyakrishnan 20 Junior Poster

I had tried using HTML as follows
<a href="192.x.x.x/d:/pdf/first.pdf" target="_blank" > Click to view PDF</a>
but it is not working..
What should I give IP address or computer name?

divyakrishnan 20 Junior Poster

Hi...

I have a problem to load a PDF file which is stored on another machine.I had loaded the PDF on the same machine using following PHP script.Here I had used a hyper link to load PDF.

<?php 
$file="first";
$pdfFile=$file.".pdf#page=1";
?>
<a href="<?php echo $pdfFile; ?>"  target="_blank" >  Click to view PDF</a>

This is working properly.But I had tried to access the PDF which is on another machine using IP address as follows

<?php 
$file="//192.x.x.x/e:/pdf/first";
$pdfFile=$file.".pdf#page=1";
?>

This script is not working...:(

Any body have any idea please help me.It is very urgent for my project.

divyakrishnan 20 Junior Poster

Hi..

I want to take the max value of the substring of a varchar field having values as SN1,SN2....SN10.I used the query as following

select max(substring(st_no,3,4)) from tbl_st;

I am getting the max value as 9.I want to get 10.

If somebody knows please help me

divyakrishnan 20 Junior Poster

Hi..

I had successfully connected MySQL database usng ADODB.But I could not connect Using PostgreSQL database with ADODB.I had used the following code for connection.

<?php


include("adodb/adodb.inc.php");
$db = NewADOConnection('postgres');


$c=$db->Connect("localhost", "postgres", "postgres", "dbname");
$db->debug = true;



if(!$c)
{
   echo "not connected";
}
else
{
  echo "successfully  Connected";
}

?>

It showing the message as not connected.

If anybody have any idea please help me..

Thanks

divyakrishnan 20 Junior Poster

This error is being caused because of the failure of mysql query. It is due to the following resons
missing of single quotes for varchar & date
incorrect posted data because of white space,quotes etc.


It is better u display all the query statements before running.

divyakrishnan 20 Junior Poster

The problem is with ur included pages.
It the missing of closing braces on functions or loops.
Checkout the included pages.

divyakrishnan 20 Junior Poster

Just go through this URL of phpclasses.org.
http://www.phpclasses.org/package/1442-PHP-Result-Set-pagination-with-database-abstraction.html

There is an exmaple code u can download for pagination containing previous & next button..I think it will help you

divyakrishnan 20 Junior Poster

Very simple modification,

Change your first script as follows....


<td>&nbsp;<input class='radio' [id="__id__"] type="radio" name="typeselection" checked onclick=showtype('__type__') value='' ></td><td onclick=showtype('__type__')>__label__&nbsp;</td>

divyakrishnan 20 Junior Poster

What r u doing with compare.php?
After selecting the first drop down list U have to refresh second drop down list.
Using Ajax to load data to second drop down list .

divyakrishnan 20 Junior Poster

T think it is the missing of double quotes/single quote.The code u posted have no errors.I executed after commenting the 2 function calls.If u can post entire code

divyakrishnan 20 Junior Poster

First u set primary key for case table,say like case_id.
For insertion u can use for loop.

On the update form list all the records which may be have same $case value.But different case_id.

Then update records by specifying their case_id value.

divyakrishnan 20 Junior Poster

Hi...
Before I also have this problem.
It is better to use ADODB.
ADODB is a PHP abstraction class (install adodb to the project folder).
Give name of the form elements as the name of the fields in the database.

At the time of insertion first the simply calls an empty record from database using adodb function.

Then specify the array that contains form data(ie $_POST/$_GET/$_REQUEST) on to an insert function of adodb.

Try it..It will be simple and fast..

If you want more details I wil send example script.

Cheers

divyakrishnan 20 Junior Poster

U can use AJAX to store the session after the onchange event.AJAX helps to send data from javascript to PHP.On the Onchange event invoke a javascript function.Through this function invoke a php file to create a session variable using AJAX.

divyakrishnan 20 Junior Poster

You also try this

("SELECT * , image.user_id, image.name, page.user_id, page.urlcode FROM users JOIN mystuff.page ON (user.user_id=page.user_id) JOIN mystuff.image ON image.user_id = users.user_id WHERE page.user_id = users.user_id AND users.last_name = %s AND users.first_name = %s"
divyakrishnan 20 Junior Poster

Use AJAX itself.It wil reload ur page/portion of a page

divyakrishnan 20 Junior Poster

Also using AJAX you can retrieve the javascript variables to php.

divyakrishnan 20 Junior Poster

Thank you :)..very much...
Only the first method works fine for me.

Also I had tried

unset($_POST);

It is clearing the array.But after resubmission again $_POST array is initialized with the posted data..
I can't use header().because I wanted to display some data on the same page.


But anyway my problem solved..thank u..

divyakrishnan 20 Junior Poster

Hi..I have a problem on database insertion:(

How to prevent duplicate record insertion on database while refreshing a webpage?
I had tried the following code,but it also resubmitting the form data.

if(isset($_REQUEST['add_cat']))
{

  //code for db insertion

}

Thanks in advance

divyakrishnan 20 Junior Poster

Hi..

I want to encrypt and decrypt a password using c#.net.If any body knows please help me.

divyakrishnan 20 Junior Poster

I had used the following code.

<?php

header("Content-Type: application/pdf");
$pdfFile="readme.pdf#page=10";


?>

<html>
<head>
<title>Untitled Document</title>
</head>

<body>

<a href="http://<?php echo $pdfFile; ?>">Click Here</a>

</body>
</html>

But it showing an alert like following

File does not begin with '%PDF-'


After clicking alert showing a black screen..


can u please send me the entire code?


Thanks...

divyakrishnan 20 Junior Poster

Hi..
I have an issue on my project.I want to open a particular page of a PDF by clicking a hyper link.How should I do it?any idea ?

divyakrishnan 20 Junior Poster

Hi..
This functions will only works on linux OS right?I want to do it on windows XP..Anybody know how to convert a PDF to text file using commandline?

divyakrishnan 20 Junior Poster

Hi...

I need a batch script to convert a PDF file to a text file on window xp.Any idea ?please help me...

divyakrishnan 20 Junior Poster

Hi...

I have an issue on project.I want to open a particular pdf page by specifying its page no using PHP script.Is it possible?please help me

divyakrishnan 20 Junior Poster

Hi..
I want export data from database to a PDF using c#.In database I stored the data as 'nvarchar'.Any body have any idea About this?

Thanks in advance.

divyakrishnan 20 Junior Poster

Hi...

Is it possible to search a string on a PDF file?
I want to search and highlight a string on a PDF file .
If any idea please help me.....


Thanks for advance

divyakrishnan 20 Junior Poster

I didn't understand ur problem?what u want to do?install pear on xampp?