
spaceman12
Members-
Posts
73 -
Joined
-
Last visited
Never
Everything posted by spaceman12
-
echo out with line breaks and paragraphs set
spaceman12 replied to spaceman12's topic in PHP Coding Help
wont "\r\n" used in the php mail fucntion help here? -
echo out with line breaks and paragraphs set
spaceman12 replied to spaceman12's topic in PHP Coding Help
$selectSUP="SELECT * FROM member_support WHERE Ticket_ID='$_GET[TID]'"; $locateSUP=mysql_query($selectSUP); while($fetchSUP=mysql_fetch_array($locateSUP)) { $status=$fetchSUP['Status']; $date=$fetchSUP['Date']; $subject=$fetchSUP['Subject']; $type=$fetchSUP['Type']; $message=$fetchSUP['Message']; } echo "Ticket ID"." ".":"." ".$_GET['TID']."</br>"; echo "Status"." ".":"." ".$status."</br>"; echo "Opened On"." ".":"." ".$date."</br>"; echo "Type"." ".":"." ".$type."</br>"; echo "<br></br><br></br>"; echo $message; -
hello guys, suppose I want to echo out the text given below exactly as what has been set against, including the line breaks. How do I do it? coz each time i did it so, there s no line breaks but the output is usually a dense lump of words with no paragraphs. I took her out it was a Friday night I wore cologne to get the feeling right We started making out and she took off my pants But then I turned on the TV And that's about the time she walked away from me Nobody likes you when you're 23 I'm still more amused by TV shows What the hell is ADD? My friends say I should act my age What's my age again? What's my age again? please help P.S. The whole set of phrase give above are treated as a single variable coz I use a WHILE loops when making an echo. tthanks
-
Please help - mysql syntax error in the insertion
spaceman12 replied to spaceman12's topic in PHP Coding Help
I'm just into programming like some few days ago. Thank you so much,, you guys are such very wonderfull people -
Guys, I'm not at all able to insert characters like " ' ` and all sorts into my database or it will always return an error. I just created a textarea field in my site of which I just want to istore all those collected datas into my database for later retrieval and all sorts. Please help!
-
header() not working : so simple a case but help needed
spaceman12 replied to spaceman12's topic in PHP Coding Help
Oh I only know that one when you said so. Alot of thanks to you -
header() not working : so simple a case but help needed
spaceman12 posted a topic in PHP Coding Help
<?php session_start(); if(!isset($_SESSION['User'] )) header('Location : error.php'); ?> im not being redirected even when the $_SESSION['User'] is not set neither does it display any error message other than a white blank space. Please help me som1 as how I can make this to work or suggest any other altenatives so as to get it redirected as i dont want anonymous users to access some contents unles he logs in as members. Thanx -
if u r working on to pass variables from pages to pages, u got to always use the suffix ? at the end just after .php no matter the directory ur file is placed in. For instance, /home/strana/index.php?strana= like this. When $_GET is not set n u want to execute another function, use !isset()
-
<?php if (isset($_GET['your_variable']))?> <a href=index.php?strana=<?php echo $_GET['your_variable']; ?> >your link</a>
-
PHP - Generating unique number for database field
spaceman12 replied to spaceman12's topic in PHP Coding Help
Those generated numbers will serve as a primary Identification code for all users and it should be auto generated by the server itslef. All the number so generated will bear a modulo of some number which i can set it later on but what i'm trying to do at this stage is to abstain the events of recording the same value of number in the database field. -
Hey guys, I m not yet an experienced coder. SO faced alot of problems. Here, I'm trying to generate a UNIQUE RANDOM NUMBER set between two numbers. Repetative occurance must be avoided by all means as I want every number so generated bears a unique value. In other words, every values that made entry into the field of my database should be differant from each others. <?php $conN=mysql_connect("localhost","root",""); if(!$conN) { die('error'.mysql_error()); } mysql_select_db("freebie_allusers",$conN); $UIN=mt_rand(1,5); $locateUIN="SELECT UIN FROM user_info WHERE UIN='".$UIN."'"; $fetchUIN=mysql_query($locateUIN); $resultUIN=mysql_num_rows($fetchUIN); if($resultUIN>0) { WHAT CODE IS REQUIRED HERE SO AS TO GENERATE UNIQUE RANDOM NUMBER? } else echo $UIN; ?> Thanx in advance
-
HELP- PHP generating weird problem working with the Operator
spaceman12 replied to spaceman12's topic in PHP Coding Help
in one way, !ISSET() totally depends on cookies stored on your browser. It doesnt return you the right values after multiple execution of the ISSET function. empty() is much more reliable.... Anyway thanx for the help SOLON -
HELP- PHP generating weird problem working with the Operator
spaceman12 replied to spaceman12's topic in PHP Coding Help
OMG! I clear and flush out all my cookies on my browser and now it seems to be working good again... whats going on around?......lol -
HELP- PHP generating weird problem working with the Operator
spaceman12 replied to spaceman12's topic in PHP Coding Help
<?php $IP=$_SERVER['REMOTE_ADDR']; $Date=date('d/m/Y'); $proID=$_GET['proID']; $ref=$_GET['ref']; $Name=$_POST['Name']; $Email=$_POST['Email']; $Country=$_POST['Country']; $Username=$_POST['Username']; $Password=$_POST['Password']; $Con_Password=$_POST['Con_Password']; if(!isset($Name)) { header ('Location: reenter.php'); exit(); } if(!isset($Email)) { header ('Location: reenter.php'); exit(); } if(!isset($Country)) { header ('Location: reenter.php'); exit(); } if(!isset($Username)) { header ('Location: reenter.php'); exit(); } if(!isset($Password)) { header ('Location: reenter.php'); exit(); } if($Password != $Con_Password) { header ('Location : reenter.php'); exit(); } $conN = mysql_connect("localhost", "root", ""); if(!$conN) { die('Could Not Connect'.mysql_error()); } mysql_select_db("freebie_allusers", $conN); $locateE="SELECT Email FROM user_info WHERE Email='".$Email."'"; $fetchE=mysql_query($locateE); $resultE=mysql_num_rows($fetchE); if ($resultE>0) { header ( 'Location: reenter.php'); exit(); } $locateU="SELECT Username FROM user_info WHERE Username='".$Username."'"; $fetchU=mysql_query($locateU); $resultU=mysql_num_rows($fetchU); if ($resultU>0) { header ( 'Location: reenter.php'); exit(); } $UIN=mt_rand(1,3); $locateUIN="SELECT UIN FROM user_info WHERE UIN='".$UIN."'"; $fetchUIN=mysql_query($locateUIN); $resultUIN=mysql_num_rows($fetchUIN); if ($resultUIN>0) { $UIN=mt_rand(5,7); $locateUIN="SELECT UIN FROM referral_system WHERE UIN='".$UIN."'"; $fetchUIN = mysql_query($locateUIN); if($fetchUIN=1) { $uinField="ALTER TABLE `referral_system` ADD `".$UIN."` varchar(10) NOT NULL, ADD `Date".$UIN."` varchar(10) NOT NULL"; $createField=mysql_query($uinField); if($createField=1) { if(isset($ref)) { $userRef="INSERT INTO referral_system(`$_GET[ref]`, `Date".$_GET[ref]."`) VALUES('$UIN', '$Date')"; mysql_query($userRef); } else { mysql_query($uinField); if(isset($ref)) { $userRef="INSERT INTO referral_system(`$_GET[ref]`, `Date".$_GET[ref]."`) VALUES('$UIN', '$Date')"; mysql_query($userRef); } } $userInfo="INSERT INTO user_info(Name, Email, Country, Username, Password, UIN, IP, Date) VALUES('".$Name."', '".$Email."', '".$Country."', '".$Username."', '".$Password."', '".$UIN."', '".$IP."', '".$Date."')"; mysql_query($userInfo); echo "INSERTION SUCCESS"; } } } else echo "MORE CODE TO BE INSERTED"; ?> -
HELP- PHP generating weird problem working with the Operator
spaceman12 replied to spaceman12's topic in PHP Coding Help
But what it wonder me most over of all the above is- **the script worked quite fine before the alteration( putting exit; at the end of each if() function.) **After the alteration, !() operator lost out its significant function **EXIT; dropped off from the script and restore back to what it was before. **! operator lose out its function forever PROOF? if($Password != $Con_Password) { some code } The above code failed to return the values it actually should; -
HELP- PHP generating weird problem working with the Operator
spaceman12 replied to spaceman12's topic in PHP Coding Help
CONCLUSION - !ISSET dont recognize my $_POST['Name'] and always return some values even if contained nothing within it. <?php if(!isset($_POST['Name'])) { echo "no values set"; } else echo $_POST['Name']; ?> This is obvious from the code above. When you enter some info in the field "Name", you always got to see it printed when the code is executed. However, When nothing is filled in and the submit button is clicked, inspite of printing it back the "NO VALUES SET", you always got to see a WHITE BLANK PAGE which violates the !() operator function and this imminently gives us the fact that the $_POST is set with atleast some values even if it is a WHITE SPACE. -
HELP- PHP generating weird problem working with the Operator
spaceman12 replied to spaceman12's topic in PHP Coding Help
I prefer to use $Name to $_POST['Name'] because it is less troublesome when inserting the data to the database. Also, the check is focused on $_POST and it has been declared on top of my code that $Name=$_POST['Name']. I can drop down the tag $Name off from my script should the ISSET has its functions started to impact on $_POST if that is what triggered to cause UNKNOWN errors. However, as you now see that both the cases does failed as in my case. :'( -
HELP- PHP generating weird problem working with the Operator
spaceman12 replied to spaceman12's topic in PHP Coding Help
Thanx SOLON, Well, sorry to put the ; at the end of one of my php command line. With special reference to your comment above, yes they do work well but the ISSET has to have its function focussed on $_POST and not that the $Name has to be necessarily left as empty. however, if(empty($_POST['Name'])) this seems to be working fine and i can substitute with it but the problem is that it completely ignores all the operators embedded in my code down below. At the initial of testing period, they are 100% working fine. The problem started eversince when I alter the IF() function with EXIT; . Also, I use multiple IF() function in my script. Now, i begin to wonder if the php has to do with some virus as well. -
HELP- PHP generating weird problem working with the Operator
spaceman12 replied to spaceman12's topic in PHP Coding Help
Hello salon, Thank you for the fast reply. I removed $Name and replace with the $_POST['Name'] within the parenthesis of the isset function. Its still fails to yield any positive result. To make it sure that the !ISSET function is working normally good, I have even tested this out - <?php if(!isset($_POST['Name'])) { echo "no values set" } else echo $_POST['Name']; ?> Very strangely, the output code for this is BLANK WHITE PAGE even though nothing is been entered into the field titled "Name". -
Hello guys, this is so weird, very weird indded! PHP is generating some strange problem here over with me. Below are a short context of code that I have used to make a registration script. At the first inititial stage of code testing, everything goes well so smooth according to the plans. Then, I insert the function at the end of each so as to curtail off completely from further execution of the script below and thereafter. Then, suddenly all the !ISSET values stop to functions. I then removed exit(); function off from my code and restore back to the last known good working stage of my code. But it seems like the ISSET function accompanied with the !(stop operator) cease to fucntion any more ever since then even though the script exhibit the same code when it was working normally good. It makes me wonder and now i'm totally frustrated, Please help!!! Now even all the operator values like ==, !=, <, > doesnt work anymore!!! P.S. I know someone would suggest me to write ......... in this format instead of but as i mentioned it earlier, i'm able to execute the script using the later one as desired in accordance to what is planned.
-
HELP - PHP form submission with auto responder built in
spaceman12 posted a topic in PHP Coding Help
Can anyone please help me write out a php script exactly as described below? In the submission form, users are required to filled in two infos,.. Name and email address. As soon as the 'submit' button is been clicked, the php script should be able to grab the filled infos and stores it on the server in a txt file and at the same time, it should sends out confirmation email to the email address so filled in the submission form. Also, can anyone devise a method as how to retrieve the message body of the confirmation email from the previous php script and then pass it on again to the display of the next page as when the submission button is clicked? Thank you so much in advance.