Search found 42 matches

by MarioParty
Sat Feb 08, 2014 10:36 am
Forum: PHP coding => General
Topic: array and objects
Replies: 0
Views: 354

Re: array and objects

Code: Select all

$array = array(); // Store the array in question in this variable
$post_id = $array['events']['1389348000']->post_id; // 599
 
by MarioParty
Sat Feb 08, 2014 9:42 am
Forum: PHP General
Topic: [Help] Login system
Replies: 0
Views: 438

Re: [Help] Login system

Nothing wrong, you just need to check that the variable has been defined, otherwise PHP can't access it.

Replace

Code: Select all

if ($_POST['submit']) {
with

Code: Select all

if (isset($POST['submit'])) {
by MarioParty
Sat Dec 28, 2013 3:31 pm
Forum: PHP coding => General
Topic: Isset function
Replies: 1
Views: 686

Re: Isset function

http://www.php.net/isset http://techtalk.virendrachandak.com/php-isset-vs-empty-vs-is_null/#axzz2oobovYAy This will do exactly as it says. If the variable $_POST['add'] is set then TRUE will be returned (unless the value is NULL). $_POST['add'] will only be set if you have post ed a form containing ...
by MarioParty
Sat Dec 28, 2013 3:26 pm
Forum: PHP coding => General
Topic: How to make object .
Replies: 0
Views: 510

Re: How to make object .

I'm not really sure what you mean? You already have everything that you require. $video = "SELECT * FROM `video123`; $vid = $mysqli->query($video) or die($mysqli->error.__LINE__);     if($vid->num_rows!=0)     {              $video_array = array();              while($row = $vid->fetch_assoc())     ...
by MarioParty
Sat Dec 28, 2013 2:53 pm
Forum: PHP coding => General
Topic: <td> col and rowspan in HEREDOC
Replies: 1
Views: 790

Re: <td> col and rowspan in HEREDOC

If you want a <td> to span over two rows then you must use <td rowspan="2"></td> However I think what you are really looking for is to change the <input type="text" name="_c18" placeholder="Note" value="$record->c18" class="s_ansat_kiosk_g"/> to <textarea name="_c18" placeholder="Note" class="s_ansa...
by MarioParty
Sat Dec 28, 2013 2:16 pm
Forum: PHP General
Topic: confused about the update
Replies: 0
Views: 483

Re: confused about the update

Code: Select all

$sql = ("UPDATE product SET images_2= 'NULL', WHERE product_id='$product_id'");
should be

Code: Select all

$sql = ("UPDATE product SET images_2= 'NULL' WHERE product_id='$product_id'");
by MarioParty
Sat Nov 16, 2013 3:24 am
Forum: PHP General
Topic: Dropdowns
Replies: 0
Views: 548

Re: Dropdowns

Your form method is GET, but you are checking the POST variable. Change one of them.
by MarioParty
Sun Aug 04, 2013 1:58 am
Forum: PHP General
Topic: Php variable
Replies: 1
Views: 668

Re: Php variable

Code: Select all

<?php
$new_variable = ($follow*followers*bytes)/3;
echo $new_variable;
?>
by MarioParty
Sat Aug 03, 2013 3:51 am
Forum: PHP General
Topic: using part page url as reference
Replies: 2
Views: 742

Re: using part page url as reference

What you need to do is something like this: functions.php // Function to get the page name without the extension function get_page_file_name_without_extension($file_name = __FILE__) {   // Get the current page filename   $include_file = $file_name;   // Remove the file extension .php (or any other f...
by MarioParty
Sun Jul 21, 2013 3:00 pm
Forum: PHP General
Topic: using part page url as reference
Replies: 2
Views: 742

Re: using part page url as reference

I don't really understand what you are asking about $aboutmesubtitle1 and $filenamesubtitle1. Here is some altered code to help you do what you need to news.php: <?php // Get the current page filename $include_file = __FILE__; // $include_file = news.php // Include news_content.php include('content....
by MarioParty
Sun Jul 21, 2013 2:56 am
Forum: PHP General
Topic: using part page url as reference
Replies: 2
Views: 742

Re: using part page url as reference

<?php // Get the current page filename $include_file = __FILE__; // Remove the file extension .php (or any other file extension) function remove_extension($filename) {   $ext = pathinfo($filename, PATHINFO_EXTENSION);   return preg_replace('/\.' . preg_quote($ext, '/') . '$/', '', $filename); } $in...
by MarioParty
Fri Aug 19, 2011 5:45 pm
Forum: PHP coding => General
Topic: Help with sending email to long list of users
Replies: 2
Views: 434

Re: Help with sending email to long list of users

If this causes too much server load / activates any spam filters or something like that, consider a more sophisticated approach of sending the list of emails into a table to make a queue and then have a cron run every few minutes to send the e-mails in the queue a small batch at a time.
by MarioParty
Fri Aug 19, 2011 5:41 pm
Forum: PHP coding => General
Topic: Newbie having problems getting started
Replies: 1
Views: 410

Re: Newbie having problems getting started

I think you need to download an editor like PSPad or Notepad++ because your syntax is just wrong everywhere, missing out semi-colons and ending brackets. Try this code below and see what happens <?PHP //connect to the server $connect = mysql_connect("localhost","root",""); ///connect to the database...
by MarioParty
Wed Aug 17, 2011 3:31 pm
Forum: PHP coding => General
Topic: Unique ID Reg
Replies: 0
Views: 303

Re: Unique ID Reg

Is there are reason for having a random seven digit unique ID? Why not just use an auto increment with the first id number starting at 1000000? This not only gives you are seven digit number, but ensures that it is unique.
by MarioParty
Sat Aug 13, 2011 2:34 pm
Forum: PHP coding => General
Topic: mysql_fetch_row/assoc/array against mysql_num_rows in php
Replies: 2
Views: 404

Re: mysql_fetch_row/assoc/array against mysql_num_rows in ph

If you are finding that mysql_num_rows doesn't work (I'm not sure why) try this function from a note in the manual, it might work. <?php  function get_rows ($table_and_query) {          $total = mysql_query("SELECT COUNT(*) FROM " . $table_and_query);          $total = mysql_fetch_array($total);    ...
by MarioParty
Sat Aug 13, 2011 2:26 pm
Forum: PHP coding => General
Topic: Create snippet or token like command to change title of page
Replies: 2
Views: 364

Re: Create snippet or token like command to change title of

I have been looking on this site for an answer to this question with no results. I am not a coder but I have created several php sites and understand about enough code to make me dangerous. I am trying to create a snippet or token like command that I can automatically change a title of a page based...
by MarioParty
Sat Aug 13, 2011 11:03 am
Forum: PHP coding => General
Topic: Dislay correct/incorrect
Replies: 4
Views: 506

Re: Dislay correct/incorrect

Although in showing the results I would like to but a space between the users name and the score, as it is now it shows up (name25/25) using (echo $firstname . $score . '/25<br><br>';) I would like a space between the name and score(name 25/25) I'm sure I missed something very simple, any thoughts....
by MarioParty
Fri Aug 12, 2011 7:42 am
Forum: PHP coding => General
Topic: Need help with question!!!!!!
Replies: 0
Views: 286

Re: Need help with question!!!!!!

We can't do your homework for you. If are you are really stuck use Google. I don't think that PHP is a good idea for the game of life anyway.
by MarioParty
Thu Aug 11, 2011 7:52 pm
Forum: PHP coding => General
Topic: PHP Include help
Replies: 9
Views: 890

Re: PHP Include help

ok sorry for such a long reply ive been very busy. but i tried that and it didnt change anything :( Try posting anything that might be useful, such as the files that call the include, the include itself (which is probably what you have already posted) and also the exact error messages you are getti...
by MarioParty
Thu Aug 11, 2011 2:34 pm
Forum: PHP coding => General
Topic: Warning: Invalid argument supplied for foreach() in
Replies: 0
Views: 259

Re: Warning: Invalid argument supplied for foreach() in

It means the variable $rows is not an array, are you sure it is an array?
by MarioParty
Thu Aug 11, 2011 10:55 am
Forum: PHP coding => General
Topic: php regex help!
Replies: 11
Views: 980

Re: php regex help!

<?php $string = '<field type="type" id="the_id" status="http://www.teststatus.com"><field type="another_type" id="another_id" status="another_status">'; $id_pattern = '/id="(.*?)"/i'; $status_pattern = '/status="(.*?)"/i'; preg_match_all($id_pattern, $string, $matches1); preg_match_all($status_patt...
by MarioParty
Thu Aug 11, 2011 9:14 am
Forum: PHP coding => General
Topic: php regex help!
Replies: 11
Views: 980

Re: php regex help!

haha ok nice! I didn't see you used preg_match instead of _all.. so thats solved now :) Still don't know what \w and /i is though.. searched google but it doesn't give good results with answer.. :( Yes sorry, it was late and didn't think it properly. Like the above posters have said \w simply means...
by MarioParty
Wed Aug 10, 2011 3:20 pm
Forum: PHP coding => General
Topic: php regex help!
Replies: 11
Views: 980

Re: php regex help!

<?php $string = '<field type="type" id="the_id" status="a_status"><field type="another_type" id="another_id" status="another_status">'; $id_pattern = '/id="([\w]+)"/i'; $status_pattern = '/status="([\w]+)"/i'; preg_match($id_pattern, $string, $matches1); preg_match($status_pattern, $string, $matche...
by MarioParty
Wed Aug 10, 2011 2:52 pm
Forum: PHP coding => General
Topic: Splitting a numeric value
Replies: 2
Views: 583

Re: Splitting a numeric value

I'm using the suggestion by egami. However, how would I print each variable separated by a few spaces. print_r ($var0);" " print_r ($var1);" " print_r ($var2); gives me a parse error and a syntax error....how should I do this properly? Thank you guys so much. I appreciate your help and patience! Th...
by MarioParty
Tue Aug 09, 2011 9:10 pm
Forum: PHP coding => General
Topic: Splitting a numeric value
Replies: 2
Views: 583

Re: Splitting a numeric value

Code: Select all

$number = 123456789;
$array = str_split($number);
var_dump($array); 
This should produce an array in the variable $array[0->8] with the numbers 1 through to 9.