Community Member Featured
Member Avatar
cereal 1,242 Gave Reputation to Traevel in PHP Notice: Undefined index: last_id in
Topic by janicemurby in Web Development
php
Using my magical powers I've tried to telepathically deduce the error message you forgot to post and I think if you remove the `'` around `'".$_SESSION['last_id']."'` it might solve your issue. Since your `user_id` column is defined as integer and those single quotes make it a string.

Also, although I … Reply by Traevel
Member Avatar
cereal 1,242 Replied To a Post in PHP Notice: Undefined index: last_id in
Topic by janicemurby in Web Development
php
Hi Janice,

the error is given by this `$_SESSION['last_id']`, because is not set. Before running the query you can make sure the index is set by running:

if(TRUE === array_key_exists('last_id', $_SESSION))
{
# execute query
} Reply by cereal
Member Avatar
hi im struggling with this error see section below if anyone can help be much appreciated ty jan x



<?php
include("config/db_connect.php");
include("config/ckh_session.php");


// Inserting user Details code
if(isset($_POST['submitmeet']))
{
$event_title = addslashes($_POST['event_title']);
$description = addslashes($_POST['description']);


$insert = mysqli_query($conn,"update meets set event_type = '".$_POST['event_type']."' ,
event_date = '".$_POST['event_date']."' ,
stateid = … Topic by janicemurby in Web Development
php
Member Avatar
cereal 1,242 Gave Reputation to Dani in Create random account
Topic by Unknown_1 in Software Development
I was being sarcastic because I run this forum. As a forum owner, why would I want you to spam me? :)

That being said, I recommend you check out [XRumer](https://en.wikipedia.org/wiki/XRumer). It will probably be what you're looking for. Good luck. Reply by Dani
Member Avatar
Topic by rchawdhari in Software Development
Hello, maybe you want to use something like this:

#!/usr/bin/env ruby

h = [{"gate_pass_type_id"=>2, "tag"=>0, "total"=>2000}, {"gate_pass_type_id"=>125, "tag"=>0, "total"=>300}, {"gate_pass_type_id"=>661, "tag"=>0, "total"=>750}, {"gate_pass_type_id"=>661, "tag"=>2, "total"=>100}]

n = Hash.new

h.each do |k|
gate = k.values[0]
tag = k.values[1]
total = k.values[2]

if(n.has_key?(gate) == true)
n[gate] = n[gate].merge({ tag => total }) … Reply by cereal
Member Avatar
Hi all,
This is my array of hash

[{"gate_pass_type_id"=>2, "tag"=>0, "total"=>2000}, {"gate_pass_type_id"=>125, "tag"=>0, "total"=>300}, {"gate_pass_type_id"=>661, "tag"=>0, "total"=>750}, {"gate_pass_type_id"=>661, "tag"=>2, "total"=>100}]

I want to convert it into
[2 => { "0"=> 2000},
125=> {"0"=>300},
661=>{"0" =>750, "2"=>100}]

Is any simple way without using so much loops Topic by rchawdhari in Software Development
Member Avatar
Sponsored cereal 1,242 Replied To a Post in New moderator alert!
Topic by happygeek in Community Center
Congrats! ^_^ Reply by cereal
Member Avatar
Sponsored cereal 1,242 Began Watching New moderator alert!
I am sure that members of DaniWeb will join me in congratulating [rproffitt](https://www.daniweb.com/members/280178/rproffitt) on his promotion to moderator with immediate effect.

While Robert may be a new moderating face to DaniWeb members, not only will you know him from his many contributions to our discussions here but what you might … Topic by happygeek in Community Center
Member Avatar
cereal 1,242 Replied To a Post in Registration form
Topic by Furkan_2 in Web Development
php
Hi,

> so the validation code is not working properly.

can you give details about what does not work properly? Reply by cereal
Member Avatar
Topic by Cameron_4 in Web Development
Hi,

In JavaScript a single `=` is used to **assign** a value and a double `==` is used to **check** a value. Also the term `then` can be removed entirely. You also have an error in the image tag itself, `style= "width:304px;height:500px; <onclick="light()">` should just be `style= "width:304px;height:500px;">`. You already … Reply by Traevel
Member Avatar
Sponsored cereal 1,242 Replied To a Post in Pass value with $_GET using javascript
Topic by SimonIoa in Web Development
php
Hi, do:

print_r($_GET);

inside allSearches.php and see what you get.

//Edit

Oh, wait, I'm not sure I have understood your request. You want to perform an AJAX request with the GET method? Reply by cereal
Member Avatar
Sponsored cereal 1,242 Began Watching Pass value with $_GET using javascript
Hello i made a search box and i want to make a link what will pass the search word that the user put in the search box.
e.g. http://localhost/myproject/allSearches.php?searchword=aa

**aa** is what the user put for search. Now i want to get that, sort it and return the data.

I … Topic by SimonIoa in Web Development
php
Member Avatar
Sponsored cereal 1,242 Replied To a Post in Read / Answer / Ask
Topic by Dani in DaniWeb Community Feedback
Between *Ask* and *Discussion* I prefer *Submit* as it fits both. Reply by cereal
Member Avatar
Sponsored cereal 1,242 Began Watching Read / Answer / Ask
In light of the discussions going on lately about being a discussion community, what do you think about rewording the Read / Answer / Ask in the navigation menu to Read / Answer / Discuss? Would newbies be more likely to click on Ask versus Discuss? But Discuss makes more … Topic by Dani in DaniWeb Community Feedback
Member Avatar
Sponsored cereal 1,242 Replied To a Post in Populate php curl array from submitted json array
Topic by double_cola in Web Development
If 2.3 in `$entry['2.3']` represents the index key sent by the POST request, and so it is the name of an input field:

<input type="text" name="2.3">

then PHP will translate the dots into underscores, so you can match it by doing `$_POST['2_3']`. But I'm a bit lost, I am not … Reply by cereal
Member Avatar
cereal 1,242 Replied To a Post in Registration form
Topic by Furkan_2 in Web Development
php
Hi,

the regular expression used to validate first and last name can fail if there are special characters or a dot, like in `Björk` or `Aldous L. Huxley`, see:

* https://www.w3.org/International/questions/qa-personal-names

So here you may want to use filter_input with FILTER_SANITIZE_STRING:

$fname = filter_input(INPUT_POST, 'firstname', FILTER_SANITIZE_STRING); Reply by cereal
Member Avatar
cereal 1,242 Began Watching Registration form
hi

I am a newbie in PHP and is validating a form in PHP. I have an issue in this validation. The issue is that form validation is not working properly to the all of field.?

// And thats my connection code
<?php
$conn = mysqli_connect("localhost","root","","alkame");//procedural connection
// Check connection … Topic by Furkan_2 in Web Development
php
Member Avatar
Sponsored cereal 1,242 Replied To a Post in Populate php curl array from submitted json array
Topic by double_cola in Web Development
Okay, maybe you want to do this inside your javascript:

var data = {'data' : JSON.stringify( _data )};
...
$.post(
_handler,
data
);

Like this in the PHP side you can write:

$data = json_decode($_POST['data'], TRUE);

Sanitize and encode again and finally send the request through curl. Reply by cereal
Member Avatar
Sponsored cereal 1,242 Replied To a Post in Populate php curl array from submitted json array
Topic by double_cola in Web Development
> I have a form that creats a json array from user input data.
> I need to send that to a php curl file so that it can be sent to an ip address.
> How do I populate the curl data array from that json file?

Hello,

if … Reply by cereal
Member Avatar
Sponsored cereal 1,242 Began Watching Populate php curl array from submitted json array
I have a form that creats a json array from user input data.



Array
(
[full_name] => First Name + Last Name
[company_name] => Company Name
[email] => Email
[free_trial] => trial (Yes/No)
[quota] => quota
[contract] => 0 (0/1)
[per_gb] => cost per gb
[per_month] => contract length in … Topic by double_cola in Web Development
Member Avatar
Sponsored cereal 1,242 Gave Reputation to Dani in Fullscreen editor
Topic by Dani in DaniWeb Community Feedback
Fullscreen mode now has the editor toolbar, including a button to get back for badly behaved browsers. Reply by Dani
Member Avatar
cereal 1,242 Replied To a Post in $_SESSION() issue
Topic by phphp in Web Development
php
If the query does not return a result set, then the loop will not assign any value to $_SESSION and the print statement will show the previous value associated with that index: `$_SESSION['status']`.

I take the above for an example, but if $muser and $mypass are not set then the … Reply by cereal
Member Avatar
cereal 1,242 Began Watching $_SESSION() issue
Sir I am using these codes on login.php

session_start();
$query="select * from w_log where email ='".$muser."' and pass='".$mypass."'";
$result=sqlsrv_query($con,$query)or die ("Error". sqlsrv_errors($con)) ;
while($res = sqlsrv_fetch_array($result)) {
$_SESSION['id']=($res['id']);
$_SESSION['sno']=($res['usno']);
$_SESSION['user']=($res['name']);
$_SESSION['status']=($res['status']);
}
//header("location:../index.php");
//exit();
echo $_SESSION['status'];



$_SESSION['status'] is equal to GENERAL

But when I call this variable at the top … Topic by phphp in Web Development
php
Member Avatar
cereal 1,242 Replied To a Post in CGI Re-direct Question Best Practice
Topic by koneill in Web Development
Hello koneill,

> What happens is that even though the information page has checks that data is filled in - the checkout file if a search crawl hits the page it sends blank info to the generic e-mail box.

Is this script checking on server side too? Since you are … Reply by cereal
Member Avatar
cereal 1,242 Began Watching CGI Re-direct Question Best Practice
All,
I'm looking for the best practice in regard to a CGI shopping cart - I am working on. What happens is that I have a checkout file that sends an email to our generic mail account and shows a thank you image once someone fills in their information. What … Topic by koneill in Web Development
Member Avatar
Topic by kaungzaythu in Web Development
**@Prasanna_5**

Hello, please open a new thread and search also the forum, this thread could help you:

* https://www.daniweb.com/programming/web-development/threads/506840/autocomplete Reply by cereal
Member Avatar
In creating dropdown in my project encounters problems(errors). I'm very new to codeigniter.

Please check and advise what is wrong with with my code?

**Model**

Public function get_region()
{
$return = array();
$query = $this->db->get('region')->result_array();
if( is_array( $query ) && count( $query ) > 0 )
{
$return[''] = 'please … Topic by kaungzaythu in Web Development
Member Avatar
Sponsored cereal 1,242 Replied To a Post in Phone Support Scamming
Topic by Reverend Jim in Microsoft Windows
About the pains of the "unsubscribe": http://www.ted.com/talks/james_veitch_the_agony_of_trying_to_unsubscribe Reply by cereal
Member Avatar
Sponsored cereal 1,242 Began Watching Phone Support Scamming
I got a call from recently from someone claiming to be a Dell tech rep. He said my laptop was reporting multiple errors. Realizing immediately that this was a scam I let him continue while I started a Windows 7 Virtual Machine session. Because I had some free time I … Topic by Reverend Jim in Microsoft Windows
Member Avatar
cereal 1,242 Gave Reputation to diafol in Fetch the data from Other website
Topic by Inter Results in Web Development
C'mon experts! What's keeping you? Reply by diafol