Internet Computer Mobile Games

Programming Help

10048 Posts - Page 502 of 503

Phalcon php Saving record plus uploads multiple files

Hi: Am not sure if this is the best algorithm to go about  saving a record and uploading (plus moving to another directory) files. I feel i need another algorithm? if (self::post()->isPost()) { #check if there is any file if($this->request->hasFiles() == true){ $uploads = $this->request->getUploadedFiles(); $isUploaded = false; #do a loop to handle eac

php where clause

Hi   I am now on to viewing listings but want to to show listings that are just submitted by that user and display them on their profile page but can't get the WHERE clause working   Below is the coding for what I have   Profile page echo "<p><a href='view-private-listings.php?id={$_SESSION['user_id']}'>View Listings</a></p>"; Add Listing page HTML Submitted By: <input type="text" name="submittedby"> View Listings Page <?php ini_set('dis

Notice/Warning Error When Trying To Get Value From XML.

Hi,   I'm trying to read the 'code' value "2303" from the following XML.   This is currently held in a string called $result. <?xml version="1.0" encoding="UTF-8" standalone="no"?> <epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="x"> <response> <result code="2302"> <msg>Object exists</msg> <extValue> <value> <domain

How to pass data between 3 pages without using submit button

Please tell me how can i do it ??

How to populate combo box (that is already fetched on a database field) on a selected row in table.

Hi Good day Can someone pls help me regarding with this matter. I have a page for inserting records. And I have a combobox that is fetched through the specific field in database. I also have a table of records, for each row i have an href edit which throws the values to its respective texbox and combobox.  THE PROBLEM is that when i click the href edit, the value from a selected row was not displayed from the combobox

script can't upload the large files

<!doctype html> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="content-type"> <title>Untitled Document</title> </head> <body> <form action="upload_image.php" method="post" enctype="multipart/form-data"> <label>select page<input type="file" name="image"> <input type="submit" name="upload"> </label> </form> <?php if(isset($_POST['upload'])) { $image_name=$_FILES['image']['name

Insert NOW() from Array? Escape Issue?

Hi,   I'm currently passing an array of values to be updated in my database, but am struggling on the best way to escape the quotation marks around the NOW statement below, as understand this will only work without them.   This is what is being passed to the DB which does not currently work. I'm seeking some help to find the best way to remove the "" from around the NOW statement, but retain it in the array structure which i believe needs the '' to understand its a value. UPDATE staff

Need help to not resubmit info when refreshing

Hi I made a simple chat script with pagination in MySQL (yes I know I should change to MySQLi) but just bare with me please My script is working fine when I post messages, but I have a problem.. Each time I refresh my page my previous message gets reposted again. Is there maybe a way I can fix this problem? <html> <?php define('TIMEZONE', 'Africa/Harare'); date_default_timezone_set(TIMEZONE); // database connection info $conn = mysql_connect('****','******','*****') or trigger_erro

Securing $_post

Hello,  I am quite new to the php and website scene and i am trying to find the best way to validate and sterilize my $_post the way i have come up with is  $id = filter_var(mysql_real_escape_string($_POST['id']),FILTER_SANITIZE_NUMBER_INT); or $id = mysql_real_escape_string($_POST['id']); $id1 = filter_var($id,FILTER_SANITIZE_NUMBER_INT); which will be the best way to do it or is there a better way.   Thanks 

fancybox error - The requested content cannot be loaded Please Try Again Later

Hi there guys I have a problem that I can't seem to get fixed.   Below Is the code I am using and the Link to the Tutorial:   http://fearlessflyer.com/create-an-awesome-photo-gallery-with-fancybox-and-timthumb/                          <?php  $path =  'http://' . $_SERVER['SERVER_NAME'] . 'moment/uploads/';  $files = scandir('uploads/');  ?>       <ul> <?php foreach ($file

Saving google adsense code in php variable for reuse throughout site?

I have a Google Adsense code that I am saving to the wp_options table. I can successfully save and retrieve the variable containing the google adsense code but it doesn't do anything except display it as plain text on screen.   How can I make this html/javascript in the variable actually load in page as HTML/JS instead of as plain text???     this is the example of the code that I'm saving to the database and retrieving....   <script async src="//pagead2.googlesyndication

Code in Pre Tags Cuts Off

This is my code:   The Form: <div class="tcn02"> <H1>You are Writing this Post</H1> <form action="insert.php" method="POST"> <input class="input_title" type="text" name="title" /> <br /> <textarea id="editor1" type="text" name="post"></textarea> <br /> <input type="submit" name="submit" /> </form> </div> The Query: <?php $title = $_POST['title'];

Bizzar foreach behavior (skipping)

My foreach loop is skipping an element?   How is this possible? echo '<p>-- Begining of Vardump --</p> '; var_dump($EventTotals); echo ' <p>-- End of Vardump --</p> <p>-- Begining of Just echo --</p> <p>'.$EventTotals[1]['TITLE'].'</p> <p>'.$EventTotals[2]['TITLE'].'</p> <p>-- End of Just echo --</p> <p>-- Begining of Foreach --</p> '; foreach ($EventTotals as $DATA); { echo '<p>'.$

Let certain usernames and Messages appear in its own color

Hi I'm trying to make use of an array with usernames in it and want to make use of it to display users with those usernames in a certain color in this case Im trying red.   I've made an array with username in it $admin = array("SYSOP","~cobusbo~"); and I've tried to  print these messages with color with the If function without luck if ($name == $admin) { $name = print '<span style="color:red">' . $_SERVER["HTTP_X_MXIT_NICK"] . '</span>'; } else { $name = print $_SER

Php classes or straight code?

I have been trying to figure out a somewhat complex set of functions to handle some product price calculations and display. I was thinking that building classes may be the best solution, but I don't completely know what I am doing with that either. I was hoping someone may be able to help me figure out the best solution for all this. This site is being built within wordpress. The pages load as follows, 1. Site determines client level: If no user is logged in, it defaults to client_lvl = high, if

PHP variables in a link

Hello everyone, i'm struggeling with posting a link with variables in a table with info i receive from a database.   The variable $url = "http://mtgimage.com/card/$cardname.jpg"; works but the variable $cardname = $row['Name']; doesnt. i dont know what i am doing wrong in that line of code. my actual goal with this is so when i hover over the card name which i receive from the database it shows the image.   This is the actual full file. <!DOCTYPE html> <html> &

Parse error: syntax error, unexpected end of file

Hi, I got this form, but I dont want the form to be displayed if the user has run out of credits.   The page worked until I added the credit check and now I get this error   Parse error: syntax error, unexpected end of file in /Applications/XAMPP/xamppfiles/htdocs/other_items.php on line 269   I know this is because some } are missing, but whenever I move them about, it either doesnt work, or says there is no { to match the } with.  Im really confused now and g

multiple images upload issue

Hi   I am developing a website for fun to play around with, like a little fun project and am trying to work out how to upload multiple images that stores the filename in the database and the actual file on the server   I have managed to get it working if I upload just one image but can't work it out for multiple images   Can anyone point me in the right direction or advise where I need to adjust for multiple images upload   I know on the html form on the input tag needs to ha

Help working out how to process data

Hi, I need to rack some peoples brains!  I have here a script that allows a GSM/ Remote receipt printer to poll for data in a specific format. The issue is that I will be deploying a few 100 of these damn things and need to know what ones are on or off! I can get the time I polls the file and have it writing to a DB table. The only issue is that even with only two printers running its filling up the table fast! Over 600 rows in 30 mins for only two printers!  I need to find out a

Error in PHP Code

I'm getting an error with this code:   <?php // CONNECT TO THE SERVER AND SELECT DATABASE $server = "/home/users/web/b2713/ipg.jimmybryantnet"; $user = "jimmyb29"; $password = "alfiep69"; $dataBase = "guestbook";   $conx = mysql_connect($server,$user,$password); $db_selected = mysql_select_db($dataBase,$conx);   if($conx && $db_selected){ // IF CONNECTION IS ESTABLISHED $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"; $xml .= "<data>\n";   if(isset($_POS

Design Apple Development Security Automobile Network Photography Health Money Travel Shopping Issues Operating systems Drivers Software Programming Tech Home Science Sport Solution