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:

<html>
<body>
<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">
</form>

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

ADVERTISEMENT

Else Echo Doesnt Work?

Jan 12, 2011

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*FROMbookingWHEREdate='$mybookingdate'ANDtime='$mytime'ANDride_id='$ride_id'");

[code]....

View 4 Replies View Related

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

May 28, 2011

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 View Related

$GET Doesnt Exist

Apr 4, 2006

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 View Related

Doesnt Iterate

Oct 18, 2005

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

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

{.....

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

View 2 Replies View Related

Doesnt Set Cookie?

Jul 23, 2006

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 View Related

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

Dec 12, 2009

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.

<html>
<head>
<title> More on Variables</title>

[code]...

View 7 Replies View Related

Posix_setuid Doesnt Work

Jul 17, 2005

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.
Configuration:
php 4+mysql 4+apache 1.3.31.
System - FreeBSD 5.3

View 2 Replies View Related

Unlink Doesnt Work

Oct 6, 2005

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 View Related

Set Cookie In IE Doesnt Work In FF

Aug 5, 2005

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 View Related

Info That Doesnt Print

Jun 8, 2004

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'
$result=mysql_query($query);
$row=mysql_fetch_array($result,MYSQL_BOTH);

if($row{$k}!=""){
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 View Related

Script Doesnt Work

Aug 25, 2006

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:

IF:
$AB is On
and
$line is Front Hash or Back Hash

View 14 Replies View Related

GD Library Doesnt Work?

Jul 20, 2008

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

[code]...

View 1 Replies View Related

APC Doesnt Free Memory?

Jan 23, 2011

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 View Related

Filetype Doesnt Work?

Jun 7, 2011

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);
[code]......

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

View 4 Replies View Related

Fsockopen Doesnt Return Anything?

May 20, 2010

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);
[code]...........

View 4 Replies View Related

Link Doesnt Pick Up Id Row?

Aug 28, 2010

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[]='<ahref=portfolio.php?albums='.$row['id'].'><imgsrc="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

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

View 8 Replies View Related

If Page Doesnt Exist

Sep 9, 2007

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

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

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 View Related

Use A Session It Doesnt Display Anything

Nov 5, 2007

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 View Related

Data Doesnt Get Updated

Jul 24, 2007

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 View Related

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

Jul 14, 2010

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
(email,date,source)
VALUES
(?,?,?)";
$today = date("d/m/y");
$source= 'Email Form';

[Code]...

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 View Related

Headers Already Sent - Authentication Doesnt Work ?

Feb 16, 2003

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 View Related

Preg And Why [^word) Doesnt Work?

Jul 17, 2005

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 View Related

Odbc_fetch_array Doesnt Return Any Values

Jan 12, 2006

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 View Related

Include A Function Doesnt Work

Aug 10, 2005

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

<?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 View Related

Cookies Doesnt Appear In Cookie List

May 19, 2006

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 View Related

Php5 - Phpmyadmin Doesnt Work

May 11, 2006

I am useing apache 1.3.x (someing like that) and I Just Installed php 5. And Now phpmyadmin doesnt work. I was reading on php.net and mysql support doesnt com enabled in php 5. How Do I Enable this to allow php and mysql to work together in harmony and not problems.

View 7 Replies View Related

Comparison Operators Doesnt Work

Oct 3, 2007

But here we go: My problem is that the comparison operators fail in some situations.

I've got an input field where the visitors enter a number. I have limited the size of the number to 10 000 by doing the following: Code:

View 6 Replies View Related

Cookies In Subdomain Doesnt Work?

Nov 24, 2010

I got the following code:

<?php
$id = $_GET['id'];
$vote = $_GET['vote'];
[code]....

View 1 Replies View Related

Log In Level Is 5 But MP Doesnt Show Under The Tab Main?

Sep 1, 2009

<?php
session_start();
$username = $_SESSION['username'];

[code]...

Thats my code and Im wanting this link to show:<a href="modpanel.php" target="content">MP</a>.but only if there level is higher than 1, now when I log in my level is 5 but MP doesnt show under the tab Main.

View 6 Replies View Related

Replace - Exclamations From .txt Doesnt Work

Dec 27, 2009

I have just tried 20 combinations from various websites to strip exclamation marks from a .txt document...

nothing works! i tried ereg_replace and preg_replace with / and // and /[!] and /{!}, every suggestion that i could find on the web.

here is the code:

<?
$data = file_get_contents("readme.txt");
$adata = str_replace('!', '', $data);
$bdata = str_replace('!', '', ,$adata);
$handle = fopen("readme.txt", "wb");
fseek($handle, 0);

[Code]...

View 3 Replies View Related

Doesnt Do Anything Update After Click Button?

Jan 10, 2011

<?php
session_start();
include("database.php");
[code]....

Notice: Undefined index: utype in C:\wwwroot\login.php on line 44Notice: Undefined variable: mes in C:\wwwroot\login.php on line 80Another question is when i click on log in button it seem like the php code at the head there didnt do anything.$path will still be empty...why?

View 10 Replies View Related

GD Image Outputs, But Doesnt Save?

Jan 5, 2011

I was wanting to create a "badge" for people to post in forums, websites ect as a means of free advertising for the site.I created a template and added a listing image and text using GD.It outputs great, but wont save. Id rather have the file created once and have them link to the gif thats created rather than call a php file everytime. Also some forums ect dont allow script and the image gets rejected.Heres the code. What do i need to change to actually save the file?

PHP Code:
<?php
header("Content-type: image/gif");
[code].......

View 1 Replies View Related

Update Doesnt Work Properly ?

May 15, 2011

i design this page to edit user's password.in this problem what i do is get the user name into session variable and accordingly i get current password of the user from database and then update new password. but thing is i got data was succesfuly updated message but when i check it in the php admin i stil get the previous results. it seems update is not working properly.here is the code

<?php session_start();
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.[code].....

View 7 Replies View Related

Query Doesnt Update Data?

Aug 3, 2009

$q="updatestudentsetname='".$_POST[a]."',batch='".$_POST[b]."'wherestudentid='".$_POST[studentid]."'";
$r=mysql_query($q);

this query doesnt update data is there any error in query/my insert query is working properly

View 5 Replies View Related

Form Doesnt Show Due To Php Conflict

Oct 17, 2007

I decided to load some of my form via php as it was needed to generate a combo box with infomation from a query.. this is what i have yet it doesn't load up on my browser.. Code:

View 2 Replies View Related

Redirect Different Server Doesnt Work

Jul 18, 2007

i am having a problem with redirect. the page which works fine with my localhost, when copied to a different server doesnt work. the code is below:

<?
session_start();
if(!session_is_registered(myusername)){
header("location:template.php");
}
?>

<html>
<body>
<?php
header( 'Location: showrec.php' ) ;
?>
</body>
</html>

when copied to a differnt server it stops redirecting the page and sits there.

View 2 Replies View Related

Integer Doesnt Subtract Fully

Oct 23, 2007

I have a variable set at 10,800 and im trying to subtract it in my query like here:
$Price = 10,800 in this example.

         $subtractMoney = "UPDATE userregistration SET MoneyInHand=MoneyInHand-'$Price' WHERE UserID='{$_SESSION['Current_User']}'";
$result = mysql_query($subtractMoney) or die(mysql_error());
if (mysql_affected_rows() == 0)
{
die('Error ID 0001A, contact admin on the forums immediately about this error!');
}
But the subtraction is only going down by 10. Not 10,800.. although this 10,800 could be any value this was what i used for this example.

View 8 Replies View Related

Email Validation Doesnt Work?

Jun 24, 2007

How come:

if(!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+.[A-Z]{2,6}$", $email)){
echo 'Incorrect';
}
doesnt work? Tried with things like "name", "name@name.com" and it comes back as valid?

View 1 Replies View Related

Repeat Password Doesnt Work?

Apr 22, 2010

i'm trying to create a form wher user has a fields to enter password and then repeat password if password and repeat password doenst match echo error password doesnt match

this is my password and repeat validation code

$field="pass";//Usefieldnameforpassword
if(!$subpass){
$form->setError($field,"*Passwordnotentered");
}
/*Passworderrorchecking*/
$field="repeatpassword";//Usefieldnameforpassword
if($subrepeat!=$subpass){
$form->setError($field,"*Passworddonotmatch");

[Code]...

View 1 Replies View Related

Search Functions Doesnt Work?

Mar 5, 2011

I am working on a poject, where the search functions doesnt work as the user wishes. The coding is technically correct, but the idea behind it is wrong.Basically at the moment, the script receives this:[URL]...The search script then runs a database query to search the tag coloumn, looking for like $q. This would work, however the structure of the coloumn is tag1, tag2, tag3, tag4.So my resolutions is this so far:I explode the $q variable, via the + (if you search more than one term [URL]..I then count the elements in the array and write the database function accordingly

Code: [Select]$var = @$_GET['q'] ;
$trimmed = trim($var);
[code]....

View 1 Replies View Related

Echo'ing A Large Amount Of Symbols (#"'~/|*&^%!) In An Echo Statement

Nov 29, 2010

How would I go about echo'ing a large amount of symbols (#"'~/|*&^%!) in an echo statement without having to put a backlash at all the clashing ones, specifically " and '?

"`+w"`2x'`!_"`%&+` S%`1a&`&Y+`%\4`(&+`$N!1`+n(`&&"`$#"9`#1#`$R&`"H6`2+#`)9!`"C#`(;"`/x!`0^)`+k"`,T'`.w4`.>%`';(4B`!{!F`!-!` B!64`&U#42`"6$`"e"`02%`-i'`#4#`)]$`$.;`+B*`3d)`#u0`)@#`#o*`#4&`$6!5`)Z-`"k"`&>+`)X#`&h"`$S"`) %`!x!`0;%`//"`$j,`*?!`#k(32%3` 6!48`+U&73`""#61`&u!`(J%` ,"`%P"`+_%7%6D`"p#7`-
[code]............

View 1 Replies View Related

Echo: How To View/call Data From Separate File Into Echo

Jun 27, 2007

I would like to ask about echo "<--statement==>";

Ok my senario let say like this i got a file name as datax01.php & script.php

Let say on script.php i got a code to use echo. So how from echo i can recall datax01.php to view on that script? Code:

View 8 Replies View Related

Wrong Error Line That Doesnt Exist?

Oct 14, 2003

I got the wrong Parse error: parse error, unexpected $ in /web/www/frac/users/ultimadark/train.php on line 104. But i counted the rows three times and i have only got exactly 104 rows in the page, and the 104th row is only </html>. Why do i get that wrong message

View 4 Replies View Related

ADVERTISEMENT