Search found 18 matches

by bobbygerez
Mon Sep 17, 2012 5:36 pm
Forum: PHP General
Topic: Form Select
Replies: 1
Views: 848

Form Select

<html> <head><title>File Input Output</title></head> <body> <?php if (!isset($_POST['submit'])){ ?> <?php $files = file("file.txt"); ?> <form action="file_array.php" method="post"> <select name="name[]"> <?php foreach ($files as $file ){ $file = explode(",", $file); list($name, $address, $age) = $f...
by bobbygerez
Fri Aug 24, 2012 12:42 am
Forum: PHP General
Topic: Addition using form select
Replies: 10
Views: 2139

Re: Addition using form select

Thank you so much... It works well and I really understand. :D
by bobbygerez
Thu Aug 23, 2012 8:03 pm
Forum: PHP General
Topic: Addition using form select
Replies: 10
Views: 2139

Re: Addition using form select

<html> <head><title>Grouping form array</title></head> <body> <?php if (!isset($_POST['submit'])){ ?> <form action="array.php" method="post"> Enter Number: <input type="text" name="value1" /> <br /> Enter Number: <input type="text" name="value2" /> <br /> <select name="options[]" > <option value="+...
by bobbygerez
Thu Aug 23, 2012 1:31 am
Forum: PHP General
Topic: Addition using form select
Replies: 10
Views: 2139

Re: Addition using form select

Still have an error, undefined $c; . Any idea is highly appreciated.
by bobbygerez
Wed Aug 22, 2012 10:01 pm
Forum: PHP General
Topic: Addition using form select
Replies: 10
Views: 2139

Re: Addition using form select

If you wanted to build it that way - you would have to do something like... eval ("$c = $a $op $b;"); Where $op is something like + The only thing is that leaves potential security holes - but as a short example piece of code it shouldn't be an issue. Can you elaborate further NigelRen why it leave...
by bobbygerez
Tue Aug 21, 2012 5:48 pm
Forum: PHP General
Topic: Addition using form select
Replies: 10
Views: 2139

Re: Addition using form select

<html> <head><title>Grouping form array</title></head> <body> <?php if (!isset($_POST['submit'])){ ?> <form action="array.php" method="post"> Enter Number: <input type="text" name="value1" /> <br /> Enter Number: <input type="text" name="value2" /> <br /> <select name="options[]" multiple> <option ...
by bobbygerez
Fri Aug 17, 2012 11:01 pm
Forum: PHP General
Topic: Addition using form select
Replies: 10
Views: 2139

Addition using form select

<html> <head><title>Grouping form array</title></head> <body> <?php if (!isset($_POST['submit'])){ ?> <form action="array.php" method="post"> <select name="options[]" multiple> <option value="+">+</option> <option value="-">-</option> <option value="*">*</option> <option value="/">/</option> </sele...
by bobbygerez
Tue Feb 14, 2012 5:44 am
Forum: mySQL & php coding
Topic: No database selected
Replies: 0
Views: 660

No database selected

function mysql_is_table($db,$tbl){ $line = db_connect(); $tables = array(); @mysql_select_db($db); $q = @mysql_query("SHOW TABLES", $line); while ($r = @mysql_fetch_array($q)) { $tables[] = $r[0]; } @mysql_free_result($q); @mysql_close($line); if (in_array($tbl, $tables)) { return TRUE; } else { re...
by bobbygerez
Thu Feb 09, 2012 6:53 pm
Forum: PHP Scripts
Topic: PHP Session
Replies: 2
Views: 1081

Re: PHP Session

Thanks anyway guys, I have figured it out!

Code: Select all

                session_start();
		$_SESSION['test'] = $_POST['username'];
		header('location:welcome.php');
I keep trying it since midnight but glad I have figured it out.
by bobbygerez
Thu Feb 09, 2012 6:37 pm
Forum: PHP Scripts
Topic: PHP Session
Replies: 2
Views: 1081

Re: PHP Session

I don't know what is going on I tried this code. if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" $_SESSION['test'] = "hi"; header('location:welcome.php'); } welcome.php <?php session_start(); echo $_SESSION['test']; ?> Works fine in chrome but not in mozi...
by bobbygerez
Thu Feb 09, 2012 9:22 am
Forum: PHP Scripts
Topic: PHP Session
Replies: 2
Views: 1081

PHP Session

Hi everyone, I'm having problem how to create session. I've been searching but no luck. if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" session_register("myusername"); session_register("mypassword"); header("location:login_success.php"); } else { echo "Wr...
by bobbygerez
Mon Feb 06, 2012 8:50 am
Forum: CSS
Topic: menu problem
Replies: 2
Views: 2730

menu problem

Hi everyone, a little problem which I think can easily be solve by the expert. I'm really having hard time on this one. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>...
by bobbygerez
Sat Jan 28, 2012 11:56 pm
Forum: JavaScript
Topic: Regular Expression allow alpha characters only?
Replies: 2
Views: 1693

Regular Expression allow alpha characters only?

Hi everyone, I've search google about regular expression that accept alpha characters only and there are alternatives name starts with an upper case letter: var re = /^[A-Z][A-Za-z]*$/ var re = /^[A-Z][A-Za-z]{2,}$/ /* to insist on upper case first letter */ I'm a beginner on javascript and I don't ...
by bobbygerez
Wed Jan 25, 2012 6:14 pm
Forum: PHP coding => General
Topic: regular expression, numbers only with a limit
Replies: 4
Views: 942

Re: regular expression, numbers only with a limit

Explanation is awesome TheProdigyGuy... Thanks and Have a nice day.
by bobbygerez
Wed Jan 25, 2012 2:02 am
Forum: PHP coding => General
Topic: regular expression, numbers only with a limit
Replies: 4
Views: 942

Re: regular expression, numbers only with a limit

Perfect TheProdigyGuy, but I just need a little explanation if you have time. $meint=substr($searchid,$i,1); if (ctype_digit($meint) && substr($meint,$i,1) >=0 && substr($meint,$i,1) <=9){ $result.=(int)$meint; $meint=''; This is the code I don't really understand, If you don't mind but still I can ...
by bobbygerez
Tue Jan 24, 2012 7:41 am
Forum: PHP coding => General
Topic: regular expression, numbers only with a limit
Replies: 4
Views: 942

regular expression, numbers only with a limit

Hi I just want to ask how the user will only input numbers and limit them to 9 numbers. So far this is what I've got but it's not working. it works on string but int+string or string+int it doesn't work. It won't work also the limit of 9. Thanks for your help. if (preg_match("%[0-9]{1,9}%", $searchi...
by bobbygerez
Mon Jan 23, 2012 11:19 pm
Forum: mySQL & php coding
Topic: search string
Replies: 2
Views: 741

Re: search string

Your the men TheProdigyGuy. Work's well, thanks. :D
by bobbygerez
Mon Jan 23, 2012 7:51 pm
Forum: mySQL & php coding
Topic: search string
Replies: 2
Views: 741

search string

Hi Everyone, I'm a newbie to this forum as well as php mysql coding. These days gives me headache by this code. There is no error but if I try to search the complete name it won't appear. If I try to search a single letter then everything with that letter will appeared. I don't really know but I thi...