php

how to insert this javascript in php

how to insert this javascript code : thejavascript <A HREF="javascript:void(0)" onclick="window.open('welcome.html','welcome')"> </A> inside img src in php <img src="http:'.$iv[$j].'.jpg" height="220" width="200" alt="Image '.ucwords($kw).'" "thejavascript"> Thanks ...

PHP Checkboxes in an array

All, When a form gets posted, I get some checkbox values like the below: Array ( [chk0] => true , [chk1] => true, [chk3] => true, [chk1002] => on, [chk1005] => on ) Using PHP,How can I construct a JSON request like this by using the above variables? "data": [ { ...

how to insert multiple array into database using PHP

I need help. What seems to be the problem with our php codes? We can't seem to insert our data into our database. I'm just a beginner and I'm tasked to store multiple data into multiple arrays into our database. What we're actually doing is to enter a number (ex: 5) and 5 forms should show within that page. each form would consist of nam...

Whats the easiest site search application to implement, that supports fuzzy searching?

I have a site that needs to search thru about 20-30k records, which are mostly movie and TV show names. The site runs php/mysql with memcache. Im looking to replace the FULLTEXT with soundex() searching that I currently have, which works... kind of, but isn't very good in many situations. Are there any decent search scripts out there...

PHP - How to use arrays for form input and update respective database records

I'm new to PHP... I want to know how to populate a form from mySQL. I'm stumped at the input section where I am trying to allow the user to select choices for radio button /checkbox for each record. thanks in advance for anyone's help! TC Here's a snippet of my code: <?php $mQuantity = 1; $con = mysql_connect("localhost","t","c");...

PHP syntax question, Zend Framework view script dilema...

So I want to use a jQuery tab container in my view script. I have tested it so I know I already have everything working. <?php $this->tabContainer()->addPane('container-name', 'label', 'content goes here'); ?> <?php echo $this->tabContainer('container-name'); ?> But this is the content that I want to put into the pane: <?php if (coun...

Can projects using PHP framework operate standalone?

Hello everyone, I am interested in the PHP framework, especially by symfony and ZendFramework, but I am not sure of one thing: I saw the need to type command lines to create a project with these frameworks. Ok, but once the project is finished, is it possible to move files to another server without installing anything (except for Apache...

Concatenate Smarty Variable with a String in tpl

I have assigned a smarty variable as such in my php file: $smarty->assign('companyname', $_SESSION['companyname']); How to mix regular html string with smarty variable? I want to do something like: <a href="/${companyname}/hello" class="mainMenu"/> But the smarty template engine fails to evaluate properly the variable companyname ...

Fsockopen times out on isps server

Hi, I have an apache server sunning at home for test purposes and I have an account with a uk isp. When using fsockopen on my home server everything works fine, I can connect on different ports (I am using specifically 25 for testing a mail server) but when I upload my site to my ISP then I can no longer connect using fsockopen - it jus...

PHP [OOP] : Memory allocation for Inheritance

Please see the code bellow: class A { public x = 5; public y = 6; public z = 7; } class B extends A { public m = 1; public n = 2; } $a = new A(); $b = new B() From the above code let $a is allocating x amount of memory and $b is allocating y amount of memory; Now my question is which one is correct from bellow? ...

show error for PostgreSQL

I am new to PostgreSQL, until now I have used MySQL, so when I wanted to see an error from a query sent from PHP I would use; mysql_query("....") or die (mysql_error()); is there a similar function in PostgreSQL as it seems I cannot find it. ...

phpUnit config options

what do the following options mean or whats it for <log type="coverage-html" target="./log/report" charset="UTF-8" yui="true" highlight="true" lowUpperBound="50" highLowerBound="80"/> yui: i guess it means use stuff from yahoo ui to make it look good? highlight: maybe have some colors? lowUpperBound, highLowerbound: whats these? ...

Using MySQL views in PHP applications

Hi, I have a three tables in an application and I need to perform a query which joins all three of them on a regular basis. Chances are that all three of these tables will be updated often. I'm considering using a view to avoid having to use the verbose join syntax in several places within my code. Would this be a suitable options? ...

how to embed/stream internet radio on a website?

Hi there, I can use, for example, something like <object id="MediaPlayer" width="300" height="50" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Live Player components..." type="application/x-oleobject" CODEBASE="http://activex.microsoft.com/activex/controls/ mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"> to...

Is GOTO in PHP evil?

I recently found out that PHP 5.3 supports new language construct called GOTO. Everybody knows what it does. However, it's not exactly the traditional GOTO, it's just a jump label. I'm interesting in knowing whether this GOTO is evil and implies bad code? ...

Sorting a list by references

I have a table containing (essentially) three columns - id, name, ref_id. I would like to create an indented list where the columns with ref_id would be indented below the column with the corresponding id, for example: Name | ID | Ref ID about 1 0 story 2 1 history 3 1 contact 4 0 help 5 0...

.htaccess redirection

Hello I want to have some redirection made by .htaccess file: Some examples mysite.com/accepted -> mysite.com/index.php?type=accepted mysite.com/waiting -> mysite.com/index.php?type=waiting mysite.com/cancelled -> mysite.com/index.php?type=cancelled & mysite.com/edit/2 - > mysite.com/admin.php?edit=2 ETC. for all numbers possible ...

How to save an XML file on server with haXe PHP?

I am just starting out with haXe development, and wanted to give the PHP side a go, but am already a little confused. What is the best way to save some form data to XML files in a folder on a server with haXe compiled to PHP? ...

regex on an array to rename keys

Hay all, i have an array Array ([near_prescription] => Array ( [go_to] => inter_selection [distance_right_sph] => 0.00 [balance_right] => [distance_right_cyl] => 0.00 [distance_right_axis] => [distance_left_sph] => 0.00 [balance_left] => [distance_left_cyl] => 0.00 [distance_left_axis] => ...

Resize Problems

I am having 3 iframes acting as a textbox. And 3 divs in which the text written in iframe will appear it is working. I used drag Resize script also for Resizing Div. it is also working. The Problem is that when i am typing something in iframe, then I can't Resize div. Please Provide solution for it. I am stuck up with this problem. or gi...