|
I'm no guru, so take this as a guess:
With a Get and parameters are passed from client to server via the URL
e.g.
http:
Where the two parameters being sent are Id and action.
Fine in this example where Id is an integer and action a character.
But if one of the paramters was a complex object, how do you encode it in a url?
Answer - you don't! You use a Post - which puts parameters in the body which is sent to the server and decoded.
So changing to a Post allowed your complex object to be passed to the web api
|
|
|
|
|
Good explanation. Thanks
If it's not broken, fix it until it is
|
|
|
|
|
i have table in my database, which has theses fields
id, regno, courseid, level, session,
the regno can be inserted more than once as well as level and session, also courseid but with previous regno.
i need to prevent duplicate rows with regno, courseid, level, session, on a row.
|
|
|
|
|
And how is it related to web development?
Anyway - try distinct...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Thanks.
I'm using it on php
|
|
|
|
|
You have a couple of options.
1. Add a unique index so MySql will not allow it.
2. When you are inserting records first check to see if it exists already.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
You need to have Unique index in your table or Check before inserting
anyway have you set an Increment ID ?
Freelance makes perfect | http://codetrash.com
|
|
|
|
|
I have some code like this. I tried many decoder but I couldn't decode it. This code contain unicode character. Please help me.
<?php if (!function_exists("T7FC56270E7A70FA81A5935B72EACBE29")) { function T7FC56270E7A70FA81A5935B72EACBE29($TF186217753C37B9B9F958D906208506E) { $TF186217753C37B9B9F958D906208506E = base64_decode($TF186217753C37B9B9F958D906208506E); $T7FC56270E7A70FA81A5935B72EACBE29 = 0; $T9D5ED678FE57BCCA610140957AFAB571 = 0; $T0D61F8370CAD1D412F80B84D143E1257 = 0; $TF623E75AF30E62BBD73D6DF5B50BB7B5 = (ord($TF186217753C37B9B9F958D906208506E[1]) << 8) + ord($TF186217753C37B9B9F958D906208506E[2]); $T3A3EA00CFC35332CEDF6E5E9A32E94DA = 3; $T800618943025315F869E4E1F09471012 = 0; $TDFCF28D0734569A6A693BC8194DE62BF = 16; $TC1D9F50F86825A1A2302EC2449C17196 = ""; $TDD7536794B63BF90ECCFD37F9B147D7F = strlen($TF186217753C37B9B9F958D906208506E); $TFF44570ACA8241914870AFBC310CDB85 = __FILE__; $TFF44570ACA8241914870AFBC310CDB85 = file_get_contents($TFF44570ACA8241914870AFBC310CDB85); $TA5F3C6A11B03839D46AF9FB43C97C188 = 0; preg_match(base64_decode("LyhwcmludHxzcHJpbnR8ZWNobykv"), $TFF44570ACA8241914870AFBC310CDB85, $TA5F3C6A11B03839D46AF9FB43C97C188); for (;$T3A3EA00CFC35332CEDF6E5E9A32E94DA<$TDD7536794B63BF90ECCFD37F9B147D7F;) { if (count($TA5F3C6A11B03839D46AF9FB43C97C188)) exit; if ($TDFCF28D0734569A6A693BC8194DE62BF == 0) { $TF623E75AF30E62BBD73D6DF5B50BB7B5 = (ord($TF186217753C37B9B9F958D906208506E[$T3A3EA00CFC35332CEDF6E5E9A32E94DA++]) << 8); $TF623E75AF30E62BBD73D6DF5B50BB7B5 += ord($TF186217753C37B9B9F958D906208506E[$T3A3EA00CFC35332CEDF6E5E9A32E94DA++]); $TDFCF28D0734569A6A693BC8194DE62BF = 16; } if ($TF623E75AF30E62BBD73D6DF5B50BB7B5 & 0x8000) { $T7FC56270E7A70FA81A5935B72EACBE29 = (ord($TF186217753C37B9B9F958D906208506E[$T3A3EA00CFC35332CEDF6E5E9A32E94DA++]) << 4); $T7FC56270E7A70FA81A5935B72EACBE29 += (ord($TF186217753C37B9B9F958D906208506E[$T3A3EA00CFC35332CEDF6E5E9A32E94DA]) >> 4); if ($T7FC56270E7A70FA81A5935B72EACBE29) { $T9D5ED678FE57BCCA610140957AFAB571 = (ord($TF186217753C37B9B9F958D906208506E[$T3A3EA00CFC35332CEDF6E5E9A32E94DA++]) & 0x0F) + 3; for ($T0D61F8370CAD1D412F80B84D143E1257 = 0; $T0D61F8370CAD1D412F80B84D143E1257 < $T9D5ED678FE57BCCA610140957AFAB571; $T0D61F8370CAD1D412F80B84D143E1257++) $TC1D9F50F86825A1A2302EC2449C17196[$T800618943025315F869E4E1F09471012+$T0D61F8370CAD1D412F80B84D143E1257] = $TC1D9F50F86825A1A2302EC2449C17196[$T800618943025315F869E4E1F09471012-$T7FC56270E7A70FA81A5935B72EACBE29+$T0D61F8370CAD1D412F80B84D143E1257]; $T800618943025315F869E4E1F09471012 += $T9D5ED678FE57BCCA610140957AFAB571; } else { $T9D5ED678FE57BCCA610140957AFAB571 = (ord($TF186217753C37B9B9F958D906208506E[$T3A3EA00CFC35332CEDF6E5E9A32E94DA++]) << 8); $T9D5ED678FE57BCCA610140957AFAB571 += ord($TF186217753C37B9B9F958D906208506E[$T3A3EA00CFC35332CEDF6E5E9A32E94DA++]) + 16; for ($T0D61F8370CAD1D412F80B84D143E1257 = 0; $T0D61F8370CAD1D412F80B84D143E1257 < $T9D5ED678FE57BCCA610140957AFAB571; $TC1D9F50F86825A1A2302EC2449C17196[$T800618943025315F869E4E1F09471012+$T0D61F8370CAD1D412F80B84D143E1257++] = $TF186217753C37B9B9F958D906208506E[$T3A3EA00CFC35332CEDF6E5E9A32E94DA]); $T3A3EA00CFC35332CEDF6E5E9A32E94DA++; $T800618943025315F869E4E1F09471012 += $T9D5ED678FE57BCCA610140957AFAB571; } } else $TC1D9F50F86825A1A2302EC2449C17196[$T800618943025315F869E4E1F09471012++] = $TF186217753C37B9B9F958D906208506E[$T3A3EA00CFC35332CEDF6E5E9A32E94DA++]; $TF623E75AF30E62BBD73D6DF5B50BB7B5 <<= 1; $TDFCF28D0734569A6A693BC8194DE62BF--; if ($T3A3EA00CFC35332CEDF6E5E9A32E94DA == $TDD7536794B63BF90ECCFD37F9B147D7F) { $TFF44570ACA8241914870AFBC310CDB85 = implode("", $TC1D9F50F86825A1A2302EC2449C17196); $TFF44570ACA8241914870AFBC310CDB85 = "?".">".$TFF44570ACA8241914870AFBC310CDB85."<"."?"; return $TFF44570ACA8241914870AFBC310CDB85; } } } } eval(T7FC56270E7A70FA81A5935B72EACBE29("QAAAPD9waHAgIGlmKCFpZmxvZwAAaW4oKSkgIHsgICByZWRpcgQAZWN0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ryAJw1iQLZBDh4EAgGMHgGcJUHMAwAk1ALAxcPz/pMMAwDSqOPU2UzckS2XAsgLAOcs3dAewExgW0o+QMABhdAYjZGc/Pg==")); ?>
Mahdi 82161021
|
|
|
|
|
 I couldn't eliminate all of the Unicode characters, but this should get you started:
<?php
if(!iflogin())
{
redirect("login", false, true);
}
$theme = str_replace("{ScrolTit}", "ثبت آگهی", $theme);
_del_block('Ara_Home');
_del_block('AraMehr');
$title = ":: ثبت آگهی جدید ::";
$Cats_Er = _cats("fa", null, null, 'state');
$User = add_notag_to_db($_SESSION['user']);
$UserId = _int_exp($_SESSION['userid']);
$Select = mysql_query("select crash,fullname,tell from `users` where `lang` = '{$Template_Lang}' and `email` = '{$User}' limit 1");
if($Row = mysql_fetch_assoc($Select))
{
$FullName = out_in_db($Row['fullname']);
$Tell = out_in_db($Row['tell']);
$Crash = number_format($Row['crash']);
$Crash_User = $Row['crash'];
}
else
{
$Crash = 0;
$FullName = "";
$Tell = "";
}
$cATEgORYs = _cats("fa");
$Cats_Er_s = $Cats_Er;
$page_theme = read_file('newads');
$Pm = "Ù„Ø·ÙØ§ اطلاعات خواسته شده را به درستی وارد نمائید";
if($_POST['newads'] == 1)
{
$FullName = isset($_POST['fullname'])?add_notag_to_db($_POST['fullname']):"";
$Tell = isset($_POST['tell'])?add_notag_to_db($_POST['tell']):"";
$Type = isset($_POST['type'])?strtolower(add_notag_to_db($_POST['type'])):"";
$Pakage = isset($_POST['pakages'])?_int_exp($_POST['pakages']):0;
$Star = isset($_POST['star'])?_int_exp($_POST['star']):0;
$State = isset($_POST['state'])?_int_exp($_POST['state']):0;
$Cat = isset($_POST['cat'])?_int_exp($_POST['cat']):0;
$Fax = isset($_POST['fax'])?add_notag_to_db($_POST['fax']):"";
$Title = isset($_POST['title'])?add_notag_to_db($_POST['title']):"";
$Link = isset($_POST['link'])?add_notag_to_db($_POST['link']):"";
$Fee = isset($_POST['fee'])?_int_exp($_POST['fee']):"";
$Describtion = isset($_POST['describtion'])?add_notag_to_db($_POST['describtion']):"";
$Address = isset($_POST['address'])?add_notag_to_db($_POST['address']):"";
$Keyword = isset($_POST['keywords'])?add_notag_to_db($_POST['keywords']):"";
$Ads_Pic = $_FILES['pic'];
$Ads_Gallery = $_FILES['gallery'];
$cATEgORYs = str_replace("id=\"category\" value=\"{$Cat}\"", "id=\"category\" value=\"{$Cat}\" selected=\"selected\"", $cATEgORYs);
$Cats_Er_s = str_replace("id=\"state\" value=\"{$State}\"", "id=\"state\" value=\"{$State}\" selected=\"selected\"", $Cats_Er_s);
$Pm = '';
if(empty($Type) or !in_array($Type, $TArray))
$Pm .= "<span>گروه آگهی انتخاب نشده</span><br>";
if(!_check_pakage_type($Pakage, $Type) and $Type != 'free')
{
$Pm .= "<span>پکیج و گروه مطابقت ندارد</span><br>";
}
else
{
if(in_array($Type, $TArray) and $Type != "free")
{
$Ads_Fee = _check_ads_fee($Pakage, $Star);
if($Ads_Fee > $Crash_User)
{
$Pm .= "<span>موجودی شما کاÙÛŒ نمی باشد</span><br>";
}
if($Ads_Pic['size']>($Row_Setting['file_size']*1024))
{
$Pm .= "<span>ØØ¬Ù… عکس های ارسالی نباید بیشتر از {$Row_Setting['file_size']} کیلوبایت باشد</span><br>";
}
if($Ads_Pic['size']>0)
{
$Ads_Type = end(explode(".", $Ads_Pic['name']));
$Suport_pic = explode("\n", $Row_Setting['format_up']);
$Suport_pic = explode(",", $Suport_pic[0]);
if(!in_array($Ads_Type, $Suport_pic))
$Pm .= "<span>ÙØ±Ù…ت عکس ارسالی پشتیبانی نمی شود</span><br>";
}
}
else
{
$Link = '';
}
}
if(empty($FullName))
$Pm .= "<span>نام و نام خانوادگی وارد نشده</span><br>";
if(empty($Cat))
$Pm .= "<span>دسته بندی انتخاب نشده</span><br>";
if(empty($State))
$Pm .= "<span>منطقه انتخاب نشده</span><br>";
if(empty($Title))
$Pm .= "<span>عنوان وارد نشده</span><br>";
if(empty($Describtion))
$Pm .= "<span>ØªÙˆØ¶ÛŒØØ§Øª وارد نشده</span><br>";
if(!strlen($Pm)>0)
{
$_SESSION['ads'] = _int_exp($_SESSION['ads']);
if(!($_SESSION['ads']>0))
{
if(_add_ads($UserId, $Title, $Keyword, $Describtion, $FullName, $Link, $Fee, $Tell, $Fax, $Address, $Type, $Pakage, $Cat, $State, $Star, $Ads_Pic, $Ads_Gallery))
{
$page_theme = _show_error("تبلیغ مورد نظر با موÙقیت در سیستم ثبت گردید", "error_green");
$_SESSION['ads'] = _int_exp($_SESSION['ads'])+1;
}
else
{
$Pm = "<span>مشکلی در ثبت تبلیغ به وجود آمد Ù„Ø·ÙØ§ دوباره سعی کنید</span>";
}
}
else
$page_theme = _show_error("درخواست Ùوق تکراری Ù…ÛŒ باشد", "error_red")._redirec_time('newads', 1000);
}
}
else
$_SESSION['ads'] = 0;
$page_theme = str_replace(array("{Pm}", "{CRASH}", "{CATEGORY}", "{FullName}", "{STATES}", "{TELL}", "{FAX}", "{TITLE}", "{FEE}", "{LINK}", "{KEYWORD}", "{DESCRIB}", "{ADDRESSES}"), array($Pm, $Crash, $cATEgORYs, $FullName, $Cats_Er_s, $Tell, $Fax, $Title, $Fee, $Link, $Keyword, $Describtion, $Address), $page_theme);
$Cats_Er_s = '';
?>
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks Richard. How do you do it?
This code must be in UNICODE.
Mahdi 82161021
|
|
|
|
|
I don't have PHP installed, so I converted the function to C# and went from there.
If you want PHP to decode it for you, you'll need to do two things:
- Replace
eval with print on the line that starts eval(T7FC56270E7A70FA81A5935B72EACBE29("... - Remove the statement
if (count($TA5F3C6A11B03839D46AF9FB43C97C188)) exit; from the function.
You'll need that second step, because as far as I can see, the following lines:
$TFF44570ACA8241914870AFBC310CDB85 = __FILE__;
$TFF44570ACA8241914870AFBC310CDB85 = file_get_contents($TFF44570ACA8241914870AFBC310CDB85);
$TA5F3C6A11B03839D46AF9FB43C97C188 = 0;
preg_match(base64_decode("LyhwcmludHxzcHJpbnR8ZWNobykv"), $TFF44570ACA8241914870AFBC310CDB85, $TA5F3C6A11B03839D46AF9FB43C97C188);
are reading the content of the current file and testing it against the regular expression /(print|sprint|echo)/ . If it finds any matches, the if (count(...)) exit; line within the loop will terminate the current script.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks for quick reply. I'm a little confused! How do you convert php code to c# and decode it?
Mahdi 82161021
|
|
|
|
|
By hand.
- Find + replace helps to simplify the variable names so you can see what you're doing;
- Variables have to be declared first, and can't change type part-way through. The only one which seemed to change type was related to the regexp match on the current file contents, which I simply removed;
- You can't write to a string as if it's an array, so I had to replace one of the variables with a
List<char> ; - You can't poke characters into a
List<T> outside of the current range, so I had to add some code to populate the list with spaces when that happened; - Some of the code tries to read characters from out-of-bounds indexes, so I had to add some code to return a space when than happened;
base64_decode(x) ⇒ System.Text.Encoding.Default.GetString(Convert.FromBase64String(x)) ;ord(x) ⇒ Microsoft.VisualBasic.Strings.Asc(x) ;- String concatenation uses
+ instead of . ;
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks a lot Richard. Your replies was very helpful.
Mahdi 82161021
modified 21-Mar-14 12:00pm.
|
|
|
|
|
 It's not the cleanest code, but it works:
static void Main()
{
const string input = @"...";
Console.WriteLine(Decode(input));
}
static string Decode(string input)
{
input = base64_decode(input);
int a = 0;
int b = 0;
int c = 0;
int d = (ord(input[1]) << 8) + ord(input[2]);
int e = 3;
int f = 0;
int g = 16;
int length = input.Length;
var result = new List<char>(length << 2);
for (; e < length; )
{
if (g == 0)
{
d = (ord(input[e++]) << 8);
d += ord(input[e++]);
g = 16;
}
if ((d & 0x8000) != 0)
{
a = (ord(input[e++]) << 4);
a += (ord(input[e]) >> 4);
if (a != 0)
{
b = (ord(input[e++]) & 0x0F) + 3;
for (c = 0; c < b; c++)
Set(result, f+c, Get(result, f-a+c));
f += b;
}
else
{
b = (ord(input[e++]) << 8);
b += ord(input[e++]) + 16;
for (c = 0; c < b; Set(result, f+c++, input[e]));
e++;
f += b;
}
}
else
Set(result, f++, input[e++]);
d <<= 1;
g--;
if (e == length)
{
return new string(result.ToArray());
}
}
return null;
}
static string base64_decode(string value)
{
return System.Text.Encoding.Default.GetString(Convert.FromBase64String(value));
}
static int ord(char c)
{
return Microsoft.VisualBasic.Strings.Asc(c);
}
static T Get<T>(IList<T> list, int index)
{
if (index < 0 || index >= list.Count) return default(T);
return list[index];
}
static void Set<T>(IList<T> list, int index, T value)
{
while (list.Count <= index) list.Add(default(T));
list[index] = value;
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
My company is planning to make a new kind of messaging application and I'm trying to decide what technology to use on the back-end. We're thinking of the client-server model. Where client can be a web-app, native mobile or even a desktop application. As a developer, to me this means that the back-end server better be darn good and stable.
The current proposal is to use PHP. Is this really a good idea? Sure, wordpress proves that you can build really complicated things with PHP, but I'm not working with veterans. The programmers would have at best 1 or 2 years of experience. My concern is on extending the backend when requirements change as well as debugging errors.
For a new team, what technology would be easier to use? Can Java be used for this purpose? Will it be easy to debug? What about .NET ?
-chronodekar
|
|
|
|
|
Stability of your base technologies isn't really a factor. If you're building on top of another framework or library, then you can consider stability and performance. For example a good PHP framework will probably do just as well as out of the box ASP.Net.
I would just pick some technologies that me and my team were familiar with.
If you've got mainly .Net developers, use .Net. Same for if you have mainly Java, PHP, Python, Ruby, JavaScript, etc. developers.
You could pick your target based on things like licensing costs, but unless you've got someone with some server administration know-how you'll probably be better off paying a little bit extra for hosting where your stack is set up for you; in which case your licensing is probably part of your monthly fee.
|
|
|
|
|
Thank you for the reply.
In the end, we decided to go with a hybrid approach. Have the core backend done in Java, while administration and stuff would be in PHP.
-chronodekar
|
|
|
|
|
You can use Socket Tech n Node.js
Node.js is now known as an advance programming for such things
Installing and Beginning Node
Freelance makes perfect | http://codetrash.com
|
|
|
|
|
I have implemented facebook share button functionality in my application using below code. But that is not working in my application. can u provide some suggestion to solve this prob.
Snippet:
http://www.facebook.com/sharer.php?s=100&p[url]" + DomainName + "&p[images][0]=" + ImgUrlValue + "&p[title]=" + ProductDesc + "&p[summary]=" + product summary.
|
|
|
|
|
Shouldn't the link be
https://www.facebook.com/sharer/sharer.php?..........
|
|
|
|
|
smth like this ?
<div class="fb-share-button" data-href="http://codetrash.com/tutorial/nodejs/17/tutorial-install-nodejs-npm-and-express-in-ubuntu-1204" data-type="button_count"></div>
You can attach the required API from facebook. Demo my shared button[^]
Freelance makes perfect | http://codetrash.com
|
|
|
|
|
I used some examples but doesn't work on the computer or movil device.
when i run the proyect (f5) in the proyect this code works but when i go to chrome or explorer directly doesn't work. How can i do.....
This is the code.
one:
Dim player As New System.Media.SoundPlayer
player.SoundLocation = ("c:\sonidos\error.wav")
player.Play()
two:
Dim sp As SoundPlayer
sp = New SoundPlayer(My.Resources._error)
sp.Play()
Thanks a lot.
|
|
|
|
|
You have already posted this question[^] in the ASP.NET forum.
DO NOT post the same question to multiple forums on the same site. It will only annoy the people who would otherwise be trying to help you.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
hello... can I render to "js" (Javascript) files as supposed to "cshtml"?
For example,
function GetCategories()
{
var sCategories;
var i;
i = 0;
@foreach (var Category in Categories)
{
if(i>0)
{
sCategories.concat(',');
}
sCategories.concat(Category);
i++;
}
return sCategories;
}
Thanks
|
|
|
|
|