Doesn't Echo Anything

Dec 22, 2005

If you look at the code, theoretically if you check the three checkboxes and then submit it should echo "a,b,c" but it doesn't echo anything. If you uncomment the commented code, though, that code works just fine. Why is this? Code:

<form name="test" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<input type="checkbox" value="a" name="test[]">
<input type="checkbox" value="b" name="test[]">
<input type="checkbox" value="c" name="test[]">
<input type="submit">

$imploded = implode(",", (array)$_POST['$test']);
echo $imploded;//value,value,value if all are checked

View 3 Replies


Else Echo Doesnt Work?

in code below I have a section where users can check seat avillability, however it shows the seats taken but it doest say the seats available, can u help me find out whats wrong?

$checkavailability=mysql_query("SELECT * FROM booking WHERE date='$mybookingdate' AND time='$mytime' AND ride_id='$ride_id'");


View 4 Replies

Database - Echo Variable1, Pause And Echo Variable 2 Then Echo The Rest Of Variable1?

let's say that i have this simplyfied code:

$sql = dbquery("SELECT * FROM videos WHERE views > 4 ORDER BY id DESC LIMIT 0,10 ");
while($row = mysql_fetch_array($sql)){
$url = $row["url"];
$title = $row["title"];
$list ='<div><a href="'.$url.'" >'.$title.'</a></div>';
$ad ='<div>something here</div>';

echo $list;

instead to display a list of 10 divs, i want to echo 5 divs from $list, echo $ad then echo the rest of the $list

How can i do this?

Later edit :

Now, i have a problem with my template, and i don't know how can i add to every X number of $list divs, class="nomar"?

View 1 Replies

$GET Doesnt Exist

A while back, when I was using PHP4 with IIS, I had a problem getting my PHP scripting to pickup the post data via GET and POST. I solved it by going into the php.ini and setting register_globals to On.

Now Im working on PHP 5 with Apache. I m having the same problem, my scripts are definetley not picking up the posted variables, like $GET and $POST dont exists no matter how many times I submit. I have gone to the php.ini and changed the register_globals value to ON but still nothing is happening, have I missed anything out?

View 2 Replies

Doesnt Iterate

I'm trying to do write a multiple update routine but its not looping , just runs once and stops.

if (isset($num)){
while ($i<=$num){
($result = mysql_query ("UPDATE data SET valid = '$valid' WHERE id = '$id' "));
echo ("<P><center> Successfully validated<center></P>


BTW, $num is valid and comes from data in other part of the script.

View 2 Replies

Doesnt Set Cookie?

for some reason, i was switching my system from sessions to cookies, and well, my login will not set the cookie, Code:

View 2 Replies

Get The First 'IF' To Run, But The Else If Doesnt Seem To Want To Work?

im new to PHP and this is my attempt at a very basic login authentication. i can get the first 'IF' to run, but the else if doesnt seem to want to work LOL. i wonder if any one can help with this please?i will post the form first.. .. this is called test.

<title> More on Variables</title>


View 7 Replies

Posix_setuid Doesnt Work

I've got problem with posix_setuid().
I've compiled php with --enable-posix.
Everythin like posix_getpwuid() works fine
except posix_setuid and posix_setgid.
php 4+mysql 4+apache 1.3.31.
System - FreeBSD 5.3

View 2 Replies

Unlink Doesnt Work

i have this image "a.jpg" under directory "image/product/a.jpg". whenever i do unlink("image/product/a.jpg");. it says that permission denied... i dont know why i have done chmod("image/product/a.jpg",0777) before i do unlink. anyone know why?

View 2 Replies

Set Cookie In IE Doesnt Work In FF

i am facing problem in Firefox which is working fine in IE.

This code doesnt set a Cookie in FF but it does in IE..

$id = $_POST['sendmobID'];
$var = $_POST['vote'];

setcookie ($id+1, $id, $time + 7776000);

header("Location: specs_".$var."_".$id."");

so what could be wrong?

View 1 Replies

Info That Doesnt Print

I am querying a table and i dont want to print some information if the table doesnt contain any information. my code:

$query="SELECT * FROM items WHERE name='john doe'

echo 'I should only be here if $row{$k} not empty'
echo $row{$k};

This will sometimes print even when $row{$k} contains nothing. The table value it is returning should be null or empty and therefore shouldnt print anything? Is it carriage returns or something? When I view the HTML source it will print a new line where the $row{$k} is at.

View 1 Replies

Script Doesnt Work

if ($AB == 'On') {
if ($line == 'Front Sideline') {
$yc = 204;
if ($line == 'Back Sideline') {
$yc = 85;
if ($line == 'Front Hash' || $line == 'Back Hash') {
$yc = 206;

For some reason,this part of my code is causing me problems. I know this,because I tested it over and over and figured out THIS is where the problem is coming from,and nowhere else. the script doesnt work

The problem is this:

$AB is On
$line is Front Hash or Back Hash

View 14 Replies

GD Library Doesnt Work?

I compiled php at my suse server with the following lines:

checking for OpenSSL version... >= 0.9.6
checking for CRYPTO_free in -lcrypto... (cached) yes
checking for SSL_CTX_set_ssl_version in -lssl... (cached) yes


View 1 Replies

APC Doesnt Free Memory?

Since i installed the APC and am using it for a file upload with progress display, the memory use of my server exploded, it seems that every uploaded file keeps in the memory forever.

View 1 Replies

Filetype Doesnt Work?

How to get file type in php?I had tried following codes

$attachment_path = "/views/default/helpcentre/check_attachment/wildryan.jpg";
$file_type = filetype($attachment_path);

File type is not returned. if there is any error in my codes

View 4 Replies

Fsockopen Doesnt Return Anything?

I am modifying a PHP db wrapper for the redis database.Here's how my function looks:

public function connect() {
$sock = @fsockopen('localhost', '6379', $errno, $errstr, 2);

View 4 Replies

Link Doesnt Pick Up Id Row?

i have a album gallery which when user click on an album displays the pictures within that album the link sort of.. results on the url is portfolio.php?albums= but why it doesnt display the row ID which is meant to be like this portfolio.php?albums=1

PHP Code:
$gallery_html[] = '<a href=portfolio.php?albums='.$row['id'].'><img src="folder.gif" class="directory"><br />' .addslashes($list[$i]['album_name']). '</a><br />' .$delete_link. '</li>';

why is not picking up the the ID it picks up the portfolio.php?albums=

but its meant to be like

or anything depending on the ROW ID
<a href=portfolio.php?albums='.$row['id']. but it doesnt

View 8 Replies

If Page Doesnt Exist

I did the mistake of writing my whole website on one index page

The problem is, each page uses
if ($_GET['pg']==page){

But if it is not a page, it doesn't execute anything. and the whole site is messed up. Is there anyway to make it so if $_GET['pg'] is not a valid page, then go to a 404 script?

View 4 Replies

Use A Session It Doesnt Display Anything

I have an index.php page that I have a login form on. I have another page (login.php) that checks to see if the username and password is valid from my database.

The login.php redirects them back to the index.php page. Instead of the login form, i want it to say something like hello <username>.

someone told me to use sessions but every time i try to use a session it doesnt display anything. I dotn know if the variable is beign carried over or if its even possible to be carried over to a different php page.

I have the start_session() thing on top of each of the pages. I define the $_SESSION['user'] variable on the login.php page but when i get redirected back, it doesnt have a value and its not showing up.

View 5 Replies

Data Doesnt Get Updated

I am working on a club software which will allow me to manage players and get a list of all the registerd players, i can add, get list of all of the players, but when i try to modify any one of them i cant .

View 13 Replies

Inserting A Value Into SQL Where The Value Doesnt Already Exist?

I have created a statement that works fine now, taking the value from a form and inserting into a MS SQL table. I now want to expand the code, to only insert when the value doesnt already exist. My Current Code is as follows:

Code: [Select]$tsql = "INSERT INTO email_supp
$today = date("d/m/y");
$source= 'Email Form';


My main problem here is I dont really know how the value is taken from the form, I know its within this part (array($_POST['emailopt']) but If i wanted to just specify the value to a variable my PHP seems to then fall over.

View 2 Replies

Headers Already Sent - Authentication Doesnt Work ?

I tried ur method but it keeps on telling me headers already sent. Still the authentication doesnt work ?. Does anyone have another method preferably one tailored to the one i displayed or doesnt include a class or function.

View 1 Replies

Preg And Why [^word) Doesnt Work?

I was trying to write a script to replace some text inside some tags.

Lets say I had <tag stuff=stuff><tag stuff=otherstuff><another>

I wanted it to find all the <tag and remove them.

So I tried to write it so that it would go forward until it reached
[<^another] came. But when I tried that it would respond to another as
single characters and not as the word.

How can I do this with regular expressions, matching up against words using
[^ ] ?

I know I can do what Im trying to do other ways, but when it didnt work with
[^ ], it got me thinking about how to do it that way. Because there might
come other times when I want to 'NOT' against a word, and there has to be a
way of doing this with Regular expressions?

View 2 Replies

Odbc_fetch_array Doesnt Return Any Values

My problem is odbc_fetch_array returns no value at all, but the scripts returns no error and all i can see in the page is the html table without any data in it..

the connection to oracle via odbc works, and in my other scripts i used odbc_fetch_row to retrieve data, but this one is kinda slow in getting massive amount of data from oracle. im now testing which is faster, odbc_fetch_row or odbc_fetch_array? but odbc_fetch_array returns no value at all. PHP Code:

View 1 Replies

PHP Tags Doesnt Work When CSS Applied


View 2 Replies

Include A Function Doesnt Work

I have this big spaghetti code (my first real PHP project) file and I want to move my functions out of the big ass 12k php file. Well. I moved a function called "listprojects" to listprojects.php

function listprojects($conn) {
. . . .function stuff

. . . and in the main program I put the include statement . . . .

include "listprojects.php";

but when I run the program in the browser nothing happens. The files are in the same directory by the way .

View 3 Replies

Cookies Doesnt Appear In Cookie List

hi, what's wrong in the next code? The cookies doesnt appear in cookie list, cookies are enabled for sure.

if (blabal) {
} else {
$status = "ok";
$newdata2 = "1:5689741";
setcookie ('userdata', $newdata2, $time+604800);header("Location: login.php");

This piece of code appears above all html, and I run the script at the localhost at my own computer, there are other cookies set on localhost.

View 6 Replies

Copyrights 2005-15, All rights reserved