How do I setup data types in php, so that only integer or varchar, etc can be entered on a certain textbox. And if an incorrect value is inputted, a script would appear.
Please, what's the syntax for this?
<form name="form1" method="post" action="new.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="...
In the code below, the privacy_policy.html file has several special characters, including some apostrophes. The function below works fine, however, the contents of the privacy_policy.html file are truncated at the first occurance of the apostrophe.
I'm trying the mysql_escape_string (have also tried "real") to no avail...
$my_pri...
the PHP framework I am using (Kohana) recently implemented the HMVC architecture. I have read that it's a layered mvc where requests are made on top of each other. It is a bit like ajax, just purely server-side. I have applied it a bit on some experiments but I can't apply it to any of my projects (because I can't find a need for it). Ha...
I have some form values that include HTML entities, for example:
<option value="Coupè"> Coupè </option>
However, once the form is posted to the server, if I do a print_r($_POST); and then view the source of the page, the entity isn't there, its the actual accented character.
I suppose I can just run the post data though htm...
I want to create shortened links for specific pieces of content on my site. To view these pages now, I pull the relevant content via the content ID passed via GET (ie, mysite.com/content/?id=332). To obfuscate the ID, I want to use base64 to encode and decode it into a short alphanumeric string (like 34sa6), which I already know how to d...
I've built the following query programatically, but I have confirmed the query as being what is sent through the MySQLi query function.
SELECT * FROM `movie_cast`
JOIN `movie_x_movie_cast` ON
`movie_id` = "7" AND `movie_role_id` = "2" AND `movie_cast`.`id` = `movie_x_movie_cast`.`movie_cast_id`
ORDER BY `surname` DESC
The p...
Hey guys How do I use the PHP variable $contact['id'] in my ajax call? I'm trying to create a page that retrieves all notifications associated with a user. When the page load I already know the id of the user, how do I use this parameter in my ajax calls from the beginning? At the moment I am using the php preprocessor by splitting up th...
Hi,
I am having a problem with saving a file from a response to a POST request.
I am using Google Charts API to create a chart using a POST request. I am then trying to save the result as an image.
I am following the API documentation as described here: http://code.google.com/apis/chart/docs/post_requests.html
Here is my code:
$file...
Hello,
Currently I am using YOURLS PHP URL shorterning script.
In their functions.php, seems like they support both redirection which is with PHP header location and javascript.
Functions.php
I want to redirect with javascript, which will show me the message before redirect. I found this coding inside functions.php
// Redirect to ...
I have set up Sphinx to index three tables in a MySQL database, each to its own index.
The problem I'm having is that it doesn't return which index each match belongs to, so unless I'm searching an individual index, the results are fairly useless.
The search app included with Sphinx displays the index along with the matches, is there a...
I couldn't find a proper documentation on how to call a stored procedure using ADODB in PHP. Can someone help please?
This is what I have now and I feel it's a dirty approach (or not?):
$stmt = "CALL LocFillData('foo', 'bar', @nullcount, @totalcount)";
$rsstmt = "SELECT @nullcount, @totalcount";
$rs = $db->Execute($stmt);
$rsstmt = $db...
I am using Adodb and Postgresql. When I insert a row, it increments the ID field using SERIAL.
Is it possible to return the newly created ID number right after the insert?
...
switch($_GET["action"])
{
case "add_item":
{
AddItem($_GET["ids"], $_GET["qty"]);
ShowCart();
break;
}
default:
{
ShowCart();
}
function AddItem($itemId, $qty){
$result = mysql_query("SELECT COUNT(*) FROM cart WHERE cookieId = '" . GetCartId() . "' AND id = $itemId");
$row = mysql_fetch_row($result);
...
Im having problem in importing hotmail contacts from hotmail in php it simple give the erorr message : Error code not found
Please tell me what im doing wrong. I want this to be working.
Im using thew msn_contact_grab.class.php
and iam calling as :
<?php
include('msn_contact_grab.class.php');
$msn2 = new msn;
$returned_emails = $msn2...
I am new to SQL, and have two tables that hold data(I am using Adodb). They both have keys that connect them together, so I wanted to select a name from the first table if that has a parent id in the second table. I am using:
$db->GetCol("SELECT x_ast.name FROM x_ast, x_ast_tree WHERE x_ast_tree.parent='$parent_id'");
This returns a...
As recommended in a previous question of mine, I am using the PHP Simple HTML DOM Parser
as a way to search an HTML document and grab contents from a specific element (in my case, a textarea). I was wondering if anyone had used this before and was able to give me any advice for my problem (or recommend another solution). The code I'm usi...
Hello
I'm trying to find some kind of PHP framework that allows me to do some "database oriented programming". I mean something like Clipper and MS Access (I never used them, just heard about, so I might be a bit off).
Basically, the idea is that I create a database with a table "customers", for instance, containing ID, Name, Address an...
i have a little problem here!!
after i submit my form,
based on php response i want to execute another javascript or ajax function!
this is my form:
<form id="uploadForm" onsubmit="ytVideoApp.prepareSyndicatedUpload(
this.videoTitle.value,
this.videoDescription.value,
this.videoCategory.value,
this.videoTags.v...
I Need some serious help guys i got locked out from my sever, some hacker change my password however he wasnt able to hack the root account i still have access but its not enabled in ssh so i need access to my account in linux i only have access to http on my server i want to know how possible i can change my password via php.
i am havin...
My brother turns 21 in a couple of weeks and my parents and I are taking him to Las Vegas. For my 21st, I brought $200 to gamble in Vegas and came home with around $450, mostly from playing craps. I plan on bringing $200 again for this trip and before I go I thought I'd run some craps simulations to see if I can double my money again.
I...