What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Transfering Php code?

Pages: (2): « First [ 1 ] 2 » Last »
Transfering Php code?
Author: Message:
Jhrono
Veteran Member
*****


Posts: 1791
Reputation: 25
33 / Male / Flag
Joined: Jun 2004
O.P. Huh?  Transfering Php code?
Like i'm doing this code...and i want to transfer users to the form when they don't answer all of the values...i did it like this..

code:
<?php>
$a = $_POST['field1'];
$b = $_POST['field2'];
(...)
elseif ($a == 0 && $b == 0) {
echo "Please insert at least one value in the form. You'll be transfered to it again in 5 seconds" };
<?>


What shall i insert in the last elseif to transfer users?

Another question?is there another way to make a value = to nothing?'cause i'm going to make the form default number 0 but people may delete the 0's and click Go, and that won't have a function in the php code:S...to realise what zeros i'm talking about i made them bold...




This post was edited on 04-26-2005 at 03:24 PM by Jhrono.
04-26-2005 02:28 PM
Profile E-Mail PM Find Quote Report
VLenin
New Member
*


Posts: 10
Joined: Apr 2005
RE: Transfering Php code?
use isset() and !empty()

this code sucks, it only creates dirty shit
04-26-2005 02:32 PM
Profile E-Mail PM Find Quote Report
Jhrono
Veteran Member
*****


Posts: 1791
Reputation: 25
33 / Male / Flag
Joined: Jun 2004
O.P. RE: Transfering Php code?
quote:
Originally posted by VLenin


use isset() and !empty()



I'm noob at php so could you give me an example of those working?thanks..

quote:
Originally posted by VLenin

this code sucks, it only creates dirty shit


I hope you aren't talking about my code...You don't EVEN KNOW WHAT IT IS ABOUT...do you think the value name is a and b?and the form values are form 1 and 2?i erased 'cause i'm doing something new...

This post was edited on 04-26-2005 at 02:37 PM by Jhrono.
04-26-2005 02:35 PM
Profile E-Mail PM Find Quote Report
VLenin
New Member
*


Posts: 10
Joined: Apr 2005
RE: Transfering Php code?
hey chill,

<?php>
$a = $_POST['field1'];
$b = $_POST['field2'];
(...)
elseif ($a = 0 && $b = 0) {
echo "Please insert at least one value in the form. You'll be transfered to it again in 5 seconds" };
<?>
is not nice...

ok

use it like this

if (isset($_POST['field1']) AND isset($_POST['field2']) AND !empty($_POST['field1']) AND !empty($_POST['field2']))
{
   echo "ok, form is ok, let's go on!";
}
else
{
  echo "Not all fields are ok, bla die bla";
}
04-26-2005 02:53 PM
Profile E-Mail PM Find Quote Report
Jhrono
Veteran Member
*****


Posts: 1791
Reputation: 25
33 / Male / Flag
Joined: Jun 2004
O.P. RE: Transfering Php code?
But what's the function that tells that one value is empty(like ($_POST['field']) = nothing :S)?i really need that to do some other aspects...
04-26-2005 03:04 PM
Profile E-Mail PM Find Quote Report
VLenin
New Member
*


Posts: 10
Joined: Apr 2005
RE: Transfering Php code?
What do you mean with other aspects? empty only returns a boolean...
04-26-2005 03:10 PM
Profile E-Mail PM Find Quote Report
Jhrono
Veteran Member
*****


Posts: 1791
Reputation: 25
33 / Male / Flag
Joined: Jun 2004
O.P. RE: Transfering Php code?
Guess what?i don't care about your complications rofl...

I'll do it simply with the 0's...who deletes the 0's is an ass..

What i need to know is the transfering function...

This post was edited on 04-26-2005 at 03:14 PM by Jhrono.
04-26-2005 03:13 PM
Profile E-Mail PM Find Quote Report
fluffy_lobster
Veteran Member
*****

Avatar
Posts: -2

Posts: 1391
Reputation: 23
36 / Male / Flag
Joined: Nov 2002
RE: Transfering Php code?
Perhaps you mean $a == 0 not $a = 0.
04-26-2005 03:16 PM
Profile E-Mail PM Web Find Quote Report
Jhrono
Veteran Member
*****


Posts: 1791
Reputation: 25
33 / Male / Flag
Joined: Jun 2004
O.P. RE: Transfering Php code?
rofl sorry my mistake, but read what i said...if someone deletes the 0 and submits it with no value, i need a entity like 0 to change it...'cause no value is simply no value..
04-26-2005 03:23 PM
Profile E-Mail PM Find Quote Report
fluffy_lobster
Veteran Member
*****

Avatar
Posts: -2

Posts: 1391
Reputation: 23
36 / Male / Flag
Joined: Nov 2002
RE: Transfering Php code?
Well both 0, empty and null evaluate as false... so just do elseif(!$a && !$b)
04-26-2005 03:25 PM
Profile E-Mail PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On