php

How to create transparent watermark on an image using gdlibrary?

How to create transparent watermark on an image using gdlibrary in PHP? I water to rotate the image and tile it through out entire image also. Please anyone, could you please upload with examples? ...

dynamically scan pictures in a folder and display using jquery slideshow

guys, anyone know how to scan a folder using jquery or javascript code snippet, after that get a picture file name and embed in <li></li> or <div></div>, i've used php code to read through the folder and loop through the element to display the thumbnails and all, but it's not work well. I've try on galleria, gallerific, galleryView jqu...

PHP file read not working

On a server I have the file some.php. I try to read the contents using file_get_content and fread. Both these don't read my content. If I try some other URL like yahoo.com, these functions are reading the contents. Why does this happen? $my_conetn = file_get_contents("http://example.com"); echo $my_conetn; The above snippet is not w...

SQL Query over three different tables

i got three tables CATS id name ------------------------------ 1 category1 2 category2 3 category3 4 category4 PRODUCT id name ------------------------------ 1 product1 2 product2 ZW-CAT-PRODUCT id_cats id_product ---------------------------...

Results page in other window.

I have this simple form: <form method="post" action"."> <input type="text" name="title"> <input type="submit" name"send"> </form> I want that when a user click on submit, then will be open another window of browser with the results. Is it possible ? ...

Can I get a "base URL" in Wordpress within a template file?

Usually in my PHP apps I have a base URL setup so I can do things like this <a href="<?php echo BASE_URL; ?>tom/jones">Tom</a> Then I can move my site from development to production and swap it easily and have the change go site wide (and it seems more reliable than <base href="" />. I'm doing up a Wordpress theme, and I am wondering...

Help to Understand PHP Code into C#

Hi Gurus, I am a C# guy and got this logic into php from a website. Need to implement the same in C#. $items = array(); while($row = mysql_fetch_assoc($query)) { //parent id $pkey = $row['parent_id']; //child id $ckey = $row['category_id']; //store this $items[$pkey]['children'][$ckey] = $row['categoryname']; } //create our list $firs...

Accessing Node of an XML object

I am trying to access certain pieces of data from an xml file, here is the problem. ###XML FILE <products> <product> .... .... </product> <product> .... .... </product> etc... </products> I know that the piece of data I need is in ($products->product->myProdNode) I have this mapping ...

Working with decimal numbers in PHP

I want to somehow round the numbers for a rating system in PHP like this: 4.6667 = 4.6 5.0001 = 5.0 Is there any way to do that? (BTW, I read the data from a database.) ...

Effective Data Validation

What's an effective way to handle data validation, say, from a form submission? Originally I had a bunch of if statements that checked each value and collected invalid values in an array for later retrieval (and listing). // Store errors here $errors = array(); // Hypothetical check if a string is alphanumeric if (!preg_match('/^[a-z\...

PHP Xpath, help selecting a very specific node

Similar question from last night, I don't have access to edit the source HTML and I am attempting to parse a lot of data from a website to do product price/comparisons against. For the most part, it's working but I am now trying to make it more efficient, faster and easier to read my spaghetti code. I have the following test code; and w...

Best WordPress "contact us" plugin?

I've seen a few, and tried out Contact Form 7, which is pretty good but by default looks quite ugly. I've also had a quick dig, and it looks hard to add some hooks for CSS. It also doesn't use the label element. What is the best standards compliant easy skinnable contact Wordpress plugin in your experience? Update I just found out h...

how to concatenate files according check box selection using system call in php

I have some files in php ,i need to concatenate on basis of selection of checkboxes.if one checkbox is selected concatenate according to requirement and so on.this i have to do using system call ,and i'm working in php and ssh (secure shell client) ...

output txt file with selectbox options in php

I am trying to display two selectboxes in my php page ,where the user can select options from first selectbox to add it to second box and then click a button to generate a textfile with all the options in the second selectbox. Can anyone please help? (IE 7 only please) Here is the code that I tried till now. <html> <head> <script lang...

Openid php library: can't get nickname and other profile info

hello I tried the Openid library. I put openid URL https://www.google.com/accounts/o8/id Looks like it is working fine as it authenticate me, but it doesn t return nickname email and other data as required Thx for any hints about ...

Error or not and insert to database mysql

Why wont this work? <?php include "top.php"; include "connect.php"; if(isset($_POST["submit"])) { $error = ""; if(empty($_POST["name"])) { $error .= "Du glömde märket!<br>"; if(empty($_POST["rating"])){ $error .= "Du glömde att bedömma märket!<br>"; if(empty($_POST["worth"])){ $error...

php check if record exist.

hi all, i found this to check if file exist. is there a way how to check if record exist first? php.net i want to check if record exist first, if exist then do update, else do insert. i do understand how to make a queries for select and insert and i dont have problem with it. if(record exist) { update query} else { insert query}...

preg_replace function to append a string to all the hyperlinks of a page

hi guys, i want to append my own value to all hyperlinks in a page... e.g if there are links: <a href="abc.htm?val=1">abc 1</a> <br/> <a href="abc.htm?val=2">abc 1</a> <br/> <a href="abc.htm?val=3">abc 1</a> <br/> <a href="abc.htm?val=4">abc 1</a> <br/> I want to add next var like "type=int" to all hyperlinks output should be: <a ...

PHP code in embed tag

I'm using embed tag in PHP like this: echo "<embed src='images/meccaAdhan.mp3' name='guitar' id='BGS_ID' autostart='true' loop='false' width='2' height='0'></embed>"; I need to add this code before images: templates/<?php echo $this->template ?> Please guide me how to solved it. ...

Html combo box to database record Id

I'm fairly sure there has to be a simple solution to my problem, but I am a new web developer and can't quite figure it out. On my page I have a combo box whose values are filled from my database. When the user submits the form, how to I go about converting those values back to the record numbers in the database? Up to now I have been ...