Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Translate Perl Code To PHP Code.


Can some one transfer this Perl into PHP? It is from the Spreadsheet-WriteExcel. PHP Code:




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Translate Asp Code To Php
can u help me translate this ASP code to php.

<%
response.write "&name1=" & request("param1") & "&name2=" & request("param2") & "&"
response.end
%>

View Replies !   View Related
Translate Perl Into PHP
I have written a Perl script which basically splits a text file, greps the required image names, and returns the string in Javascript Code:

View Replies !   View Related
PHP 4.4.4 Vs Perl 5.8.7 For Object Oriented Server Code
Have you run into a situation where you had to switch from PHP 4.x.x to Perl 5.x.x in order to get better performance?

I am using an OO approach to PHP for my website's server code. There is one tiny script, with dozens of small objects. Each object is in a separate source file.

It is a bit slow, even when the code doesn't do much DiskIO or MySQL.

My webhost (NetSol) uses PHP 4.4 running on Apache 1.3 and Linux.

I have to option to use Perl 5.8.7. That is the only alternative they give me at this time.

Without doing the rewite, I am trying to determine if I can expect any real improvement in performance.

Have you seen or do you know of such a scenario where you get better performance from Perl than from PHP?

View Replies !   View Related
Inserting PHP Code Into HTML Generated By A CGI/PERL Script
Is there a way to have PHP code included into HTML generated by a CGI/PERL script? The problem is that the CGI-generated HTML can not be interpreted/parsed by PHP. Unless you know how.

View Replies !   View Related
System() Call Perl Script Return Code 13 ?
I run into major problem here and I still cant get it resolved ?

I tried to execute a perl script using the PHP system call

$haha = system('perl /home/testing/cron_scripts/generate.pl', $retval);

echo "Haha is $haha<br>";
echo "Ret Val is $retval<br>";

The problem is I keep getting $retval = 13 ? But if I were to run them from Command line it works. However the script will take sometime. I am not sure if 13 means the code is running or something ? But the problem is my PHP script just exit !

View Replies !   View Related
Command-line Php Displays Code Instead Of Executing Code
I am using CLI PHP to run a PHP script, c:wampphpphp.exe, but
instead of executing my script, it's actually displaying the raw code
instead.

How can I run my code using CLI PHP? I installed WAMP5 on WinXP.

View Replies !   View Related
Code To Read Code In Web Page's Source
Does anybody know how one can supply a URL to a PHP script and have it search for specific code in that web page?

View Replies !   View Related
Old Code Vs New Code - Language Syntax Change?
I've recently begun programming PHP again and have found my old code doesn't work anymore. It's been a few years since my code was written, and simple functions don't seem to be working. I've done a bit of research into the syntax again and found the following;

I used to use a function as such;

if ($REQUEST_METHOD=="POST") {
Now I've seen alot of the syntax is
if ($_SERVER($REQUEST_METHOD=="POST")) {
And referencing variables from the form is as such;
$_POST['variable']

Where previously I could reference them in the simple form; $variable

Has there been a language syntax change that would cause my old code to be obsolete? Is there a configuration line that could be changed to allow this old code to work?

View Replies !   View Related
Regular Expression :: Format Anything Within &lt;code&gt; And &lt;/code&gt;
Any regular expression wizards out their tonight? This is driving me crazy...trying to take a string full of HTML and format anything within the <code></code> tags using highlight_string().

$string = "<strong>This</strong> is some HTML!!!<code>echo "Hello, World!";</code>No more code!!!";
$pattern = "(<code>)*(</code>)";
$replacement = "";

$string = eregi_replace($pattern, highlight_string($replacement, true), $string);

*Thought that would work, but I know regular expressions are NEVER that easy. An hour later...

View Replies !   View Related
BB Code - Escape A Bracket In BB Code?
Is there a way to escape a "bracket" in BB code? The beginning of a bbcode
post I made starts with something in brackets [like this]. This causes a
strange thing to happen to the remainder of my post. Removing the brackets
makes my post normal. That shows me that I need to escape the brackets.
However, a simple backslash does not seem to do the trick i.e. this [wont
work]

I am not the administrator of the bb forum, just a poster. So I need to know
what to do on my end (as opposed to an adiministrator's power to
reconfigure, etc.

View Replies !   View Related
Convert Code Into Javascript Code
i have this php code:

header("Location: merge_cart.php?oldsession=" .urlencode($cart["sessionId"]));

now i want to convert this code into javascript code in php echo statement

e,g echo (" windows.location(......php) ");

does anyone knows how to do that.

View Replies !   View Related
Zip Code, Post Code, Town
does anyone know where i could get a MySQL db with postcodes and then towns that those postcode correspond to? i think this goes in php because i will develop all of my search in php.

View Replies !   View Related
Code To Display My Code
I am taking a class in PHP and thought that it would be nice to display
the PHP code that generated my pages when the user clicked a link (or
submit button). I have seen page that will display the underlying HTML
on the page and it would be a nice touch...

View Replies !   View Related
Executing A Php Code Within A Code
i'm making a search option in our website but the thing that makes it hard is that
when the result of the search is only 1 it must automatically execute the a page it locates..unlike when the result yields multiple result all you have to do is link the results..

View Replies !   View Related
Using Preg_replace() For [code][/code]
I'd like to be able to something similar to what codingforums does with the script.
however, i can't get mine to work..

I'm somewhat new to php, and I'm starting to understand the patterns, but mine obviously isn't correct.

I have this so far:

[code]
<?php
$text = preg_replace( "/[code](.*?)[/code]/","<table><tr><td>1</table>",$text);
?>

View Replies !   View Related
Html Code Within Php Code
How can I insert HTML code from within a php statement?

eg

if validation
{
html code snippet to display message
}else{
HTML Code snippet to display error page
}
}

View Replies !   View Related
Adding Php Code Or To Include A Page With Php Code Into A .tpl Page
how would i do this, i am intergrating a phpbb forum system into my site!

View Replies !   View Related
ENV Variables In Perl Scripts Called From Perl.
I have a perl script in which I am using a ReadParse routine that parses the
$ENV{'QUERY_STRING'} or $ENV{'CONTENT_LENGTH'}*which are two variables passed
to the script under usual SSI (.shtml) containing form data submitted to the
page from which the script is executed from. Code:

View Replies !   View Related
BB Code
i am making my own forums and i've got everything working pretty good except the bb code. i can get the easy ones like bold and emails but ones like 'url=index.php'Test'/url' (' = [ and ]) confuse me. i could get it if it was just url= or just plain url but when it can be either one i can't get it to work right.

View Replies !   View Related
How To Add A Pop-up Code To Php
cecho"<script>"
. "function openpopup()"
{
. "var popurl="clip.html""
. "winpops=windows.open(popurl,"",width=640,height=480,toolbar,directories,scrollba rs,"
}
. "</script>"Hi,
˙. "</script>"Hi,
s.open(popurl,"",width=640,height=480,toolbar,directories,scrollba rs,"
in.php?op=modules">"._ADDAHOME."</a> ]</center>";

View Replies !   View Related
GPS, Zip Code DB
I am searching for a database that I can write a PHP
application against. I am not looking for bulky packages, or anything
fancy or maps, ... just some raw SQL data I can mix & match from
tables, ... stuff like Zip codes, Latitude and Longitude, and any
other basic address & coordinate info. I can cross reference and tie...

View Replies !   View Related
SSL Php Code
I am using linux, php and trying to do some ssl code. I want to send some identifier that connects my database to the client browser. I was looking into a secure cookie. I only want the page accessed over a SSL connection. Whats the best way to insure the clinet browser can only see my
page if they are ssl connected to it? In adding a 1 to the end of my send cookie code, it sends the cookie regardless of if they are ssl connected or not.

View Replies !   View Related
Zip Code
I have a database of zipcodes with latitude and longitude. I also have the
method of calculating the distance between two zipcodes. What I want to
know is if there is an efficient algorithm for obtaining the zip codes
within a specified distance of the first zipcode without having to retrieve
and calculate for every record in the database.

View Replies !   View Related
Zip Code From IP
I found this on the internet in a process of grabbing weather from weather.com and it uses the IP to trace back the closest zip code. It looks up the whois info in arin.net and once, worked correctly. I was wondering if anyone knew why it no longer grabs the correct zip code. I don't want the weather anymore but rather just the zipcode. Code:

View Replies !   View Related
Code?
This is straight out of a book I'm reading to learn PHP. I'm thinking
maybe I set either apache or PHP up incorrectly on my computer.
Simpler PHP's snippets work fine so I just don't know. Could someone
look this over and see if I have a problem?

<?php
function printColor($text,
$color="black", &$count=NULL)
{
//print the text with style
print("<span style="color: $color">" .
"$text</span>");

//if given a count, increment it
if(isset($count))
{
$count++;
}
}

//call with one argument
printColor("This is black text");
print("<br>
");

//override default color
printColor("This is blue text", "blue");
print("<br>
");

//pass in count reference
$c = 0;
printColor("This is red text", "red", $c);
print("<br>
");
printColor("This is green text", "green", $c);
print("<br>
");
print("Count: $c<br>");
?>

View Replies !   View Related
PHP Bug (or My Bad Code)?
Consider this code:

<?
$mask_n = (pow(2,32) - (pow(2,32-24)-1));
printf("%x
", $mask_n);
?>

On PHP 4.1.2 it prints:

ffffff00

On PHP 4.3.10 is prints:

ffffff01

Both versions of PHP are the standard Debian packaged versions (4.1.2
from Woody, 4.3.10 from Sarge)

tecra# php -v
PHP 4.3.10-9 (cli) (built: Mar 6 2005 17:45:14)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

admin# php -v
4.1.2

Results are (predictably) the same under both the CLI version and under
the Apache module.

Is this a bug in PHP, or is there something broken in my code?

View Replies !   View Related
Php Code In A .gif?
I have heard of it being done, But i cant quite figure out how its done. I would like to make a .gif that would maybe have a mail() or something in it.

View Replies !   View Related
Add Code To My Code
I have a good file exists code and want to add it to a different file, i tried several times but i get coninual errors. Could someone please help me and paste my code into my full file, i promise to learn from your work. i know it should be simple but im a bigginer to php. Code:

View Replies !   View Related
Add Code To Code
how i can add code 1 to code 2 witch is below?what im trying to do is have a banned email code so when some one signs up it will say the email has been banned i have a table in my database with the list of emails that i want banned its called banned_emails and iin the banned emails table its called banned_email that is where the emails are Code:

View Replies !   View Related
Run The Code More Than Once...
I am trying to get my code running more than once when a user submits their form.
For example, when a user vists the page called "search", then can enter a number between 1 and 100. Once they hit submit, I want the code to run completely, x amount of times, depending on what the user requests.

View Replies !   View Related
Code For This
Say I wanted to create a comprehensive product code based on what the product in the database is called. Therefore I'd like:

"Blue Widget in Cotton"

to become:

"BLUEWIDGETCOTTON"

I can get rid of the space and "in"'s using str_replace but is there any code that will turn it into all capitals?

View Replies !   View Related
Mdb Code
Could some body be so kind to convert the following code so that it works with mysql

<?php

$sql="SELECT * FROM Admin";
$rs=odbc_exec($conn,$sql);
if(!$rs)
{
exit("Could not retrieve script settings.");
}
odbc_fetch_row($rs, 0);

?>

I have tried but keep getting errors

View Replies !   View Related
Fax Code
I know you can send an email VIA php but can you send a fax in the same way?

What I would like to do is have a fax sent to a designated number everytime an order is completed on my shopping cart program.

Any ideas on where to find a tutorial or general information about faxing VIA the internet. I don't want to pay a subscription/mo, i want to develope the code to send it right from my server, no 3rd parties involved. If you have ever done business, you know that the more parties involved the more hassles there are.

View Replies !   View Related
How To Code In Php ?
Many times i need to open certain file ( for 100 times )from ftp and correct errors.
How can i do this localy ? How can i test it so that its operating like on remote server ?
Question, work off-line, all finished - upload to server. Code:

View Replies !   View Related
Using PHP Code
i am sending mail using php code "mail()". It is working for usal mail accounts. But when i send to gmail account, it make problems. Gmail does n't resolve my header formats. The html code also shown to the viewer. How can i resolve this issue.

View Replies !   View Related
My First PHP Code
My first code of PHP when I run from the browser gives me blank screen. The code is

<html>

<body>

<?php

$myvar = "Hello World";

echo $myvar;

?>

</body>

</html>

I am using apache server. Please tell what to do.

View Replies !   View Related
This Code
$antroj=0;
$dtctxsz1 = $_POST["dtctxsz1"];
if($dtctxsz1 == 0){
print $dtctxsz1;
$antroj = $antroj + 1;
}

It adds 1 to $antroj even when the value of $dtctxsz1 is not 0. I have spent 7 hours on this one problem. Its driving me nuts.

View Replies !   View Related
Get The Code
can any one provide me the code? or where can i get the code for massive online games websites.

View Replies !   View Related
Looking For A Php Code
Im looking to create a website that relies heavily on a peice of php script,unfortunatly I am unsure what the script is, and where i can find it, if i can find it, and if not what to say to my website designer so they can write the appropriate code. The code im looking for is present on ebay; when you try to sell something.

it asks you to identify what catagory it should go under, so you select an item in box 1, which loads subsequent items in box 2, then you choose what you want in box 2 which loads relavent inforamtion in box 3 until you have what you want, its a way of narrowing down.

View Replies !   View Related
Zip Code By Ip
I have a database that has every zip code in it along with the city name, state name, latitude and longitude. What i want to do is automatically display results from the users Zip Code by getting their ip. I've seen this done before, and I would be willing to purchase a database of this information if I had to. Does anyone know how i can do this or where i would get this information?

View Replies !   View Related
Best Way To Code
I'm making a forum and wanted to know whats the best way to code if a post/topic has been read? using a session?

View Replies !   View Related
Php Code
PHP Code:

<?php
if (isset($_GET['submit']))
{
header("Content-type: image/png");
$im = @imagecreate(100, 50)
or die();


$b_red = "$back[0]";
$b_green = "$back[1]";
$b_blue = "$back[2]";

$t_red = "$text[0]";
$t_green = "$text[1]";
......................

View Replies !   View Related
Ipn Code
Would anyone want to share ipn code for alertpay or worldpay..

View Replies !   View Related
Go To URL Code
How do I direct the bowser to a different location in PHP? It is needed after some calculations so header method won't work!

View Replies !   View Related
ASP Code
I have a function written in ASP, but I need the same function in PHP to return the same value. This is a function that encrypts a password: Code:

View Replies !   View Related
Var Code
can somebody give me a code that validate to see if the first letter of a variable string is an alphabet (case incensitive).

View Replies !   View Related
Hex Code?
I'm looking for some way to select certain colors depending upon others. Such as if a parent dragon had skin the color #FFFFFF, and the other parent had #018274, how could I find a medium between each color?

View Replies !   View Related
VB Code
Hi is there any way i can include VB code in my php page i want to make a simple form where you purchase something and it costs you points (which is held in a table) i dont any security on these fields or any thing like that. i know vb better than i do php so wondered if it was possible.

View Replies !   View Related
PHP Code
Code:

if ($totalrows > 0) {
for($i = $fr;$i < $to;$i++) {
$hoplink = $rss_channel["ITEMS"][$i]["LINK"] . "&u=" . $cbengine_user . "&cbid=" . $cbengine_cbid;
print ("<div class="item">");
print ("
<div class="itemtitle"><a href="" . $hoplink . "" target="_top">" . $rss_channel["ITEMS"][$i]["TITLE"] . "</a></div>");
print ("<div class="itemdescription">" . $rss_channel["ITEMS"][$i]["DESCRIPTION"] . "</div>");
print ("</div>");
}
} else {
print ("<b>Your search did not return any products.</b>");
}

View Replies !   View Related
Seeing Code
I have just installed PHP 5.2.1 and after the install I am not able to see my pages correctly. The only output I have is anythine outside of the <? ?> tags. If I do a view source, I can see the php code which I know I am not supposed to see. I have the path variable pointed to the new install location.

View Replies !   View Related
CODE
<?php 
ini_set('error_reporting', 8191);
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
$a = date('s');
$maximum=10;
$text[1] = "test1"; 
$text[2] = "test2"; 
$text[3] = "test3";
$text[4] = "test4";
$text[5] = "test5";
$text[6] = "test6";
$text[7] = "test7";
$text[8] = "test8";
$text[9] = "test9";
$text[10] = "test10";
$text++;
while($maximum>10){$text[1];}
echo "$text[a]"
?> 

View Replies !   View Related
Db2 Code
This my coding to insert data for first database.

$query = "INSERT INTO mohon VALUES ('','$nama','$bahagian','$tarikh','$masa','$tujuan','$tarikhprj','$destinasi','$jam','$minit','$waktu','$jam2','$minit2','$waktu2')";
$result = mysql_db_query($dbname,$query);

if($result) {
header("Locationapar2");

}
And this is coding to insert data in second database.

$query = "INSERT INTO keputusan VALUES ('$keputusan','$kenderaan','$pemandu','$pagawai','$jawatan',
'$tarikh2','$masa2')";
$result = mysql_db_query($dbname,$query);.

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved